Title: [195461] trunk/LayoutTests
Revision
195461
Author
[email protected]
Date
2016-01-22 10:47:38 -0800 (Fri, 22 Jan 2016)

Log Message

[ES6] Arrow function. Default arguments in arrow functions
https://bugs.webkit.org/show_bug.cgi?id=152537

Patch by Skachkov Oleksandr <[email protected]> on 2016-01-22
Reviewed by Saam Barati.

Default arguments in arrow function parameters have been already
implemented by patch from issue https://bugs.webkit.org/show_bug.cgi?id=146934.
Current patch adds only tests for this feature

* js/arrowfunction-syntax-expected.txt:
* js/script-tests/arrowfunction-syntax.js:

Modified Paths

Diff

Modified: trunk/LayoutTests/ChangeLog (195460 => 195461)


--- trunk/LayoutTests/ChangeLog	2016-01-22 18:44:46 UTC (rev 195460)
+++ trunk/LayoutTests/ChangeLog	2016-01-22 18:47:38 UTC (rev 195461)
@@ -1,3 +1,17 @@
+2016-01-22  Skachkov Oleksandr  <[email protected]>
+
+        [ES6] Arrow function. Default arguments in arrow functions
+        https://bugs.webkit.org/show_bug.cgi?id=152537
+
+        Reviewed by Saam Barati.
+
+        Default arguments in arrow function parameters have been already 
+        implemented by patch from issue https://bugs.webkit.org/show_bug.cgi?id=146934. 
+        Current patch adds only tests for this feature  
+
+        * js/arrowfunction-syntax-expected.txt:
+        * js/script-tests/arrowfunction-syntax.js:
+
 2016-01-22  Keith Miller  <[email protected]>
 
         [ES6] Add Symbol.species properties to the relevant constructors

Modified: trunk/LayoutTests/js/arrowfunction-syntax-expected.txt (195460 => 195461)


--- trunk/LayoutTests/js/arrowfunction-syntax-expected.txt	2016-01-22 18:44:46 UTC (rev 195460)
+++ trunk/LayoutTests/js/arrowfunction-syntax-expected.txt	2016-01-22 18:47:38 UTC (rev 195461)
@@ -48,6 +48,10 @@
 PASS (({c:b, d:a}, x, y) => x + y + a + b)({c:"a_", d:"b_"}, "x_", "y_") is "x_y_b_a_"
 PASS ((x, y, {c:b, d:a}, [e, f]) => x + y + a + b + e + f)("x_", "y_", {c:"a_", d:"b_"}, ["e_", "f_"]) is "x_y_b_a_e_f_"
 PASS ((x, y, {c:b, d:a}, [e, f], ...theArgs) => x + y + a + b + e + f + theArgs[0] + theArgs[1])("x_", "y_", {c:"a_", d:"b_"}, ["e_", "f_"], "g_", "h_") is "x_y_b_a_e_f_g_h_"
+PASS ((x, y = 'default-value') => x + y)('input-value:') is "input-value:default-value"
+PASS ((x, y = 'default-value') => x + y)('input-value:', undefined) is "input-value:default-value"
+PASS ((x, y = 'default-value') => x + y)() is "undefineddefault-value"
+PASS ((x, y = 'default-value') => x + y)('input-value-1:','input-value-2') is "input-value-1:input-value-2"
 PASS arr1(["a_", "b_"]) is "a_b_"
 PASS arr2({a:"a_", b:"b_"}) is "a_b_"
 PASS arr3({c:"a_", d:"b_"}) is "a_b_"
@@ -56,6 +60,10 @@
 PASS arr6({c:"a_", d:"b_"}, "x_", "y_") is "x_y_b_a_"
 PASS arr7("x_", "y_", {c:"a_", d:"b_"}, ["e_", "f_"]) is "x_y_b_a_e_f_"
 PASS arr8("x_", "y_", {c:"a_", d:"b_"}, ["e_", "f_"], "g_", "h_") is "x_y_b_a_e_f_g_h_"
+PASS arr9("input-value:") is "input-value:default-value"
+PASS arr9("input-value:", undefined) is "input-value:default-value"
+PASS arr9() is "undefineddefault-value"
+PASS arr9("input-value-1:", "input-value-2") is "input-value-1:input-value-2"
 PASS successfullyParsed is true
 
 TEST COMPLETE

Modified: trunk/LayoutTests/js/script-tests/arrowfunction-syntax.js (195460 => 195461)


--- trunk/LayoutTests/js/script-tests/arrowfunction-syntax.js	2016-01-22 18:44:46 UTC (rev 195460)
+++ trunk/LayoutTests/js/script-tests/arrowfunction-syntax.js	2016-01-22 18:47:38 UTC (rev 195461)
@@ -87,6 +87,10 @@
 shouldBe('(({c:b, d:a}, x, y) => x + y + a + b)({c:"a_", d:"b_"}, "x_", "y_")', '"x_y_b_a_"');
 shouldBe('((x, y, {c:b, d:a}, [e, f]) => x + y + a + b + e + f)("x_", "y_", {c:"a_", d:"b_"}, ["e_", "f_"])', '"x_y_b_a_e_f_"');
 shouldBe('((x, y, {c:b, d:a}, [e, f], ...theArgs) => x + y + a + b + e + f + theArgs[0] + theArgs[1])("x_", "y_", {c:"a_", d:"b_"}, ["e_", "f_"], "g_", "h_")', '"x_y_b_a_e_f_g_h_"');
+shouldBe("((x, y = 'default-value') => x + y)('input-value:')",'"input-value:default-value"');
+shouldBe("((x, y = 'default-value') => x + y)('input-value:', undefined)",'"input-value:default-value"');
+shouldBe("((x, y = 'default-value') => x + y)()",'"undefineddefault-value"');
+shouldBe("((x, y = 'default-value') => x + y)('input-value-1:','input-value-2')",'"input-value-1:input-value-2"');
 
 var arr1 = ([a, b]) => a + b;
 shouldBe('arr1(["a_", "b_"])', '"a_b_"');
@@ -112,4 +116,10 @@
 var arr8 = (x, y, {c:b, d:a}, [e, f], ...theArgs) => x + y + a + b + e + f + theArgs[0] + theArgs[1];
 shouldBe('arr8("x_", "y_", {c:"a_", d:"b_"}, ["e_", "f_"], "g_", "h_")', '"x_y_b_a_e_f_g_h_"');
 
+var arr9 = (x, y = 'default-value') => x + y;
+shouldBe('arr9("input-value:")','"input-value:default-value"');
+shouldBe('arr9("input-value:", undefined)','"input-value:default-value"');
+shouldBe('arr9()','"undefineddefault-value"');
+shouldBe('arr9("input-value-1:", "input-value-2")','"input-value-1:input-value-2"');
+
 var successfullyParsed = true;
_______________________________________________
webkit-changes mailing list
[email protected]
https://lists.webkit.org/mailman/listinfo/webkit-changes

Reply via email to