Title: [196718] trunk/LayoutTests
- Revision
- 196718
- Author
- [email protected]
- Date
- 2016-02-17 13:33:34 -0800 (Wed, 17 Feb 2016)
Log Message
[ES6] Arrow function. Arrow function should raise exception ReferenceError only when access to 'arguments' on top level
https://bugs.webkit.org/show_bug.cgi?id=152570
Patch by Skachkov Oleksandr <[email protected]> on 2016-02-17
Reviewed by Saam Barati.
Add tests to ensure that arrrow function return error when it binds arguments on top level
* js/arrowfunction-lexical-bind-arguments-top-level-expected.txt: Added.
* js/arrowfunction-lexical-bind-arguments-top-level.html: Added.
* js/script-tests/arrowfunction-lexical-bind-arguments-top-level.js: Added.
Modified Paths
Added Paths
Diff
Modified: trunk/LayoutTests/ChangeLog (196717 => 196718)
--- trunk/LayoutTests/ChangeLog 2016-02-17 21:27:02 UTC (rev 196717)
+++ trunk/LayoutTests/ChangeLog 2016-02-17 21:33:34 UTC (rev 196718)
@@ -1,3 +1,16 @@
+2016-02-17 Skachkov Oleksandr <[email protected]>
+
+ [ES6] Arrow function. Arrow function should raise exception ReferenceError only when access to 'arguments' on top level
+ https://bugs.webkit.org/show_bug.cgi?id=152570
+
+ Reviewed by Saam Barati.
+
+ Add tests to ensure that arrrow function return error when it binds arguments on top level
+
+ * js/arrowfunction-lexical-bind-arguments-top-level-expected.txt: Added.
+ * js/arrowfunction-lexical-bind-arguments-top-level.html: Added.
+ * js/script-tests/arrowfunction-lexical-bind-arguments-top-level.js: Added.
+
2016-02-17 Chris Dumez <[email protected]>
Import W3C HTML reflection tests
Added: trunk/LayoutTests/js/arrowfunction-lexical-bind-arguments-top-level-expected.txt (0 => 196718)
--- trunk/LayoutTests/js/arrowfunction-lexical-bind-arguments-top-level-expected.txt (rev 0)
+++ trunk/LayoutTests/js/arrowfunction-lexical-bind-arguments-top-level-expected.txt 2016-02-17 21:33:34 UTC (rev 196718)
@@ -0,0 +1,13 @@
+Tests for ES6 arrow function lexical bind of arguments on top level
+
+On success, you will see a series of "PASS" messages, followed by "TEST COMPLETE".
+
+
+PASS foo() threw exception ReferenceError: Can't find variable: arguments.
+PASS boo() threw exception ReferenceError: Can't find variable: arguments.
+PASS bar(true) threw exception ReferenceError: Can't find variable: arguments.
+PASS bar(false) is "no-error"
+PASS successfullyParsed is true
+
+TEST COMPLETE
+
Added: trunk/LayoutTests/js/arrowfunction-lexical-bind-arguments-top-level.html (0 => 196718)
--- trunk/LayoutTests/js/arrowfunction-lexical-bind-arguments-top-level.html (rev 0)
+++ trunk/LayoutTests/js/arrowfunction-lexical-bind-arguments-top-level.html 2016-02-17 21:33:34 UTC (rev 196718)
@@ -0,0 +1,10 @@
+<DOCTYPE HTML PUBLIC "-//IETF//DTD HTML//EN">
+<html>
+<head>
+<script src=""
+</head>
+<body>
+<script src=""
+<script src=""
+</body>
+</html>
Added: trunk/LayoutTests/js/script-tests/arrowfunction-lexical-bind-arguments-top-level.js (0 => 196718)
--- trunk/LayoutTests/js/script-tests/arrowfunction-lexical-bind-arguments-top-level.js (rev 0)
+++ trunk/LayoutTests/js/script-tests/arrowfunction-lexical-bind-arguments-top-level.js 2016-02-17 21:33:34 UTC (rev 196718)
@@ -0,0 +1,16 @@
+// jsc always has arguments, but in browser we do not have arguments, so
+// ignore this test in run-jsc-stress-tests, but run in run-webkit-tests.
+//@ skip
+
+description('Tests for ES6 arrow function lexical bind of arguments on top level');
+
+let foo = () => arguments;
+let boo = () => arguments[0];
+let bar = error => error ? arguments : 'no-error';
+
+shouldThrow('foo()');
+shouldThrow('boo()');
+shouldThrow('bar(true)');
+shouldBe('bar(false)', '"no-error"');
+
+var successfullyParsed = true;
_______________________________________________
webkit-changes mailing list
[email protected]
https://lists.webkit.org/mailman/listinfo/webkit-changes