Title: [106198] trunk
Revision
106198
Author
[email protected]
Date
2012-01-29 00:23:48 -0800 (Sun, 29 Jan 2012)

Log 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/_javascript_Core: 

* 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:

Modified Paths

Diff

Modified: trunk/LayoutTests/ChangeLog (106197 => 106198)


--- trunk/LayoutTests/ChangeLog	2012-01-29 03:47:13 UTC (rev 106197)
+++ trunk/LayoutTests/ChangeLog	2012-01-29 08:23:48 UTC (rev 106198)
@@ -1,3 +1,20 @@
+2012-01-28  Gavin Barraclough  <[email protected]>
+
+        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.
+
+        * 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:
+
 2012-01-28  Levi Weintraub  <[email protected]>
 
         Unreviewed gardening. Adding Chromium platform expectations for canvas tests after 106184.

Modified: trunk/LayoutTests/fast/js/keywords-and-reserved_words-expected.txt (106197 => 106198)


--- trunk/LayoutTests/fast/js/keywords-and-reserved_words-expected.txt	2012-01-29 03:47:13 UTC (rev 106197)
+++ trunk/LayoutTests/fast/js/keywords-and-reserved_words-expected.txt	2012-01-29 08:23:48 UTC (rev 106198)
@@ -60,7 +60,7 @@
 PASS classifyIdentifier("super") is "keyword"
 PASS classifyIdentifier("implements") is "strict"
 PASS classifyIdentifier("interface") is "strict"
-PASS classifyIdentifier("let") is "strict"
+PASS classifyIdentifier("let") is "keyword"
 PASS classifyIdentifier("package") is "strict"
 PASS classifyIdentifier("private") is "strict"
 PASS classifyIdentifier("protected") is "strict"

Modified: trunk/LayoutTests/fast/js/reserved-words-as-property-expected.txt (106197 => 106198)


--- trunk/LayoutTests/fast/js/reserved-words-as-property-expected.txt	2012-01-29 03:47:13 UTC (rev 106197)
+++ trunk/LayoutTests/fast/js/reserved-words-as-property-expected.txt	2012-01-29 08:23:48 UTC (rev 106198)
@@ -1335,42 +1335,6 @@
 PASS (function(){"use strict";({ implements: 42 }.implements === 42)}); true is true
 PASS "use strict";({ get implements(){}, set implements(){}, parsedOkay: 42 }.parsedOkay === 42) is true
 PASS (function(){"use strict";({ get implements(){}, set implements(){}, parsedOkay: 42 }.parsedOkay === 42)}); true is true
-PASS var let; true is true
-PASS (function(){var let; true}); true is true
-PASS var let = 42; let === 42 is true
-PASS (function(){var let = 42; let === 42}); true is true
-PASS function g(let){  }; true is true
-PASS (function(){function g(let){  }; true}); true is true
-PASS /let/.test(function g(let){  }) is true
-PASS (function(){/let/.test(function g(let){  })}); true is true
-PASS try{}catch(let){}; true is true
-PASS (function(){try{}catch(let){}; true}); true is true
-PASS function let(){  }; true is true
-PASS (function(){function let(){  }; true}); true is true
-PASS ({ "let": 42 }.let === 42) is true
-PASS (function(){({ "let": 42 }.let === 42)}); true is true
-PASS ({ let: 42 }.let === 42) is true
-PASS (function(){({ let: 42 }.let === 42)}); true is true
-PASS ({ get let(){}, set let(){}, parsedOkay: 42 }.parsedOkay === 42) is true
-PASS (function(){({ get let(){}, set let(){}, parsedOkay: 42 }.parsedOkay === 42)}); true is true
-PASS "use strict";var let; true threw exception SyntaxError: Use of reserved word 'let' in strict mode.
-PASS (function(){"use strict";var let; true}); true threw exception SyntaxError: Use of reserved word 'let' in strict mode.
-PASS "use strict";var let = 42; let === 42 threw exception SyntaxError: Use of reserved word 'let' in strict mode.
-PASS (function(){"use strict";var let = 42; let === 42}); true threw exception SyntaxError: Use of reserved word 'let' in strict mode.
-PASS "use strict";function g(let){ "use strict"; }; true threw exception SyntaxError: Use of reserved word 'let' in strict mode.
-PASS (function(){"use strict";function g(let){ "use strict"; }; true}); true threw exception SyntaxError: Use of reserved word 'let' in strict mode.
-PASS "use strict";/let/.test(function g(let){ "use strict"; }) threw exception SyntaxError: Use of reserved word 'let' in strict mode.
-PASS (function(){"use strict";/let/.test(function g(let){ "use strict"; })}); true threw exception SyntaxError: Use of reserved word 'let' in strict mode.
-PASS "use strict";try{}catch(let){}; true threw exception SyntaxError: Use of reserved word 'let' in strict mode.
-PASS (function(){"use strict";try{}catch(let){}; true}); true threw exception SyntaxError: Use of reserved word 'let' in strict mode.
-PASS "use strict";function let(){ "use strict"; }; true threw exception SyntaxError: Use of reserved word 'let' in strict mode.
-PASS (function(){"use strict";function let(){ "use strict"; }; true}); true threw exception SyntaxError: Use of reserved word 'let' in strict mode.
-PASS "use strict";({ "let": 42 }.let === 42) is true
-PASS (function(){"use strict";({ "let": 42 }.let === 42)}); true is true
-PASS "use strict";({ let: 42 }.let === 42) is true
-PASS (function(){"use strict";({ let: 42 }.let === 42)}); true is true
-PASS "use strict";({ get let(){}, set let(){}, parsedOkay: 42 }.parsedOkay === 42) is true
-PASS (function(){"use strict";({ get let(){}, set let(){}, parsedOkay: 42 }.parsedOkay === 42)}); true is true
 PASS var private; true is true
 PASS (function(){var private; true}); true is true
 PASS var private = 42; private === 42 is true

