Maximum call stack size exceeded
See original GitHub issuePlease try the simple options below,
options: {
identifierNamesGenerator: 'mangled-shuffled',
reservedNames: ['.*'],
}
Obfuscator version used: 2.9.4
Stack trace
RangeError: Maximum call stack size exceeded
RangeError: Maximum call stack size exceeded
at o.isValidIdentifierName (G:\XXX\node_modules\javascript-obfuscator\dist\webpack:\javascript-obfuscator\src\generators\identifier-names-generators\MangledIdentifierNamesGenerator.ts:87:5)
at o.generateNewMangledName (G:\XXX\node_modules\javascript-obfuscator\dist\webpack:\javascript-obfuscator\src\generators\identifier-names-generators\MangledIdentifierNamesGenerator.ts:126:19)
at o.generateNewMangledName (G:\XXX\node_modules\javascript-obfuscator\dist\webpack:\javascript-obfuscator\src\generators\identifier-names-generators\MangledShuffledIdentifierNamesGenerator.ts:46:22)
at o.generateNewMangledName (G:\XXX\node_modules\javascript-obfuscator\dist\webpack:\javascript-obfuscator\src\generators\identifier-names-generators\MangledIdentifierNamesGenerator.ts:127:35)
at o.generateNewMangledName (G:\XXX\node_modules\javascript-obfuscator\dist\webpack:\javascript-obfuscator\src\generators\identifier-names-generators\MangledShuffledIdentifierNamesGenerator.ts:46:22)
at o.generateNewMangledName (G:\XXX\node_modules\javascript-obfuscator\dist\webpack:\javascript-obfuscator\src\generators\identifier-names-generators\MangledIdentifierNamesGenerator.ts:127:35)
at o.generateNewMangledName (G:\XXX\node_modules\javascript-obfuscator\dist\webpack:\javascript-obfuscator\src\generators\identifier-names-generators\MangledShuffledIdentifierNamesGenerator.ts:46:22)
at o.generateNewMangledName (G:\XXX\node_modules\javascript-obfuscator\dist\webpack:\javascript-obfuscator\src\generators\identifier-names-generators\MangledIdentifierNamesGenerator.ts:127:35)
at o.generateNewMangledName (G:\XXX\node_modules\javascript-obfuscator\dist\webpack:\javascript-obfuscator\src\generators\identifier-names-generators\MangledShuffledIdentifierNamesGenerator.ts:46:22)
at o.generateNewMangledName (G:\XXX\node_modules\javascript-obfuscator\dist\webpack:\javascript-obfuscator\src\generators\identifier-names-generators\MangledIdentifierNamesGenerator.ts:127:35)
at o.generateNewMangledName (G:\XXX\node_modules\javascript-obfuscator\dist\webpack:\javascript-obfuscator\src\generators\identifier-names-generators\MangledShuffledIdentifierNamesGenerator.ts:46:22)
at o.generateNewMangledName (G:\XXX\node_modules\javascript-obfuscator\dist\webpack:\javascript-obfuscator\src\generators\identifier-names-generators\MangledIdentifierNamesGenerator.ts:127:35)
at o.generateNewMangledName (G:\XXX\node_modules\javascript-obfuscator\dist\webpack:\javascript-obfuscator\src\generators\identifier-names-generators\MangledShuffledIdentifierNamesGenerator.ts:46:22)
at o.generateNewMangledName (G:\XXX\node_modules\javascript-obfuscator\dist\webpack:\javascript-obfuscator\src\generators\identifier-names-generators\MangledIdentifierNamesGenerator.ts:127:35)
at o.generateNewMangledName (G:\XXX\node_modules\javascript-obfuscator\dist\webpack:\javascript-obfuscator\src\generators\identifier-names-generators\MangledShuffledIdentifierNamesGenerator.ts:46:22)
at o.generateNewMangledName (G:\XXX\node_modules\javascript-obfuscator\dist\webpack:\javascript-obfuscator\src\generators\identifier-names-generators\MangledIdentifierNamesGenerator.ts:127:35)
npm ERR! code ELIFECYCLE
npm ERR! errno 1
npm ERR! temten@0.1.0 build: `vue-cli-service build`
npm ERR! Exit status 1
In src/generators/identifier-names-generators/MangledIdentifierNamesGenerators.ts
line 231, function isValidIdentifierName
(which is in src/generators/identifier-names-generators/AbstractIdentifierNamesGenerators.ts
) excludes new mangled names that are matched with reservedNames
. I think that’s the problem.
// src/generators/identifier-names-generators/MangledIdentifierNamesGenerators.ts
protected generateNewMangledName (previousMangledName: string): string {
...
if (!this.isValidIdentifierName(newMangledName)) {
newMangledName = this.generateNewMangledName(newMangledName);
}
return newMangledName;
}
// src/generators/identifier-names-generators/AbstractIdentifierNamesGenerators.ts
public isValidIdentifierName (name: string): boolean {
return this.notReservedName(name) && !this.preservedNamesSet.has(name);
}
private notReservedName (name: string): boolean {
return this.options.reservedNames.length
? !this.options.reservedNames.some((reservedName: string) =>
new RegExp(reservedName, 'g').exec(name) !== null
)
: true;
}
In the document, reservedNames
means something should not be obfuscated, in my case, .*
means everything, then when you generate mangled names, you use reservedNames
again for excluding, every mangled name will be excluded, it causes the dead loop.
Issue Analytics
- State:
- Created 3 years ago
- Comments:14 (6 by maintainers)
Top Results From Across the Web
javascript - Maximum call stack size exceeded error
It means that somewhere in your code, you are calling a function which in turn calls another function and so forth, until you...
Read more >JavaScript Error: Maximum Call Stack Size Exceeded
If you see the “Maximum Call Stack Size Exceeded” error, there's likely a problem with a recursive function within your JavaScript code.
Read more >RangeError: Maximum call stack size exceeded - Educative.io
The most common source for this error is infinite recursion. You must have a recursive function in your code whose base case is...
Read more >Uncaught RangeError: Maximum call ... - Net-Informations.Com
Maximum call stack size exceeded error ... This error is almost always means you have a problem with recursion in JavaScript code, as...
Read more >How to fix: "RangeError: Maximum call stack size exceeded"
A "RangeError: Maximum call stack size exceeded" is an error that occurs when a function or operation tries to execute too many nested...
Read more >Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start FreeTop Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
Top GitHub Comments
@sanex3339 eslint/eslint-scope#71 was released in v6.0.0
Please wait until the official support. Even after eslint/eslint-scope#71 i will update #916 branch.