commit-queue@webkit.org | 2a979b3 | 2015-06-26 06:49:20 +0000 | [diff] [blame] | 1 | Tests for ES6 arrow function calling |
| 2 | |
| 3 | On success, you will see a series of "PASS" messages, followed by "TEST COMPLETE". |
| 4 | |
| 5 | |
| 6 | PASS af0(10) is 11 |
| 7 | PASS af1(10) is 20 |
| 8 | PASS af2(1212) is 1000 |
| 9 | PASS af2_1(121) is a |
| 10 | PASS af3(11,12) is 23 |
| 11 | PASS afwrapper(x => 1234) is 1234 |
| 12 | PASS afwrapper(x => 1234, 2345) is 1234 |
| 13 | PASS afwrapper(x => 121 + 232) is 353 |
| 14 | PASS afwrapper(x => 123 + 321, 9999) is 444 |
| 15 | PASS afwrapper(x => x + 12, 21) is 33 |
| 16 | PASS afwrapper((x) => x + 21, 32) is 53 |
| 17 | PASS afwrapper(() => 100) is 100 |
| 18 | PASS afwrapper(() => ext_value) is 121 |
| 19 | PASS afwrapper(() => ext_value * 10) is 1210 |
| 20 | PASS afwrapper((x) => ext_value * x, 30) is ext_value * 30 |
| 21 | PASS afwrapper(() => 100, 11) is 100 |
| 22 | PASS afwrapper(() => 100 + 10) is 110 |
| 23 | PASS afwrapper(() => 100 + 11, 12) is 111 |
| 24 | PASS arrowFunction4(1011) is 1012 |
| 25 | PASS xyz1 is 10101 |
| 26 | PASS afwrapper2((x, y) => x + y, 12 ,43) is 55 |
| 27 | PASS afArr0[0](10) is 100 |
| 28 | PASS afArr1[0](10) is 11 |
| 29 | PASS afArr1[1](11) is 13 |
| 30 | PASS afArr2[0](11) is 12 |
| 31 | PASS afArr2[1](11) is 13 |
| 32 | PASS afArr3[0](11) is 101 |
| 33 | PASS afArr3[1](11) is 12323 |
| 34 | PASS afObj.func(11) is 23 |
| 35 | PASS afBlock0(11) is 1000 |
| 36 | PASS afBlock1(11) is 1100 |
| 37 | PASS afBlock2(11) is 2200 |
| 38 | PASS afBlock3(11, 12222) is 134442 |
| 39 | PASS (function funcSelfExecAE1(value) { var f = x => x+1; return f(value);})(123); is 124 |
| 40 | PASS (function funcSelfExecAE2(value) { var f = x => { x++; return x + 1; }; return f(value);})(123); is 125 |
| 41 | PASS (function funcSelfExecAE3(value) { var f = (x) => { x++; return x + 1; }; return f(value);})(123); is 125 |
| 42 | PASS (function funcSelfExecAE4(value) { var f = (x, y) => { x++; return x + y; }; return f(value, value * 2);})(123); is 370 |
commit-queue@webkit.org | 9a7427f | 2016-01-17 00:04:37 +0000 | [diff] [blame] | 43 | PASS (([a, b]) => a + b)(["a_", "b_"]) is "a_b_" |
| 44 | PASS (({a, b}) => a + b)({a:"a_", b:"b_"}) is "a_b_" |
| 45 | PASS (({c:a, d:b}) => a + b)({c:"a_", d:"b_"}) is "a_b_" |
| 46 | PASS (({c:b, d:a}) => a + b)({c:"a_", d:"b_"}) is "b_a_" |
| 47 | PASS ((x, y, {c:b, d:a}) => x + y + a + b)("x_", "y_", {c:"a_", d:"b_"}) is "x_y_b_a_" |
| 48 | PASS (({c:b, d:a}, x, y) => x + y + a + b)({c:"a_", d:"b_"}, "x_", "y_") is "x_y_b_a_" |
| 49 | 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_" |
| 50 | 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_" |
commit-queue@webkit.org | c6331fc | 2016-01-22 18:47:38 +0000 | [diff] [blame] | 51 | PASS ((x, y = 'default-value') => x + y)('input-value:') is "input-value:default-value" |
| 52 | PASS ((x, y = 'default-value') => x + y)('input-value:', undefined) is "input-value:default-value" |
| 53 | PASS ((x, y = 'default-value') => x + y)() is "undefineddefault-value" |
| 54 | PASS ((x, y = 'default-value') => x + y)('input-value-1:','input-value-2') is "input-value-1:input-value-2" |
commit-queue@webkit.org | 9a7427f | 2016-01-17 00:04:37 +0000 | [diff] [blame] | 55 | PASS arr1(["a_", "b_"]) is "a_b_" |
| 56 | PASS arr2({a:"a_", b:"b_"}) is "a_b_" |
| 57 | PASS arr3({c:"a_", d:"b_"}) is "a_b_" |
| 58 | PASS arr4({c:"a_", d:"b_"}) is "b_a_" |
| 59 | PASS arr5("x_", "y_", {c:"a_", d:"b_"}) is "x_y_b_a_" |
| 60 | PASS arr6({c:"a_", d:"b_"}, "x_", "y_") is "x_y_b_a_" |
| 61 | PASS arr7("x_", "y_", {c:"a_", d:"b_"}, ["e_", "f_"]) is "x_y_b_a_e_f_" |
| 62 | PASS arr8("x_", "y_", {c:"a_", d:"b_"}, ["e_", "f_"], "g_", "h_") is "x_y_b_a_e_f_g_h_" |
commit-queue@webkit.org | c6331fc | 2016-01-22 18:47:38 +0000 | [diff] [blame] | 63 | PASS arr9("input-value:") is "input-value:default-value" |
| 64 | PASS arr9("input-value:", undefined) is "input-value:default-value" |
| 65 | PASS arr9() is "undefineddefault-value" |
| 66 | PASS arr9("input-value-1:", "input-value-2") is "input-value-1:input-value-2" |
commit-queue@webkit.org | 2a979b3 | 2015-06-26 06:49:20 +0000 | [diff] [blame] | 67 | PASS successfullyParsed is true |
| 68 | |
| 69 | TEST COMPLETE |
| 70 | |