Skip to content

Commit e4ca9f7

Browse files
author
sanex3339
committed
Removed memory leak with identifierNamesGenerator: 'mangled'
1 parent cc85f93 commit e4ca9f7

File tree

7 files changed

+63
-62
lines changed

7 files changed

+63
-62
lines changed

CHANGELOG.md

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,9 @@
11
Change Log
22

3+
v0.28.3
4+
---
5+
* Removed memory leak with `identifierNamesGenerator: 'mangled'`
6+
37
v0.28.2
48
---
59
* Fixed change of kinds of variables for dead code with `deadCodeInjection` option

dist/index.browser.js

Lines changed: 3 additions & 3 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

dist/index.cli.js

Lines changed: 1 addition & 1 deletion
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

dist/index.js

Lines changed: 1 addition & 1 deletion
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

package.json

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{
22
"name": "javascript-obfuscator",
3-
"version": "0.28.2",
3+
"version": "0.28.3",
44
"description": "JavaScript obfuscator",
55
"keywords": [
66
"obfuscator",
@@ -59,18 +59,18 @@
5959
"@types/sinon": "9.0.4",
6060
"@types/string-template": "1.0.2",
6161
"@types/webpack-env": "1.15.2",
62-
"@typescript-eslint/eslint-plugin": "3.0.1",
63-
"@typescript-eslint/parser": "3.0.1",
62+
"@typescript-eslint/eslint-plugin": "3.0.2",
63+
"@typescript-eslint/parser": "3.0.2",
6464
"chai": "4.2.0",
6565
"coveralls": "3.1.0",
6666
"eslint": "7.1.0",
6767
"eslint-plugin-import": "2.20.2",
68-
"eslint-plugin-jsdoc": "25.4.2",
68+
"eslint-plugin-jsdoc": "26.0.0",
6969
"eslint-plugin-no-null": "1.0.2",
7070
"eslint-plugin-prefer-arrow": "1.2.1",
71-
"eslint-plugin-unicorn": "20.0.0",
71+
"eslint-plugin-unicorn": "20.1.0",
7272
"fork-ts-checker-notifier-webpack-plugin": "2.0.0",
73-
"fork-ts-checker-webpack-plugin": "4.1.5",
73+
"fork-ts-checker-webpack-plugin": "4.1.6",
7474
"mocha": "7.2.0",
7575
"nyc": "15.0.1",
7676
"pjson": "1.0.9",

src/generators/identifier-names-generators/MangledIdentifierNamesGenerator.ts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -17,9 +17,9 @@ export class MangledIdentifierNamesGenerator extends AbstractIdentifierNamesGene
1717
private static readonly initMangledNameCharacter: string = '9';
1818

1919
/**
20-
* @type {Map<TNodeWithLexicalScope, string>}
20+
* @type {WeakMap<TNodeWithLexicalScope, string>}
2121
*/
22-
private static readonly lastMangledNameInScopeMap: Map <TNodeWithLexicalScope, string> = new Map();
22+
private static readonly lastMangledNameInScopeMap: WeakMap <TNodeWithLexicalScope, string> = new WeakMap();
2323

2424
/**
2525
* @type {string[]}

yarn.lock

Lines changed: 46 additions & 49 deletions
Original file line numberDiff line numberDiff line change
@@ -409,41 +409,41 @@
409409
resolved "https://registry.yarnpkg.com/@types/webpack-env/-/webpack-env-1.15.2.tgz#927997342bb9f4a5185a86e6579a0a18afc33b0a"
410410
integrity sha512-67ZgZpAlhIICIdfQrB5fnDvaKFcDxpKibxznfYRVAT4mQE41Dido/3Ty+E3xGBmTogc5+0Qb8tWhna+5B8z1iQ==
411411

412-
"@typescript-eslint/eslint-plugin@3.0.1":
413-
version "3.0.1"
414-
resolved "https://registry.yarnpkg.com/@typescript-eslint/eslint-plugin/-/eslint-plugin-3.0.1.tgz#368fe7d4c3d927e9fd27b7ba150b4b7e83ddfabe"
415-
integrity sha512-RxGldRQD3hgOK2xtBfNfA5MMV3rn5gVChe+MIf14hKm51jO2urqF64xOyVrGtzThkrd4rS1Kihqx2nkSxkXHvA==
412+
"@typescript-eslint/eslint-plugin@3.0.2":
413+
version "3.0.2"
414+
resolved "https://registry.yarnpkg.com/@typescript-eslint/eslint-plugin/-/eslint-plugin-3.0.2.tgz#4a114a066e2f9659b25682ee59d4866e15a17ec3"
415+
integrity sha512-ER3bSS/A/pKQT/hjMGCK8UQzlL0yLjuCZ/G8CDFJFVTfl3X65fvq2lNYqOG8JPTfrPa2RULCdwfOyFjZEMNExQ==
416416
dependencies:
417-
"@typescript-eslint/experimental-utils" "3.0.1"
417+
"@typescript-eslint/experimental-utils" "3.0.2"
418418
functional-red-black-tree "^1.0.1"
419419
regexpp "^3.0.0"
420420
semver "^7.3.2"
421421
tsutils "^3.17.1"
422422

423-
"@typescript-eslint/experimental-utils@3.0.1":
424-
version "3.0.1"
425-
resolved "https://registry.yarnpkg.com/@typescript-eslint/experimental-utils/-/experimental-utils-3.0.1.tgz#e2721c970068fabd6621709234809c98cd3343ad"
426-
integrity sha512-GdwOVz80MOWxbc/br1DC30eeqlxfpVzexHgHtf3L0hcbOu1xAs1wSCNcaBTLMOMZbh1gj/cKZt0eB207FxWfFA==
423+
"@typescript-eslint/experimental-utils@3.0.2":
424+
version "3.0.2"
425+
resolved "https://registry.yarnpkg.com/@typescript-eslint/experimental-utils/-/experimental-utils-3.0.2.tgz#bb2131baede8df28ec5eacfa540308ca895e5fee"
426+
integrity sha512-4Wc4EczvoY183SSEnKgqAfkj1eLtRgBQ04AAeG+m4RhTVyaazxc1uI8IHf0qLmu7xXe9j1nn+UoDJjbmGmuqXQ==
427427
dependencies:
428428
"@types/json-schema" "^7.0.3"
429-
"@typescript-eslint/typescript-estree" "3.0.1"
429+
"@typescript-eslint/typescript-estree" "3.0.2"
430430
eslint-scope "^5.0.0"
431431
eslint-utils "^2.0.0"
432432

433-
"@typescript-eslint/parser@3.0.1":
434-
version "3.0.1"
435-
resolved "https://registry.yarnpkg.com/@typescript-eslint/parser/-/parser-3.0.1.tgz#f5163e3a789422f5c62f4daf822bfa03b7e4472d"
436-
integrity sha512-Pn2tDmOc4Ri93VQnT70W0pqQr6i/pEZqIPXfWXm4RuiIprL0t6SG13ViVXHgfScknL2Fm2G4IqXhUzxSRCWXCw==
433+
"@typescript-eslint/parser@3.0.2":
434+
version "3.0.2"
435+
resolved "https://registry.yarnpkg.com/@typescript-eslint/parser/-/parser-3.0.2.tgz#a92ef339added9bf7fb92605ac99c93ef243e834"
436+
integrity sha512-80Z7s83e8QXHNUspqVlWwb4t5gdz/1bBBmafElbK1wwAwiD/yvJsFyHRxlEpNrt4rdK6eB3p+2WEFkEDHAKk9w==
437437
dependencies:
438438
"@types/eslint-visitor-keys" "^1.0.0"
439-
"@typescript-eslint/experimental-utils" "3.0.1"
440-
"@typescript-eslint/typescript-estree" "3.0.1"
439+
"@typescript-eslint/experimental-utils" "3.0.2"
440+
"@typescript-eslint/typescript-estree" "3.0.2"
441441
eslint-visitor-keys "^1.1.0"
442442

443-
"@typescript-eslint/typescript-estree@3.0.1":
444-
version "3.0.1"
445-
resolved "https://registry.yarnpkg.com/@typescript-eslint/typescript-estree/-/typescript-estree-3.0.1.tgz#8c0cfb7cda64bd6f54185a7b7d1923d25d36b2a8"
446-
integrity sha512-FrbMdgVCeIGHKaP9OYTttFTlF8Ds7AkjMca2GzYCE7pVch10PAJc1mmAFt+DfQPgu/2TrLAprg2vI0PK/WTdcg==
443+
"@typescript-eslint/typescript-estree@3.0.2":
444+
version "3.0.2"
445+
resolved "https://registry.yarnpkg.com/@typescript-eslint/typescript-estree/-/typescript-estree-3.0.2.tgz#67a1ce4307ebaea43443fbf3f3be7e2627157293"
446+
integrity sha512-cs84mxgC9zQ6viV8MEcigfIKQmKtBkZNDYf8Gru2M+MhnA6z9q0NFMZm2IEzKqAwN8lY5mFVd1Z8DiHj6zQ3Tw==
447447
dependencies:
448448
debug "^4.1.1"
449449
eslint-visitor-keys "^1.1.0"
@@ -1847,10 +1847,10 @@ eslint-plugin-import@2.20.2:
18471847
read-pkg-up "^2.0.0"
18481848
resolve "^1.12.0"
18491849

1850-
eslint-plugin-jsdoc@25.4.2:
1851-
version "25.4.2"
1852-
resolved "https://registry.yarnpkg.com/eslint-plugin-jsdoc/-/eslint-plugin-jsdoc-25.4.2.tgz#1a8480e880c4d343ba9bc77caf6c91e4500d7a71"
1853-
integrity sha512-IFZnxBBt2fGYZ9yaLt+KP/jHa6u8LQPwH9QzRlhbU+WKBq7ou6XTXoxG0EZVn9ohcbJ0sM8X70iRRX/J3Wu37w==
1850+
eslint-plugin-jsdoc@26.0.0:
1851+
version "26.0.0"
1852+
resolved "https://registry.yarnpkg.com/eslint-plugin-jsdoc/-/eslint-plugin-jsdoc-26.0.0.tgz#91d0d958eec1a2b8915a60462a7a57a665c58ef1"
1853+
integrity sha512-/oEywHPBn6eVDExTgDTwdwyQlVIuJziovXOPXBROW8yW93vk6/IGezW5jbzmA2pX4tVRCQc/jz5/mZea+FCmfw==
18541854
dependencies:
18551855
comment-parser "^0.7.4"
18561856
debug "^4.1.1"
@@ -1870,18 +1870,19 @@ eslint-plugin-prefer-arrow@1.2.1:
18701870
resolved "https://registry.yarnpkg.com/eslint-plugin-prefer-arrow/-/eslint-plugin-prefer-arrow-1.2.1.tgz#9e2943cdae4476e41f94f50dd7a250f267db6865"
18711871
integrity sha512-CPAvdTGG0YbFAJrUKdRBrOJ0X1I7jTtF5VIM4m2Bw1/A2jrhfUeUAcPy4pAEB5DNaUuDqc59f3pKTeiVeamS1A==
18721872

1873-
eslint-plugin-unicorn@20.0.0:
1874-
version "20.0.0"
1875-
resolved "https://registry.yarnpkg.com/eslint-plugin-unicorn/-/eslint-plugin-unicorn-20.0.0.tgz#40c71f7b8bfac7994c64f2698088b4859ff5ef3e"
1876-
integrity sha512-Uob50ZUfqKO4kK3YI3johD3Mnlzs2mWHGELbxFPEWj/2sOAMTV5769t9gGQNzarif+HXRmsKnqZS6XMkfb80Bg==
1873+
eslint-plugin-unicorn@20.1.0:
1874+
version "20.1.0"
1875+
resolved "https://registry.yarnpkg.com/eslint-plugin-unicorn/-/eslint-plugin-unicorn-20.1.0.tgz#a43f60ffc98406d72ec2a5fcc6dad24ba0192bc9"
1876+
integrity sha512-XQxLBJT/gnwyRR6cfYsIK1AdekQchAt5tmcsnldevGjgR2xoZsRUa5/i6e0seNHy2RoT57CkTnbVHwHF8No8LA==
18771877
dependencies:
18781878
ci-info "^2.0.0"
18791879
clean-regexp "^1.0.0"
18801880
eslint-ast-utils "^1.1.0"
1881-
eslint-template-visitor "^1.1.0"
1881+
eslint-template-visitor "^2.0.0"
18821882
eslint-utils "^2.0.0"
18831883
import-modules "^2.0.0"
18841884
lodash "^4.17.15"
1885+
pluralize "^8.0.0"
18851886
read-pkg-up "^7.0.1"
18861887
regexp-tree "^0.1.21"
18871888
reserved-words "^0.1.2"
@@ -1904,14 +1905,14 @@ eslint-scope@^4.0.3:
19041905
esrecurse "^4.1.0"
19051906
estraverse "^4.1.1"
19061907

1907-
eslint-template-visitor@^1.1.0:
1908-
version "1.1.0"
1909-
resolved "https://registry.yarnpkg.com/eslint-template-visitor/-/eslint-template-visitor-1.1.0.tgz#f090d124d1a52e05552149fc50468ed59608b166"
1910-
integrity sha512-Lmy6QVlmFiIGl5fPi+8ACnov3sare+0Ouf7deJAGGhmUfeWJ5fVarELUxZRpsZ9sHejiJUq8626d0dn9uvcZTw==
1908+
eslint-template-visitor@^2.0.0:
1909+
version "2.0.0"
1910+
resolved "https://registry.yarnpkg.com/eslint-template-visitor/-/eslint-template-visitor-2.0.0.tgz#7cb6471ed29a53ab28a1dcbfca38355251c2be06"
1911+
integrity sha512-WijrLXWk/TiiG9FBTeEeb2pj/nD8H4eKIYx1DhTv/c7QoFmelE5P+3gzKUcXWZz88AI2+Wjse9DTV8lXrhcUsw==
19111912
dependencies:
19121913
eslint-visitor-keys "^1.1.0"
1913-
espree "^6.1.1"
1914-
multimap "^1.0.2"
1914+
espree "^7.0.0"
1915+
multimap "^1.1.0"
19151916

19161917
eslint-utils@^2.0.0:
19171918
version "2.0.0"
@@ -1972,15 +1973,6 @@ esm@^3.2.25:
19721973
resolved "https://registry.yarnpkg.com/esm/-/esm-3.2.25.tgz#342c18c29d56157688ba5ce31f8431fbb795cc10"
19731974
integrity sha512-U1suiZ2oDVWv4zPO56S0NcR5QriEahGtdN2OR6FiOG4WJvcjBVFB0qI4+eKoWFH483PKGuLuu6V8Z4T5g63UVA==
19741975

1975-
espree@^6.1.1:
1976-
version "6.2.1"
1977-
resolved "https://registry.yarnpkg.com/espree/-/espree-6.2.1.tgz#77fc72e1fd744a2052c20f38a5b575832e82734a"
1978-
integrity sha512-ysCxRQY3WaXJz9tdbWOwuWr5Y/XrPTGX9Kiz3yoUXwW0VZ4w30HTkQLaGx/+ttFjF8i+ACbArnB4ce68a9m5hw==
1979-
dependencies:
1980-
acorn "^7.1.1"
1981-
acorn-jsx "^5.2.0"
1982-
eslint-visitor-keys "^1.1.0"
1983-
19841976
espree@^7.0.0:
19851977
version "7.0.0"
19861978
resolved "https://registry.yarnpkg.com/espree/-/espree-7.0.0.tgz#8a7a60f218e69f120a842dc24c5a88aa7748a74e"
@@ -2288,10 +2280,10 @@ fork-ts-checker-notifier-webpack-plugin@2.0.0:
22882280
dependencies:
22892281
node-notifier "^6.0.0"
22902282

2291-
fork-ts-checker-webpack-plugin@4.1.5:
2292-
version "4.1.5"
2293-
resolved "https://registry.yarnpkg.com/fork-ts-checker-webpack-plugin/-/fork-ts-checker-webpack-plugin-4.1.5.tgz#780d52c65183742d8c885fff42a9ec9ea7006672"
2294-
integrity sha512-nuD4IDqoOfkEIlS6shhjLGaLBDSNyVJulAlr5lFbPe0saGqlsTo+/HmhtIrs/cNLFtmaudL10byivhxr+Qhh4w==
2283+
fork-ts-checker-webpack-plugin@4.1.6:
2284+
version "4.1.6"
2285+
resolved "https://registry.yarnpkg.com/fork-ts-checker-webpack-plugin/-/fork-ts-checker-webpack-plugin-4.1.6.tgz#5055c703febcf37fa06405d400c122b905167fc5"
2286+
integrity sha512-DUxuQaKoqfNne8iikd14SAkh5uw4+8vNifp6gmA73yYNS6ywLIWSLD/n/mBzHQRpW3J7rbATEakmiA8JvkTyZw==
22952287
dependencies:
22962288
"@babel/code-frame" "^7.5.5"
22972289
chalk "^2.4.1"
@@ -3581,7 +3573,7 @@ ms@^2.1.1:
35813573
resolved "https://registry.yarnpkg.com/ms/-/ms-2.1.2.tgz#d09d1f357b443f493382a8eb3ccd183872ae6009"
35823574
integrity sha512-sGkPx+VjMtmA6MX27oA4FBFELFCZZ4S4XqeGOXCv68tT+jb3vk/RyaKWP0PTKyWtmLSM0b+adUTEvbs1PEaH2w==
35833575

3584-
multimap@^1.0.2:
3576+
multimap@^1.1.0:
35853577
version "1.1.0"
35863578
resolved "https://registry.yarnpkg.com/multimap/-/multimap-1.1.0.tgz#5263febc085a1791c33b59bb3afc6a76a2a10ca8"
35873579
integrity sha512-0ZIR9PasPxGXmRsEF8jsDzndzHDj7tIav+JUmvIFB/WHswliFnquxECT/De7GR4yg99ky/NlRKJT82G1y271bw==
@@ -4162,6 +4154,11 @@ pkg-dir@^4.1.0:
41624154
dependencies:
41634155
find-up "^4.0.0"
41644156

4157+
pluralize@^8.0.0:
4158+
version "8.0.0"
4159+
resolved "https://registry.yarnpkg.com/pluralize/-/pluralize-8.0.0.tgz#1a6fa16a38d12a1901e0320fa017051c539ce3b1"
4160+
integrity sha512-Nc3IT5yHzflTfbjgqWcCPpo7DaKy4FnpB0l/zCAW0Tc7jxAiuqSxHasntB3D7887LSrA93kDJ9IXovxJYxyLCA==
4161+
41654162
posix-character-classes@^0.1.0:
41664163
version "0.1.1"
41674164
resolved "https://registry.yarnpkg.com/posix-character-classes/-/posix-character-classes-0.1.1.tgz#01eac0fe3b5af71a2a6c02feabb8c1fef7e00eab"

0 commit comments

Comments
 (0)