Changeset 85455 in webkit


Ignore:
Timestamp:
May 1, 2011 9:51:40 PM (13 years ago)
Author:
oliver@apple.com
Message:

2011-05-01 Oliver Hunt <oliver@apple.com>

Reviewed by Gavin Barraclough.

ES5 Strict mode does not allow getter and setter for same propId
https://bugs.webkit.org/show_bug.cgi?id=57295

Update for correct results

  • fast/js/mozilla/strict/11.1.5-expected.txt:

2011-05-01 Oliver Hunt <oliver@apple.com>

Reviewed by Gavin Barraclough.

ES5 Strict mode does not allow getter and setter for same propId
https://bugs.webkit.org/show_bug.cgi?id=57295

Simplify and correct the logic for strict mode object literals.

  • parser/JSParser.cpp: (JSC::JSParser::parseStrictObjectLiteral):
Location:
trunk
Files:
4 edited

Legend:

Unmodified
Added
Removed
  • trunk/LayoutTests/ChangeLog

    r85454 r85455  
     12011-05-01  Oliver Hunt  <oliver@apple.com>
     2
     3        Reviewed by Gavin Barraclough.
     4
     5        ES5 Strict mode does not allow getter and setter for same propId
     6        https://bugs.webkit.org/show_bug.cgi?id=57295
     7
     8        Update for correct results
     9
     10        * fast/js/mozilla/strict/11.1.5-expected.txt:
     11
    1122011-05-01  Oliver Hunt  <oliver@apple.com>
    213
  • trunk/LayoutTests/fast/js/mozilla/strict/11.1.5-expected.txt

    r78731 r85455  
    7171PASS Function("({set 1(q) {}, \"1\":1})") threw exception of type SyntaxError.
    7272PASS true === true
    73 FAIL !!Function("'use strict'; ({get x() {}, set x(q) {}})") should be true. Threw exception SyntaxError: Parse error
     73PASS !!Function("'use strict'; ({get x() {}, set x(q) {}})") is true
    7474PASS !!Function("({get x() {}, set x(q) {}})") is true
    7575PASS true === true
    76 FAIL !!Function("'use strict'; ({set x(q) {}, get x() {}})") should be true. Threw exception SyntaxError: Parse error
     76PASS !!Function("'use strict'; ({set x(q) {}, get x() {}})") is true
    7777PASS !!Function("({set x(q) {}, get x() {}})") is true
    7878PASS true === true
     
    8989PASS Function("({set x() {}, set x() {}})") threw exception of type SyntaxError.
    9090PASS true === true
    91 FAIL !!Function("'use strict'; ({get x() {}, set x(q) {}, y:1})") should be true. Threw exception SyntaxError: Parse error
     91PASS !!Function("'use strict'; ({get x() {}, set x(q) {}, y:1})") is true
    9292PASS !!Function("({get x() {}, set x(q) {}, y:1})") is true
    9393PASS true === true
  • trunk/Source/JavaScriptCore/ChangeLog

    r85454 r85455  
     12011-05-01  Oliver Hunt  <oliver@apple.com>
     2
     3        Reviewed by Gavin Barraclough.
     4
     5        ES5 Strict mode does not allow getter and setter for same propId
     6        https://bugs.webkit.org/show_bug.cgi?id=57295
     7
     8        Simplify and correct the logic for strict mode object literals.
     9
     10        * parser/JSParser.cpp:
     11        (JSC::JSParser::parseStrictObjectLiteral):
     12
    1132011-05-01  Oliver Hunt  <oliver@apple.com>
    214
  • trunk/Source/JavaScriptCore/parser/JSParser.cpp

    r84846 r85455  
    18101810            std::pair<ObjectValidationMap::iterator, bool> propertyEntryIter = objectValidator.add(context.getName(property).impl(), context.getType(property));
    18111811            if (!propertyEntryIter.second) {
    1812                 failIfTrue(strictMode());
    1813                 if ((context.getType(property) & propertyEntryIter.first->second) != PropertyNode::Constant) {
    1814                     // Can't have multiple getters or setters with the same name, nor can we define
    1815                     // a property as both an accessor and a constant value
    1816                     failIfTrue(context.getType(property) & propertyEntryIter.first->second);
    1817                     failIfTrue((context.getType(property) | propertyEntryIter.first->second) & PropertyNode::Constant);
    1818                 }
     1812                failIfTrue(propertyEntryIter.first->second == PropertyNode::Constant);
     1813                failIfTrue(context.getType(property) == PropertyNode::Constant);
     1814                failIfTrue(context.getType(property) & propertyEntryIter.first->second);
     1815                propertyEntryIter.first->second |= context.getType(property);
    18191816            }
    18201817        }
Note: See TracChangeset for help on using the changeset viewer.