File tree Expand file tree Collapse file tree
YantraJS.Core/FastParser/Parser Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -86,13 +86,23 @@ bool ForStatement(out AstStatement node)
8686
8787 // we need to check if beginNode contains `in` expression
8888 // as `a in b` is a valid single expression
89- if ( beginNode is AstBinaryExpression b
89+ if ( beginNode . Type == FastNodeType . BinaryExpression
90+ && beginNode is AstBinaryExpression b
9091 && b . Operator == TokenTypes . In
9192 && stream . CheckAndConsume ( TokenTypes . BracketEnd ) )
9293 {
9394 @in = true ;
9495 beginNode = b . Left ;
9596 inTarget = b . Right ;
97+
98+ /** This is not working, and we may not support it **/
99+ // this is also special case in non strict mode
100+ // we will need to move variable in outer scope
101+ // if (beginNode.Type == FastNodeType.Identifier)
102+ // {
103+ // var id = (beginNode as AstIdentifier)!;
104+ // scope.AddVariable(id.Start, in id.Name, FastVariableKind.Var);
105+ // }
96106 }
97107 else
98108 {
You can’t perform that action at this time.
0 commit comments