Changeset 106198 in webkit


Ignore:
Timestamp:
Jan 29, 2012 12:23:48 AM (12 years ago)
Author:
barraclough@apple.com
Message:

Reserve 'let'
https://bugs.webkit.org/show_bug.cgi?id=77293

Rubber stamped by Oliver Hunt.

'let' may become a keyword in ES6. We're going to try experimentally reserving it,
to see if this breaks the web.

Source/JavaScriptCore:

  • parser/Keywords.table:

LayoutTests:

  • fast/js/keywords-and-reserved_words-expected.txt:
  • fast/js/reserved-words-as-property-expected.txt:
  • fast/js/reserved-words-strict-expected.txt:
  • fast/js/script-tests/keywords-and-reserved_words.js:
  • fast/js/script-tests/reserved-words-as-property.js:
  • fast/js/script-tests/reserved-words-strict.js:
Location:
trunk
Files:
9 edited

Legend:

Unmodified
Added
Removed
  • trunk/LayoutTests/ChangeLog

    r106194 r106198  
     12012-01-28  Gavin Barraclough  <barraclough@apple.com>
     2
     3        Reserve 'let'
     4        https://bugs.webkit.org/show_bug.cgi?id=77293
     5
     6        Rubber stamped by Oliver Hunt.
     7
     8        'let' may become a keyword in ES6.  We're going to try experimentally reserving it,
     9        to see if this breaks the web.
     10
     11        * fast/js/keywords-and-reserved_words-expected.txt:
     12        * fast/js/reserved-words-as-property-expected.txt:
     13        * fast/js/reserved-words-strict-expected.txt:
     14        * fast/js/script-tests/keywords-and-reserved_words.js:
     15        * fast/js/script-tests/reserved-words-as-property.js:
     16        * fast/js/script-tests/reserved-words-strict.js:
     17
    1182012-01-28  Levi Weintraub  <leviw@chromium.org>
    219
  • trunk/LayoutTests/fast/js/keywords-and-reserved_words-expected.txt

    r89109 r106198  
    6161PASS classifyIdentifier("implements") is "strict"
    6262PASS classifyIdentifier("interface") is "strict"
    63 PASS classifyIdentifier("let") is "strict"
     63PASS classifyIdentifier("let") is "keyword"
    6464PASS classifyIdentifier("package") is "strict"
    6565PASS classifyIdentifier("private") is "strict"
  • trunk/LayoutTests/fast/js/reserved-words-as-property-expected.txt

    r104750 r106198  
    13361336PASS "use strict";({ get implements(){}, set implements(){}, parsedOkay: 42 }.parsedOkay === 42) is true
    13371337PASS (function(){"use strict";({ get implements(){}, set implements(){}, parsedOkay: 42 }.parsedOkay === 42)}); true is true
    1338 PASS var let; true is true
    1339 PASS (function(){var let; true}); true is true
    1340 PASS var let = 42; let === 42 is true
    1341 PASS (function(){var let = 42; let === 42}); true is true
    1342 PASS function g(let){  }; true is true
    1343 PASS (function(){function g(let){  }; true}); true is true
    1344 PASS /let/.test(function g(let){  }) is true
    1345 PASS (function(){/let/.test(function g(let){  })}); true is true
    1346 PASS try{}catch(let){}; true is true
    1347 PASS (function(){try{}catch(let){}; true}); true is true
    1348 PASS function let(){  }; true is true
    1349 PASS (function(){function let(){  }; true}); true is true
    1350 PASS ({ "let": 42 }.let === 42) is true
    1351 PASS (function(){({ "let": 42 }.let === 42)}); true is true
    1352 PASS ({ let: 42 }.let === 42) is true
    1353 PASS (function(){({ let: 42 }.let === 42)}); true is true
    1354 PASS ({ get let(){}, set let(){}, parsedOkay: 42 }.parsedOkay === 42) is true
    1355 PASS (function(){({ get let(){}, set let(){}, parsedOkay: 42 }.parsedOkay === 42)}); true is true
    1356 PASS "use strict";var let; true threw exception SyntaxError: Use of reserved word 'let' in strict mode.
    1357 PASS (function(){"use strict";var let; true}); true threw exception SyntaxError: Use of reserved word 'let' in strict mode.
    1358 PASS "use strict";var let = 42; let === 42 threw exception SyntaxError: Use of reserved word 'let' in strict mode.
    1359 PASS (function(){"use strict";var let = 42; let === 42}); true threw exception SyntaxError: Use of reserved word 'let' in strict mode.
    1360 PASS "use strict";function g(let){ "use strict"; }; true threw exception SyntaxError: Use of reserved word 'let' in strict mode.
    1361 PASS (function(){"use strict";function g(let){ "use strict"; }; true}); true threw exception SyntaxError: Use of reserved word 'let' in strict mode.
    1362 PASS "use strict";/let/.test(function g(let){ "use strict"; }) threw exception SyntaxError: Use of reserved word 'let' in strict mode.
    1363 PASS (function(){"use strict";/let/.test(function g(let){ "use strict"; })}); true threw exception SyntaxError: Use of reserved word 'let' in strict mode.
    1364 PASS "use strict";try{}catch(let){}; true threw exception SyntaxError: Use of reserved word 'let' in strict mode.
    1365 PASS (function(){"use strict";try{}catch(let){}; true}); true threw exception SyntaxError: Use of reserved word 'let' in strict mode.
    1366 PASS "use strict";function let(){ "use strict"; }; true threw exception SyntaxError: Use of reserved word 'let' in strict mode.
    1367 PASS (function(){"use strict";function let(){ "use strict"; }; true}); true threw exception SyntaxError: Use of reserved word 'let' in strict mode.
    1368 PASS "use strict";({ "let": 42 }.let === 42) is true
    1369 PASS (function(){"use strict";({ "let": 42 }.let === 42)}); true is true
    1370 PASS "use strict";({ let: 42 }.let === 42) is true
    1371 PASS (function(){"use strict";({ let: 42 }.let === 42)}); true is true
    1372 PASS "use strict";({ get let(){}, set let(){}, parsedOkay: 42 }.parsedOkay === 42) is true
    1373 PASS (function(){"use strict";({ get let(){}, set let(){}, parsedOkay: 42 }.parsedOkay === 42)}); true is true
    13741338PASS var private; true is true
    13751339PASS (function(){var private; true}); true is true
  • trunk/LayoutTests/fast/js/reserved-words-strict-expected.txt

    r90535 r106198  
    77PASS isReserved('implements') is true
    88PASS isReserved('interface') is true
    9 PASS isReserved('let') is true
    109PASS isReserved('package') is true
    1110PASS isReserved('private') is true
  • trunk/LayoutTests/fast/js/script-tests/keywords-and-reserved_words.js

    r98407 r106198  
    105105shouldBe('classifyIdentifier("implements")', '"strict"');
    106106shouldBe('classifyIdentifier("interface")', '"strict"');
    107 shouldBe('classifyIdentifier("let")', '"strict"');
     107shouldBe('classifyIdentifier("let")', '"keyword"'); // Experimentally reserving this; this may be reserved in ES6.
    108108shouldBe('classifyIdentifier("package")', '"strict"');
    109109shouldBe('classifyIdentifier("private")', '"strict"');
  • trunk/LayoutTests/fast/js/script-tests/reserved-words-as-property.js

    r98407 r106198  
    77var strictReservedWords = [
    88    "implements",
    9     "let",
    109    "private",
    1110    "public",
  • trunk/LayoutTests/fast/js/script-tests/reserved-words-strict.js

    r98407 r106198  
    1515var reservedWords = [
    1616    "implements",
    17     "let",
    1817    "private",
    1918    "public",
  • trunk/Source/JavaScriptCore/ChangeLog

    r106197 r106198  
     12012-01-28  Gavin Barraclough  <barraclough@apple.com>
     2
     3        Reserve 'let'
     4        https://bugs.webkit.org/show_bug.cgi?id=77293
     5
     6        Rubber stamped by Oliver Hunt.
     7
     8        'let' may become a keyword in ES6.  We're going to try experimentally reserving it,
     9        to see if this breaks the web.
     10
     11        * parser/Keywords.table:
     12
    1132012-01-27  Gavin Barraclough  <barraclough@apple.com>
    214
  • trunk/Source/JavaScriptCore/parser/Keywords.table

    r89109 r106198  
    4444super           RESERVED
    4545
     46# technically RESERVED_IF_STRICT in ES5, but may be reserved in ES6.
     47let             RESERVED
     48
    4649# reserved for future use in strict code
    4750implements      RESERVED_IF_STRICT
    4851interface       RESERVED_IF_STRICT
    49 let             RESERVED_IF_STRICT
    5052package         RESERVED_IF_STRICT
    5153private         RESERVED_IF_STRICT
Note: See TracChangeset for help on using the changeset viewer.