Skip to content
  • oliver@apple.com's avatar
    Try to kill initialiser expression in for-in statements · 8788100d
    oliver@apple.com authored
    https://bugs.webkit.org/show_bug.cgi?id=121311
    
    Reviewed by Gavin Barraclough.
    
    Source/JavaScriptCore:
    
    We'd like to get rid of this pointless initialiser expression
    in for-in statements.  Unfortunately we have to keep the no_in
    variant of expression parsing to avoid ambiguity in the grammar.
    There's a possibility that this will need to be rolled out, but
    we'll need to live on it to see.
    
    * bytecompiler/NodesCodegen.cpp:
    (JSC::ForInNode::emitBytecode):
    * parser/ASTBuilder.h:
    (JSC::ASTBuilder::createForInLoop):
    * parser/NodeConstructors.h:
    (JSC::ForInNode::ForInNode):
    * parser/Nodes.h:
    * parser/Parser.cpp:
    (JSC::::parseForStatement):
    * parser/SyntaxChecker.h:
    (JSC::SyntaxChecker::createForInLoop):
    
    LayoutTests:
    
    Update test cases to represent the new reality
    
    * js/line-column-numbers-expected.txt:
    * js/line-column-numbers.html:
    * js/parser-syntax-check-expected.txt:
    * js/script-tests/function-declaration-statement.js:
    * js/script-tests/line-column-numbers.js:
    (try.toFuzz22b):
    * js/script-tests/parser-syntax-check.js:
    * js/script-tests/toString-for-var-decl.js:
    (f1):
    
    git-svn-id: http://svn.webkit.org/repository/webkit/trunk@155724 268f45cc-cd09-0410-ab3c-d52691b4dbfc
    8788100d