Merge branch 'master' into harmony-v3.0.20
This commit is contained in:
@@ -1230,9 +1230,12 @@ function parse($TEXT, options) {
|
||||
var is_in = is("operator", "in");
|
||||
var is_of = is("name", "of");
|
||||
if (is_in || is_of) {
|
||||
if ((init instanceof AST_Definitions) &&
|
||||
init.definitions.length > 1)
|
||||
croak("Only one variable declaration allowed in for..in loop");
|
||||
if (init instanceof AST_Definitions) {
|
||||
if (init.definitions.length > 1)
|
||||
croak("Only one variable declaration allowed in for..in loop", init.start.line, init.start.col, init.start.pos);
|
||||
} else if (!(is_assignable(init) || (init = to_destructuring(init)) instanceof AST_Destructuring)) {
|
||||
croak("Invalid left-hand side in for..in loop", init.start.line, init.start.col, init.start.pos);
|
||||
}
|
||||
next();
|
||||
if (is_in) {
|
||||
return for_in(init);
|
||||
|
||||
Reference in New Issue
Block a user