mirror of
https://github.com/javascript-obfuscator/javascript-obfuscator
synced 2026-08-09 12:42:29 +00:00
Upgrade to latest 6.1.2 Espree version.
The attachComment option is removed that's why CommentTransformer refactored to emulate the old behaviour.
This commit is contained in:
@@ -28,12 +28,8 @@ export class JavaScriptObfuscator implements IJavaScriptObfuscator {
|
||||
* @type {Options}
|
||||
*/
|
||||
private static readonly espreeParseOptions: espree.ParseOptions = {
|
||||
attachComment: true,
|
||||
comment: true,
|
||||
ecmaFeatures: {
|
||||
experimentalObjectRestSpread: true
|
||||
},
|
||||
ecmaVersion: 9,
|
||||
ecmaVersion: 10,
|
||||
loc: true,
|
||||
range: true
|
||||
};
|
||||
@@ -160,6 +156,8 @@ export class JavaScriptObfuscator implements IJavaScriptObfuscator {
|
||||
* @returns {Program}
|
||||
*/
|
||||
private transformAstTree (astTree: ESTree.Program): ESTree.Program {
|
||||
astTree = this.runTransformationStage(astTree, TransformationStage.Initializing);
|
||||
|
||||
const isEmptyAstTree: boolean = NodeGuards.isProgramNode(astTree)
|
||||
&& !astTree.body.length
|
||||
&& !astTree.leadingComments
|
||||
|
||||
Reference in New Issue
Block a user