浏览代码

refactoring

sanex3339 9 年之前
父节点
当前提交
279f55ad2a
共有 2 个文件被更改,包括 4 次插入4 次删除
  1. 2 2
      dist/src/node-obfuscators/NodeObfuscator.js
  2. 2 2
      src/node-obfuscators/NodeObfuscator.ts

+ 2 - 2
dist/src/node-obfuscators/NodeObfuscator.js

@@ -10,10 +10,10 @@ class NodeObfuscator {
     replaceNodeIdentifierByNewValue(node, parentNode, namesMap) {
     replaceNodeIdentifierByNewValue(node, parentNode, namesMap) {
         if (NodeUtils_1.NodeUtils.isIdentifierNode(node) && namesMap.has(node.name)) {
         if (NodeUtils_1.NodeUtils.isIdentifierNode(node) && namesMap.has(node.name)) {
             const parentNodeIsAPropertyNode = (NodeUtils_1.NodeUtils.isPropertyNode(parentNode) &&
             const parentNodeIsAPropertyNode = (NodeUtils_1.NodeUtils.isPropertyNode(parentNode) &&
-                parentNode.key === node), parentNodeIsAMemberExpressionNotComputedNode = (NodeUtils_1.NodeUtils.isMemberExpressionNode(parentNode) &&
+                parentNode.key === node), parentNodeIsAMemberExpressionNode = (NodeUtils_1.NodeUtils.isMemberExpressionNode(parentNode) &&
                 parentNode.computed === false &&
                 parentNode.computed === false &&
                 parentNode.property === node);
                 parentNode.property === node);
-            if (parentNodeIsAPropertyNode || parentNodeIsAMemberExpressionNotComputedNode) {
+            if (parentNodeIsAPropertyNode || parentNodeIsAMemberExpressionNode) {
                 return;
                 return;
             }
             }
             node.name = namesMap.get(node.name);
             node.name = namesMap.get(node.name);

+ 2 - 2
src/node-obfuscators/NodeObfuscator.ts

@@ -45,13 +45,13 @@ export abstract class NodeObfuscator implements INodeObfuscator {
                     NodeUtils.isPropertyNode(parentNode) &&
                     NodeUtils.isPropertyNode(parentNode) &&
                     parentNode.key === node
                     parentNode.key === node
                 ),
                 ),
-                parentNodeIsAMemberExpressionNotComputedNode: boolean = (
+                parentNodeIsAMemberExpressionNode: boolean = (
                     NodeUtils.isMemberExpressionNode(parentNode) &&
                     NodeUtils.isMemberExpressionNode(parentNode) &&
                     parentNode.computed === false &&
                     parentNode.computed === false &&
                     parentNode.property === node
                     parentNode.property === node
                 );
                 );
 
 
-            if (parentNodeIsAPropertyNode || parentNodeIsAMemberExpressionNotComputedNode) {
+            if (parentNodeIsAPropertyNode || parentNodeIsAMemberExpressionNode) {
                 return;
                 return;
             }
             }