|
@@ -20,7 +20,7 @@ class VariableDeclarationObfuscator extends NodeObfuscator_1.NodeObfuscator {
|
|
estraverse.replace(declarationNode, {
|
|
estraverse.replace(declarationNode, {
|
|
enter: (node) => {
|
|
enter: (node) => {
|
|
if (node.type !== 'VariableDeclarator') {
|
|
if (node.type !== 'VariableDeclarator') {
|
|
- return;
|
|
|
|
|
|
+ return estraverse.VisitorOption.Skip;
|
|
}
|
|
}
|
|
estraverse.replace(node.id, {
|
|
estraverse.replace(node.id, {
|
|
enter: (node) => {
|
|
enter: (node) => {
|
|
@@ -43,7 +43,9 @@ class VariableDeclarationObfuscator extends NodeObfuscator_1.NodeObfuscator {
|
|
let isNodeAfterVariableDeclaratorFlag = false, isNodeBeforeVariableDeclaratorFlag = true, functionParentScope, functionNextNode, functionIndex = -1;
|
|
let isNodeAfterVariableDeclaratorFlag = false, isNodeBeforeVariableDeclaratorFlag = true, functionParentScope, functionNextNode, functionIndex = -1;
|
|
estraverse.replace(scopeNode, {
|
|
estraverse.replace(scopeNode, {
|
|
enter: (node, parentNode) => {
|
|
enter: (node, parentNode) => {
|
|
- if (node.parentNode && (node.type === 'FunctionDeclaration' || node.type === 'FunctionExpression')) {
|
|
|
|
|
|
+ if (node.type === 'FunctionDeclaration' ||
|
|
|
|
+ node.type === 'FunctionExpression' ||
|
|
|
|
+ node.type === 'ArrowFunctionExpression') {
|
|
functionParentScope = NodeUtils_1.NodeUtils.getNodeScope(node);
|
|
functionParentScope = NodeUtils_1.NodeUtils.getNodeScope(node);
|
|
functionIndex = functionParentScope.body.indexOf(node);
|
|
functionIndex = functionParentScope.body.indexOf(node);
|
|
if (functionIndex >= 0) {
|
|
if (functionIndex >= 0) {
|