Currently the output of browser and node is identical.
But there is a difference between them.
Code exmple:
class A { static async one(){ } static async two(){ await A.one() } }
When using target=Brwoser:
class A { static async ['one']() { } static async ['two']() { await A['one'](); } }
When using target=node:
class _0xd91f5a { static async ['one']() { } static async ['two']() { await A['one'](); } }
When running with a target node you get error because A is not defined
Will try to fix soon
renameGlobals breaking this code too
renameGlobals
@LiadDrori currently Node target should affect only how identifiers are renamed
Should sanitize class scopes like this:
// fast fix of class scopes scope.childScopes.filter((scope: eslintScope.Scope) => { if (scope.type === 'class') { const upperVariable: eslintScope.Variable = <any>scope.upper?.variables.find((variable: eslintScope.Variable) => { return variable.name === scope.variables[0].name; }); upperVariable.references.push(...scope.variables[0].references); return false; } });
After this pr, here should be no difference between Node and Browser targets in terms of variable names.
Released as 0.24.1 please try it
0.24.1
Nice!
Activity
sanex3339 commentedon Jan 27, 2020
Will try to fix soon
sanex3339 commentedon Jan 27, 2020
renameGlobalsbreaking this code toosanex3339 commentedon Jan 27, 2020
@LiadDrori currently Node target should affect only how identifiers are renamed
sanex3339 commentedon Jan 27, 2020
Should sanitize class scopes like this:
sanex3339 commentedon Jan 27, 2020
After this pr, here should be no difference between Node and Browser targets in terms of variable names.
sanex3339 commentedon Jan 27, 2020
Released as
0.24.1please try itsanex3339 commentedon Jan 27, 2020
Nice!