shift-scope
Advanced tools
Comparing version 1.0.0 to 1.0.1
@@ -69,11 +69,24 @@ "use strict"; | ||
ScopeAnalyzer.prototype.reduceForInStatement = function (node, left, right, body) { | ||
var s = MonoidalReducer.prototype.reduceForInStatement.call(this, node, left, right, body); | ||
if (node.left.type === "IdentifierExpression") { | ||
return this.append(right, body).addReference(new WriteReference(node.left.identifier)); | ||
} else if (node.left.type === "VariableDeclaration" && node.left.declarators[0].init == null) { | ||
s = s.addReference(new WriteReference(node.left.declarators[0].binding)); | ||
} else { | ||
// node.left.type === "VariableDeclaration" | ||
var declarator = node.left.declarators[0]; | ||
if (declarator.init == null) { | ||
left = left.addReference(new WriteReference(declarator.binding)); | ||
} | ||
if (left.blockScopedDeclarations.size > 0) { | ||
return this.append(this.append(left, body).finish(node, ScopeType.BLOCK), right); | ||
} | ||
return MonoidalReducer.prototype.reduceForInStatement.call(this, node, left, right, body); | ||
} | ||
return s; | ||
}; | ||
ScopeAnalyzer.prototype.reduceForStatement = function (node, init, test, update, body) { | ||
if (node.init.type === "VariableDeclaration" && init.blockScopedDeclarations.size > 0) { | ||
return this.append3(this.append(init, body).finish(node, ScopeType.BLOCK), test, update); | ||
} | ||
return MonoidalReducer.prototype.reduceForStatement.call(this, node, init, test, update, body); | ||
}; | ||
ScopeAnalyzer.prototype.reduceFunctionDeclaration = function (node, name, parameters, functionBody) { | ||
@@ -147,2 +160,2 @@ return node.parameters.reduce(function (s, p) { | ||
exports["default"] = ScopeAnalyzer; | ||
//# sourceMappingURL=data:application/json;base64,eyJ2ZXJzaW9uIjozLCJzb3VyY2VzIjpbInNyYy9zY29wZS1hbmFseXplci5qcyJdLCJuYW1lcyI6W10sIm1hcHBpbmdzIjoiOzs7Ozs7Ozs7Ozs7OztJQWdCTyxNQUFNO0lBQUcsZUFBZSw0QkFBZixlQUFlO0lBQ3hCLFVBQVU7SUFDVCxhQUFhLDBCQUFiLGFBQWE7SUFBRSxjQUFjLDBCQUFkLGNBQWM7SUFBRSxrQkFBa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0gbnVsbCkge1xuICAgICAgcyA9IHMuYWRkUmVmZXJlbmNlKG5ldyBXcml0ZVJlZmVyZW5jZShub2RlLmJpbmRpbmcpKTtcbiAgICB9XG4gICAgcmV0dXJuIHM7XG4gIH1cblxuICByZWR1Y2VXaXRoU3RhdGVtZW50KG5vZGUsIG9iamVjdCwgYm9keSkge1xuICAgIHJldHVybiBzdXBlci5yZWR1Y2VXaXRoU3RhdGVtZW50KG5vZGUsIG9iamVjdCwgYm9keS5maW5pc2gobm9kZSwgU2NvcGVUeXBlLldJVEgpKTtcbiAgfVxufVxuIl19 |
{ | ||
"name": "shift-scope", | ||
"version": "1.0.0", | ||
"version": "1.0.1", | ||
"description": "produce a scope tree for Shift format ASTs", | ||
@@ -5,0 +5,0 @@ "author": "Shape Security Labs", |
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
70235
466