@@ -428,7 +428,7 @@ var AST_For = DEFNODE("For", "init condition step", {
|
|||||||
}, AST_IterationStatement);
|
}, AST_IterationStatement);
|
||||||
|
|
||||||
var AST_ForEnumeration = DEFNODE("ForEnumeration", "init object", {
|
var AST_ForEnumeration = DEFNODE("ForEnumeration", "init object", {
|
||||||
$documentation: "Base class for enumeration loops, i.e. `for ... in`, `for ... of` & `for await ... of`",
|
$documentation: "Base class for enumeration loops, i.e. `for ... in`, `for ... of` & `for await ... of`",
|
||||||
$propdoc: {
|
$propdoc: {
|
||||||
init: "[AST_Node] the assignment target during iteration",
|
init: "[AST_Node] the assignment target during iteration",
|
||||||
object: "[AST_Node] the object to iterate over"
|
object: "[AST_Node] the object to iterate over"
|
||||||
|
|||||||
@@ -108,6 +108,7 @@ function is_lhs(node, parent) {
|
|||||||
if (parent instanceof AST_DefaultValue) return parent.name === node && node;
|
if (parent instanceof AST_DefaultValue) return parent.name === node && node;
|
||||||
if (parent instanceof AST_Destructured) return node;
|
if (parent instanceof AST_Destructured) return node;
|
||||||
if (parent instanceof AST_DestructuredKeyVal) return node;
|
if (parent instanceof AST_DestructuredKeyVal) return node;
|
||||||
|
if (parent instanceof AST_ForEnumeration) return parent.init === node && node;
|
||||||
if (parent instanceof AST_Unary) return unary_side_effects[parent.operator] && parent.expression;
|
if (parent instanceof AST_Unary) return unary_side_effects[parent.operator] && parent.expression;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -977,3 +977,25 @@ issue_4432: {
|
|||||||
}
|
}
|
||||||
expect_stdout: "PASS"
|
expect_stdout: "PASS"
|
||||||
}
|
}
|
||||||
|
|
||||||
|
issue_4696: {
|
||||||
|
options = {
|
||||||
|
arguments: true,
|
||||||
|
keep_fargs: false,
|
||||||
|
}
|
||||||
|
input: {
|
||||||
|
console.log(function() {
|
||||||
|
for (arguments in [ 42 ]);
|
||||||
|
for (var a in arguments[0])
|
||||||
|
return "PASS";
|
||||||
|
}());
|
||||||
|
}
|
||||||
|
expect: {
|
||||||
|
console.log(function() {
|
||||||
|
for (arguments in [ 42 ]);
|
||||||
|
for (var a in arguments[0])
|
||||||
|
return "PASS";
|
||||||
|
}());
|
||||||
|
}
|
||||||
|
expect_stdout: "PASS"
|
||||||
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user