js-confuser
js-confuser copied to clipboard
escodegen library related to this project
escodegen library related to this project
node_modules/escodegen/escodegen.js:2516
result = this[type](expr, precedence, flags);
^
TypeError: this[type] is not a function
at CodeGenerator.generateExpression (/node_modules/escodegen/escodegen.js:2516:28)
Version in my package-lock.json: 2.3.0
Config
Config:
{
target: "node",
preset: "low",
renameGlobals: false
}
For anyone else running into this, there's a maintained fork of escodegen which doesn't have this issue: https://www.npmjs.com/package/escodegen-wallaby
Workaround:
- Fork this repository (example).
bun install escodegen-wallaby && bun remove escodegenthen find and replacerequire("escodegen")withrequire("escodegen-wallaby)".- Remove
distfrom.gitignore. bun run buildthen commit and push everything.- Add to your project with
bun install $gh_username/js-confuser.
But it does have other issues related to the output - it's concatenating an identifier somewhere, obfuscated code breaks because there's various [object Object] dotted about. Not sure where to go from there.
Fixed in 2.0 (Currently 2.0.0-alpha.2). The 2.0 version nows uses Babel's parser and generator and is more suited for modern JavaScript syntax.