Modified: trunk/LayoutTests/fast/js/reserved-words-strict-expected.txt (106197 => 106198)


--- trunk/LayoutTests/fast/js/reserved-words-strict-expected.txt	2012-01-29 03:47:13 UTC (rev 106197)
+++ trunk/LayoutTests/fast/js/reserved-words-strict-expected.txt	2012-01-29 08:23:48 UTC (rev 106198)
@@ -6,7 +6,6 @@
 SHOULD BE RESERVED:
 PASS isReserved('implements') is true
 PASS isReserved('interface') is true
-PASS isReserved('let') is true
 PASS isReserved('package') is true
 PASS isReserved('private') is true
 PASS isReserved('protected') is true

Modified: trunk/LayoutTests/fast/js/script-tests/keywords-and-reserved_words.js (106197 => 106198)


--- trunk/LayoutTests/fast/js/script-tests/keywords-and-reserved_words.js	2012-01-29 03:47:13 UTC (rev 106197)
+++ trunk/LayoutTests/fast/js/script-tests/keywords-and-reserved_words.js	2012-01-29 08:23:48 UTC (rev 106198)
@@ -104,7 +104,7 @@
 // Future Reserved Words, in strict mode only.
 shouldBe('classifyIdentifier("implements")', '"strict"');
 shouldBe('classifyIdentifier("interface")', '"strict"');
-shouldBe('classifyIdentifier("let")', '"strict"');
+shouldBe('classifyIdentifier("let")', '"keyword"'); // Experimentally reserving this; this may be reserved in ES6.
 shouldBe('classifyIdentifier("package")', '"strict"');
 shouldBe('classifyIdentifier("private")', '"strict"');
 shouldBe('classifyIdentifier("protected")', '"strict"');

Modified: trunk/LayoutTests/fast/js/script-tests/reserved-words-as-property.js (106197 => 106198)


--- trunk/LayoutTests/fast/js/script-tests/reserved-words-as-property.js	2012-01-29 03:47:13 UTC (rev 106197)
+++ trunk/LayoutTests/fast/js/script-tests/reserved-words-as-property.js	2012-01-29 08:23:48 UTC (rev 106198)
@@ -6,7 +6,6 @@
 
 var strictReservedWords = [
     "implements",
-    "let",
     "private",
     "public",
     "yield",

Modified: trunk/LayoutTests/fast/js/script-tests/reserved-words-strict.js (106197 => 106198)


--- trunk/LayoutTests/fast/js/script-tests/reserved-words-strict.js	2012-01-29 03:47:13 UTC (rev 106197)
+++ trunk/LayoutTests/fast/js/script-tests/reserved-words-strict.js	2012-01-29 08:23:48 UTC (rev 106198)
@@ -14,7 +14,6 @@
 
 var reservedWords = [
     "implements",
-    "let",
     "private",
     "public",
     "yield",

Modified: trunk/Source/_javascript_Core/ChangeLog (106197 => 106198)


--- trunk/Source/_javascript_Core/ChangeLog	2012-01-29 03:47:13 UTC (rev 106197)
+++ trunk/Source/_javascript_Core/ChangeLog	2012-01-29 08:23:48 UTC (rev 106198)
@@ -1,3 +1,15 @@
+2012-01-28  Gavin Barraclough  <[email protected]>
+
+        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.
+
+        * parser/Keywords.table:
+
 2012-01-27  Gavin Barraclough  <[email protected]>
 
         Implement a JIT-code aware sampling profiler for JSC

Modified: trunk/Source/_javascript_Core/parser/Keywords.table (106197 => 106198)


--- trunk/Source/_javascript_Core/parser/Keywords.table	2012-01-29 03:47:13 UTC (rev 106197)
+++ trunk/Source/_javascript_Core/parser/Keywords.table	2012-01-29 08:23:48 UTC (rev 106198)
@@ -43,10 +43,12 @@
 import          RESERVED
 super           RESERVED
 
+# technically RESERVED_IF_STRICT in ES5, but may be reserved in ES6.
+let             RESERVED
+
 # reserved for future use in strict code
 implements      RESERVED_IF_STRICT
 interface       RESERVED_IF_STRICT
-let             RESERVED_IF_STRICT
 package         RESERVED_IF_STRICT
 private         RESERVED_IF_STRICT
 protected       RESERVED_IF_STRICT
_______________________________________________
webkit-changes mailing list
[email protected]
http://lists.webkit.org/mailman/listinfo.cgi/webkit-changes

Reply via email to