Repository navigation
Maximum call stack size exceeded #881
Description
Activity
I faced same issue when used regex in reservedNames.
But i used something like"\\$\\$"as i rememberI am facing the same issue with default settings and this input:
class Foo { foo; }
Reacted by JavaScript_WriterI am facing the same issue with default settings and this input:
class Foo { foo; }
were you able to solve this ?
Hi. We have to wait until eslint/eslint-scope#71 will be merged
@sanex3339 Sorry to bother, and thank you for all of your time and help. I was curious about the following:
I cloned your repo locally, merged #916 with
master, upgradedtypescriptto4.4.0-beta, and rebuiltindex.browser.jswithnpm run build(I also had to add
globalObject: 'this'tomodule.exports.outputinwebpack.browser.jsdue to running into the error: https://stackoverflow.com/questions/64639839/typescript-webpack-library-generates-referenceerror-self-is-not-defined)I then tried obfuscating a JS file with classes with properties, and still ran into
RangeError: Maximum call stack size exceeded. I removed the class properties and the obfuscation ran successfully.Would you expect obfuscation to fail (for class properties) even with my local attempt to merge #916 with
master?Thank you, sanex3339!
Please wait until the official support. Even after eslint/eslint-scope#71 i will update #916 branch.
Reacted by regnaio and JavaScript_WriterPlease wait until the official support. Even after eslint/eslint-scope#71 i will update #916 branch.
will this fix Class properties support as well?
With the next
eslint-scoperelease i will continue to add class properties support to the obfuscatorReacted by JavaScript_Writerits merged ✌️
Yes. But the release date of
eslint-scopeis still unknown.Reacted by regnaio@sanex3339 eslint/eslint-scope#71 was released in v6.0.0
Reacted by Timofey Kachalov and regnaioJust tried out sanex3339's merge of #916! Seems to work perfectly for classes 😄
Has this been fixed for the initial regex problem that this issue was opened for? I'm getting
RangeError: Maximum call stack size exceededwhen using the grunt obfuscator plugin. Here's my JS:$(async () => { var d = new $.Deferred(); $.ajax({ url: "/customers", method: "GET", headers: { "App-Source": "FLEX DB Web Reader" }, success: (res) => { console.log("We got a response: ", res); d.resolve(res); }, error: (err) => { d.reject(err); } }); var rawData = await d; $("#gridContainer").dxDataGrid({ dataSource: rawData, loadMode: "raw", sorting: { mode: "single" }, filterRow: { visible: true }, searchPanel: { visible: true, highlightCaseSensitive: true, }, groupPanel: { visible: true }, paging: { pageSize: 10 }, pager: { showPageSizeSelector: true, allowedPageSizes: [10, 25, 50, 100], }, allowColumnReordering: true, rowAlternationEnabled: true, showBorders: true, columns: [ { dataField: "name", caption: "Customer Name", }, { dataField: "addr1", caption: "Address Line 1", }, { dataField: "addr2", caption: "Address Line 2", }, { dataField: "city", caption: "City", }, { dataField: "state", caption: "State", }, { dataField: "zip", caption: "Postal / Zip code", }, { dataField: "country", caption: "Country", }, { dataField: "phone", caption: "Phone", }, { dataField: "email", caption: "E-mail", } ], }); });And I'm using these options:
options: { renamePropertiesMode: 'safe', selfDefend: false, reservedNames: ["\$.*"], reservedStrings: ["\$\."] }This is part of a different issue- when I use the default options, the code won't run because I get this error:
Uncaught TypeError: $[_0x283738(...)] is not a functionWhich is pointing to here:
$(async()=>{ var _0x283738 = _0x5a53 , _0x586abb = new $[(_0x283738(0x194))](); $[_0x283738(0x18f)]({ // this line here is where the error is raised from 'url': _0x283738(0x192), 'method': _0x283738(0x17f), 'headers': { 'App-Source': _0x283738(0x197) ... et cWill be fixed in 5.4.0 later today
Reacted by wxfred and regnaio
Please try the simple options below,
Obfuscator version used: 2.9.4
Stack trace
In
src/generators/identifier-names-generators/MangledIdentifierNamesGenerators.tsline 231, functionisValidIdentifierName(which is insrc/generators/identifier-names-generators/AbstractIdentifierNamesGenerators.ts) excludes new mangled names that are matched withreservedNames. I think that's the problem.In the document,
reservedNamesmeans something should not be obfuscated, in my case,.*means everything, then when you generate mangled names, you usereservedNamesagain for excluding, every mangled name will be excluded, it causes the dead loop.