Changeset 195461 in webkit


Ignore:
Timestamp:
Jan 22, 2016 10:47:38 AM (8 years ago)
Author:
commit-queue@webkit.org
Message:

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

Patch by Skachkov Oleksandr <gskachkov@gmail.com> 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:
Location:
trunk/LayoutTests
Files:
3 edited

Legend:

Unmodified
Added
Removed
  • trunk/LayoutTests/ChangeLog

    r195460 r195461  
     12016-01-22  Skachkov Oleksandr  <gskachkov@gmail.com>
     2
     3        [ES6] Arrow function. Default arguments in arrow functions
     4        https://bugs.webkit.org/show_bug.cgi?id=152537
     5
     6        Reviewed by Saam Barati.
     7
     8        Default arguments in arrow function parameters have been already
     9        implemented by patch from issue https://bugs.webkit.org/show_bug.cgi?id=146934.
     10        Current patch adds only tests for this feature 
     11
     12        * js/arrowfunction-syntax-expected.txt:
     13        * js/script-tests/arrowfunction-syntax.js:
     14
    1152016-01-22  Keith Miller  <keith_miller@apple.com>
    216
  • trunk/LayoutTests/js/arrowfunction-syntax-expected.txt

    r195178 r195461  
    4949PASS ((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_"
    5050PASS ((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_"
     51PASS ((x, y = 'default-value') => x + y)('input-value:') is "input-value:default-value"
     52PASS ((x, y = 'default-value') => x + y)('input-value:', undefined) is "input-value:default-value"
     53PASS ((x, y = 'default-value') => x + y)() is "undefineddefault-value"
     54PASS ((x, y = 'default-value') => x + y)('input-value-1:','input-value-2') is "input-value-1:input-value-2"
    5155PASS arr1(["a_", "b_"]) is "a_b_"
    5256PASS arr2({a:"a_", b:"b_"}) is "a_b_"
     
    5761PASS arr7("x_", "y_", {c:"a_", d:"b_"}, ["e_", "f_"]) is "x_y_b_a_e_f_"
    5862PASS arr8("x_", "y_", {c:"a_", d:"b_"}, ["e_", "f_"], "g_", "h_") is "x_y_b_a_e_f_g_h_"
     63PASS arr9("input-value:") is "input-value:default-value"
     64PASS arr9("input-value:", undefined) is "input-value:default-value"
     65PASS arr9() is "undefineddefault-value"
     66PASS arr9("input-value-1:", "input-value-2") is "input-value-1:input-value-2"
    5967PASS successfullyParsed is true
    6068
  • trunk/LayoutTests/js/script-tests/arrowfunction-syntax.js

    r195178 r195461  
    8888shouldBe('((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_"');
    8989shouldBe('((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_"');
     90shouldBe("((x, y = 'default-value') => x + y)('input-value:')",'"input-value:default-value"');
     91shouldBe("((x, y = 'default-value') => x + y)('input-value:', undefined)",'"input-value:default-value"');
     92shouldBe("((x, y = 'default-value') => x + y)()",'"undefineddefault-value"');
     93shouldBe("((x, y = 'default-value') => x + y)('input-value-1:','input-value-2')",'"input-value-1:input-value-2"');
    9094
    9195var arr1 = ([a, b]) => a + b;
     
    113117shouldBe('arr8("x_", "y_", {c:"a_", d:"b_"}, ["e_", "f_"], "g_", "h_")', '"x_y_b_a_e_f_g_h_"');
    114118
     119var arr9 = (x, y = 'default-value') => x + y;
     120shouldBe('arr9("input-value:")','"input-value:default-value"');
     121shouldBe('arr9("input-value:", undefined)','"input-value:default-value"');
     122shouldBe('arr9()','"undefineddefault-value"');
     123shouldBe('arr9("input-value-1:", "input-value-2")','"input-value-1:input-value-2"');
     124
    115125var successfullyParsed = true;
Note: See TracChangeset for help on using the changeset viewer.