Browse Source

fixed tslint errors

sanex3339 8 years ago
parent
commit
32a54535cb

+ 5 - 5
dist/index.js

@@ -180,7 +180,7 @@ var NodeUtils = function () {
         }
     }, {
         key: "clone",
-        value: function clone(node) {
+        value: function clone(astTree) {
             var cloneRecursive = function cloneRecursive(node) {
                 var copy = {};
                 Object.keys(node).filter(function (property) {
@@ -201,7 +201,7 @@ var NodeUtils = function () {
                 });
                 return copy;
             };
-            return NodeUtils.parentize(cloneRecursive(node));
+            return NodeUtils.parentize(cloneRecursive(astTree));
         }
     }, {
         key: "convertCodeToStructure",
@@ -5360,11 +5360,11 @@ var DeadCodeInjectionTransformer = DeadCodeInjectionTransformer_1 = function (_A
         }
     }], [{
         key: "collectBlockStatementNodes",
-        value: function collectBlockStatementNodes(node, collectedBlockStatements) {
-            if (!Node_1.Node.isBlockStatementNode(node) || !DeadCodeInjectionTransformer_1.isValidBlockStatementNode(node)) {
+        value: function collectBlockStatementNodes(targetNode, collectedBlockStatements) {
+            if (!Node_1.Node.isBlockStatementNode(targetNode) || !DeadCodeInjectionTransformer_1.isValidBlockStatementNode(targetNode)) {
                 return;
             }
-            var clonedBlockStatementNode = NodeUtils_1.NodeUtils.clone(node);
+            var clonedBlockStatementNode = NodeUtils_1.NodeUtils.clone(targetNode);
             estraverse.replace(clonedBlockStatementNode, {
                 enter: function enter(node, parentNode) {
                     if (Node_1.Node.isIdentifierNode(node)) {

+ 4 - 4
src/node-transformers/dead-code-injection-transformers/DeadCodeInjectionTransformer.ts

@@ -30,15 +30,15 @@ export class DeadCodeInjectionTransformer extends AbstractNodeTransformer {
     }
 
     /**
-     * @param node
+     * @param targetNode
      * @param collectedBlockStatements
      */
-    private static collectBlockStatementNodes (node: ESTree.Node, collectedBlockStatements: ESTree.BlockStatement[]): void {
-        if (!Node.isBlockStatementNode(node) || !DeadCodeInjectionTransformer.isValidBlockStatementNode(node)) {
+    private static collectBlockStatementNodes (targetNode: ESTree.Node, collectedBlockStatements: ESTree.BlockStatement[]): void {
+        if (!Node.isBlockStatementNode(targetNode) || !DeadCodeInjectionTransformer.isValidBlockStatementNode(targetNode)) {
             return;
         }
 
-        const clonedBlockStatementNode: ESTree.BlockStatement = <ESTree.BlockStatement>NodeUtils.clone(node);
+        const clonedBlockStatementNode: ESTree.BlockStatement = <ESTree.BlockStatement>NodeUtils.clone(targetNode);
 
         estraverse.replace(clonedBlockStatementNode, {
             enter: (node: ESTree.Node, parentNode: ESTree.Node): any => {

+ 4 - 4
src/node/NodeUtils.ts

@@ -41,11 +41,11 @@ export class NodeUtils {
     }
 
     /**
-     * @param node
+     * @param astTree
      * @return {ESTree.Node}
      */
-    public static clone (node: ESTree.Node): ESTree.Node {
-        const cloneRecursive: (node: ESTree.Node) => ESTree.Node = (node) => {
+    public static clone (astTree: ESTree.Node): ESTree.Node {
+        const cloneRecursive: (node: ESTree.Node) => ESTree.Node = (node: ESTree.Node) => {
             const copy: {[key: string]: any} = {};
 
             Object
@@ -72,7 +72,7 @@ export class NodeUtils {
             return <ESTree.Node>copy;
         };
 
-        return NodeUtils.parentize(cloneRecursive(node));
+        return NodeUtils.parentize(cloneRecursive(astTree));
     };
 
     /**