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/parser/Nodes.h

    r164261 r166243  
    153153        virtual bool isConstant() const { return false; }
    154154        virtual bool isLocation() const { return false; }
     155        virtual bool isAssignmentLocation() const { return isLocation(); }
    155156        virtual bool isResolveNode() const { return false; }
    156157        virtual bool isBracketAccessorNode() const { return false; }
     
    16771678
    16781679    private:
    1679         virtual bool isLocation() const override { return true; }
     1680        virtual bool isAssignmentLocation() const override { return true; }
    16801681        virtual bool isDeconstructionNode() const override { return true; }
    16811682        virtual RegisterID* emitBytecode(BytecodeGenerator&, RegisterID* = 0) override;
Note: See TracChangeset for help on using the changeset viewer.