Ignore:
Timestamp:
Sep 13, 2013, 2:19:38 PM (12 years ago)
Author:
[email protected]
Message:

Try to kill initialiser expression in for-in statements
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):

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/Source/JavaScriptCore/bytecompiler/NodesCodegen.cpp

    r155711 r155724  
    16741674    generator.emitDebugHook(WillExecuteStatement, firstLine(), lastLine(), startOffset(), lineStartOffset());
    16751675
    1676     if (m_init)
    1677         generator.emitNode(generator.ignoredResult(), m_init);
    1678 
    16791676    RefPtr<RegisterID> base = generator.newTemporary();
    16801677    generator.emitNode(base.get(), m_expr);
Note: See TracChangeset for help on using the changeset viewer.