Ignore:
Timestamp:
Mar 25, 2014, 1:06:07 PM (11 years ago)
Author:
[email protected]
Message:

AST incorrectly conflates readable and writable locations
https://bugs.webkit.org/show_bug.cgi?id=130734

Reviewed by Filip Pizlo.

Source/JavaScriptCore:

We need to distinguish between "locations" that are valid for reading
and writing, vs those that may only be written.

  • bytecompiler/NodesCodegen.cpp:

(JSC::ForInNode::emitBytecode):
(JSC::ForOfNode::emitBytecode):

  • parser/Nodes.h:

(JSC::ExpressionNode::isAssignmentLocation):

LayoutTests:

More tests

  • js/parser-syntax-check-expected.txt:
  • js/script-tests/parser-syntax-check.js:
File:
1 edited

Legend:

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

    r166240 r166243  
    18061806    LabelScopePtr scope = generator.newLabelScope(LabelScope::Loop);
    18071807
    1808     if (!m_lexpr->isLocation()) {
     1808    if (!m_lexpr->isAssignmentLocation()) {
    18091809        emitThrowReferenceError(generator, "Left side of for-in statement is not a reference.");
    18101810        return;
     
    19021902void ForOfNode::emitBytecode(BytecodeGenerator& generator, RegisterID* dst)
    19031903{
    1904     if (!m_lexpr->isLocation()) {
     1904    if (!m_lexpr->isAssignmentLocation()) {
    19051905        emitThrowReferenceError(generator, "Left side of for-of statement is not a reference.");
    19061906        return;
Note: See TracChangeset for help on using the changeset viewer.