commit-queue@webkit.org | 2a979b3 | 2015-06-26 06:49:20 +0000 | [diff] [blame] | 1 | Tests for ES6 arrow function syntax errors |
| 2 | |
| 3 | On success, you will see a series of "PASS" messages, followed by "TEST COMPLETE". |
| 4 | |
| 5 | |
utatane.tea@gmail.com | 2be03b2 | 2015-08-03 21:26:07 +0000 | [diff] [blame] | 6 | PASS =>{} threw exception SyntaxError: Unexpected token '=>'. |
commit-queue@webkit.org | 2a979b3 | 2015-06-26 06:49:20 +0000 | [diff] [blame] | 7 | PASS x=> threw exception SyntaxError: Unexpected end of script. |
| 8 | PASS x=>* threw exception SyntaxError: Unexpected token '*'. |
| 9 | PASS x=>/ threw exception SyntaxError: Unexpected token '/'. Invalid regular expression.. |
| 10 | PASS x=>% threw exception SyntaxError: Unexpected token '%'. |
| 11 | PASS x=>+ threw exception SyntaxError: Unexpected end of script. |
| 12 | PASS x=>- threw exception SyntaxError: Unexpected end of script. |
| 13 | PASS x=><< threw exception SyntaxError: Unexpected token '<<'. |
| 14 | PASS x=>>> threw exception SyntaxError: Unexpected token '>>'. |
| 15 | PASS x=>>>> threw exception SyntaxError: Unexpected token '>>>'. |
| 16 | PASS x=>< threw exception SyntaxError: Unexpected token '<'. |
| 17 | PASS x=>> threw exception SyntaxError: Unexpected token '>'. |
| 18 | PASS x=><= threw exception SyntaxError: Unexpected token '<='. |
| 19 | PASS x=>>= threw exception SyntaxError: Unexpected token '>='. |
| 20 | PASS x=>instanceof threw exception SyntaxError: Unexpected keyword 'instanceof'. |
| 21 | PASS x=>in threw exception SyntaxError: Unexpected keyword 'in'. |
| 22 | PASS x=>== threw exception SyntaxError: Unexpected token '=='. |
| 23 | PASS x=>!= threw exception SyntaxError: Unexpected token '!='. |
| 24 | PASS x=>=== threw exception SyntaxError: Unexpected token '==='. |
| 25 | PASS x=>!== threw exception SyntaxError: Unexpected token '!=='. |
| 26 | PASS x=>& threw exception SyntaxError: Unexpected token '&'. |
| 27 | PASS x=>^ threw exception SyntaxError: Unexpected token '^'. |
| 28 | PASS x=>| threw exception SyntaxError: Unexpected token '|'. |
| 29 | PASS x=>&& threw exception SyntaxError: Unexpected token '&&'. |
| 30 | PASS x=>|| threw exception SyntaxError: Unexpected token '||'. |
| 31 | PASS x=>; threw exception SyntaxError: Unexpected token ';'. |
| 32 | PASS x=>, threw exception SyntaxError: Unexpected token ','. |
| 33 | PASS x=>{ threw exception SyntaxError: Unexpected end of script. |
| 34 | PASS x=>{* threw exception SyntaxError: Unexpected token '*'. |
| 35 | PASS x=>{/ threw exception SyntaxError: Unexpected token '/'. Invalid regular expression.. |
| 36 | PASS x=>{% threw exception SyntaxError: Unexpected token '%'. |
| 37 | PASS x=>{+ threw exception SyntaxError: Unexpected end of script. |
| 38 | PASS x=>{- threw exception SyntaxError: Unexpected end of script. |
| 39 | PASS x=>{<< threw exception SyntaxError: Unexpected token '<<'. |
| 40 | PASS x=>{>> threw exception SyntaxError: Unexpected token '>>'. |
| 41 | PASS x=>{>>> threw exception SyntaxError: Unexpected token '>>>'. |
| 42 | PASS x=>{< threw exception SyntaxError: Unexpected token '<'. |
| 43 | PASS x=>{> threw exception SyntaxError: Unexpected token '>'. |
| 44 | PASS x=>{<= threw exception SyntaxError: Unexpected token '<='. |
| 45 | PASS x=>{>= threw exception SyntaxError: Unexpected token '>='. |
| 46 | PASS x=>{instanceof threw exception SyntaxError: Unexpected keyword 'instanceof'. |
| 47 | PASS x=>{in threw exception SyntaxError: Unexpected keyword 'in'. |
| 48 | PASS x=>{== threw exception SyntaxError: Unexpected token '=='. |
| 49 | PASS x=>{!= threw exception SyntaxError: Unexpected token '!='. |
| 50 | PASS x=>{=== threw exception SyntaxError: Unexpected token '==='. |
| 51 | PASS x=>{!== threw exception SyntaxError: Unexpected token '!=='. |
| 52 | PASS x=>{& threw exception SyntaxError: Unexpected token '&'. |
| 53 | PASS x=>{^ threw exception SyntaxError: Unexpected token '^'. |
| 54 | PASS x=>{| threw exception SyntaxError: Unexpected token '|'. |
| 55 | PASS x=>{&& threw exception SyntaxError: Unexpected token '&&'. |
| 56 | PASS x=>{|| threw exception SyntaxError: Unexpected token '||'. |
| 57 | PASS x=>{; threw exception SyntaxError: Unexpected end of script. |
| 58 | PASS x=>{, threw exception SyntaxError: Unexpected token ','. |
| 59 | PASS x=>} threw exception SyntaxError: Unexpected token '}'. |
| 60 | PASS var y = x=> threw exception SyntaxError: Unexpected end of script. |
| 61 | PASS var y = x=>* threw exception SyntaxError: Unexpected token '*'. |
| 62 | PASS var y = x=>/ threw exception SyntaxError: Unexpected token '/'. Invalid regular expression.. |
| 63 | PASS var y = x=>% threw exception SyntaxError: Unexpected token '%'. |
| 64 | PASS var y = x=>+ threw exception SyntaxError: Unexpected end of script. |
| 65 | PASS var y = x=>- threw exception SyntaxError: Unexpected end of script. |
| 66 | PASS var y = x=><< threw exception SyntaxError: Unexpected token '<<'. |
| 67 | PASS var y = x=>>> threw exception SyntaxError: Unexpected token '>>'. |
| 68 | PASS var y = x=>>>> threw exception SyntaxError: Unexpected token '>>>'. |
| 69 | PASS var y = x=>< threw exception SyntaxError: Unexpected token '<'. |
| 70 | PASS var y = x=>> threw exception SyntaxError: Unexpected token '>'. |
| 71 | PASS var y = x=><= threw exception SyntaxError: Unexpected token '<='. |
| 72 | PASS var y = x=>>= threw exception SyntaxError: Unexpected token '>='. |
| 73 | PASS var y = x=>instanceof threw exception SyntaxError: Unexpected keyword 'instanceof'. |
| 74 | PASS var y = x=>in threw exception SyntaxError: Unexpected keyword 'in'. |
| 75 | PASS var y = x=>== threw exception SyntaxError: Unexpected token '=='. |
| 76 | PASS var y = x=>!= threw exception SyntaxError: Unexpected token '!='. |
| 77 | PASS var y = x=>=== threw exception SyntaxError: Unexpected token '==='. |
| 78 | PASS var y = x=>!== threw exception SyntaxError: Unexpected token '!=='. |
| 79 | PASS var y = x=>& threw exception SyntaxError: Unexpected token '&'. |
| 80 | PASS var y = x=>^ threw exception SyntaxError: Unexpected token '^'. |
| 81 | PASS var y = x=>| threw exception SyntaxError: Unexpected token '|'. |
| 82 | PASS var y = x=>&& threw exception SyntaxError: Unexpected token '&&'. |
| 83 | PASS var y = x=>|| threw exception SyntaxError: Unexpected token '||'. |
| 84 | PASS var y = x=>; threw exception SyntaxError: Unexpected token ';'. |
| 85 | PASS var y = x=>, threw exception SyntaxError: Unexpected token ','. |
| 86 | PASS var y = x=>{ threw exception SyntaxError: Unexpected end of script. |
| 87 | PASS var y = x=>{* threw exception SyntaxError: Unexpected token '*'. |
| 88 | PASS var y = x=>{/ threw exception SyntaxError: Unexpected token '/'. Invalid regular expression.. |
| 89 | PASS var y = x=>{% threw exception SyntaxError: Unexpected token '%'. |
| 90 | PASS var y = x=>{+ threw exception SyntaxError: Unexpected end of script. |
| 91 | PASS var y = x=>{- threw exception SyntaxError: Unexpected end of script. |
| 92 | PASS var y = x=>{<< threw exception SyntaxError: Unexpected token '<<'. |
| 93 | PASS var y = x=>{>> threw exception SyntaxError: Unexpected token '>>'. |
| 94 | PASS var y = x=>{>>> threw exception SyntaxError: Unexpected token '>>>'. |
| 95 | PASS var y = x=>{< threw exception SyntaxError: Unexpected token '<'. |
| 96 | PASS var y = x=>{> threw exception SyntaxError: Unexpected token '>'. |
| 97 | PASS var y = x=>{<= threw exception SyntaxError: Unexpected token '<='. |
| 98 | PASS var y = x=>{>= threw exception SyntaxError: Unexpected token '>='. |
| 99 | PASS var y = x=>{instanceof threw exception SyntaxError: Unexpected keyword 'instanceof'. |
| 100 | PASS var y = x=>{in threw exception SyntaxError: Unexpected keyword 'in'. |
| 101 | PASS var y = x=>{== threw exception SyntaxError: Unexpected token '=='. |
| 102 | PASS var y = x=>{!= threw exception SyntaxError: Unexpected token '!='. |
| 103 | PASS var y = x=>{=== threw exception SyntaxError: Unexpected token '==='. |
| 104 | PASS var y = x=>{!== threw exception SyntaxError: Unexpected token '!=='. |
| 105 | PASS var y = x=>{& threw exception SyntaxError: Unexpected token '&'. |
| 106 | PASS var y = x=>{^ threw exception SyntaxError: Unexpected token '^'. |
| 107 | PASS var y = x=>{| threw exception SyntaxError: Unexpected token '|'. |
| 108 | PASS var y = x=>{&& threw exception SyntaxError: Unexpected token '&&'. |
| 109 | PASS var y = x=>{|| threw exception SyntaxError: Unexpected token '||'. |
| 110 | PASS var y = x=>{; threw exception SyntaxError: Unexpected end of script. |
| 111 | PASS var y = x=>{, threw exception SyntaxError: Unexpected token ','. |
| 112 | PASS var y = x=>} threw exception SyntaxError: Unexpected token '}'. |
utatane.tea@gmail.com | 2be03b2 | 2015-08-03 21:26:07 +0000 | [diff] [blame] | 113 | PASS var t = x=>x+1; =>{} threw exception SyntaxError: Unexpected token '=>'. |
| 114 | PASS [=>x+1] threw exception SyntaxError: Unexpected token '=>'. |
| 115 | PASS [x=>x+1, =>x+1] threw exception SyntaxError: Unexpected token '=>'. |
| 116 | PASS var f=>x+1; threw exception SyntaxError: Unexpected token '=>'. Expected ';' after variable declaration.. |
| 117 | PASS var x, y=>y+1; threw exception SyntaxError: Unexpected token '=>'. Expected ';' after variable declaration.. |
| 118 | PASS debug(=>x+1) threw exception SyntaxError: Unexpected token '=>'. |
| 119 | PASS debug("xyz", =>x+1) threw exception SyntaxError: Unexpected token '=>'. |
commit-queue@webkit.org | 3c62d44 | 2015-06-28 16:18:26 +0000 | [diff] [blame] | 120 | PASS var af1=y |
utatane.tea@gmail.com | 2be03b2 | 2015-08-03 21:26:07 +0000 | [diff] [blame] | 121 | =>y+1 threw exception SyntaxError: Unexpected token '=>'. |
commit-queue@webkit.org | 3c62d44 | 2015-06-28 16:18:26 +0000 | [diff] [blame] | 122 | PASS var af2=(y) |
utatane.tea@gmail.com | 2be03b2 | 2015-08-03 21:26:07 +0000 | [diff] [blame] | 123 | =>y+1 threw exception SyntaxError: Unexpected token '=>'. |
commit-queue@webkit.org | 3c62d44 | 2015-06-28 16:18:26 +0000 | [diff] [blame] | 124 | PASS var af3=(x, y) |
utatane.tea@gmail.com | 2be03b2 | 2015-08-03 21:26:07 +0000 | [diff] [blame] | 125 | =>y+1 threw exception SyntaxError: Unexpected token '=>'. |
commit-queue@webkit.org | 9a7427f | 2016-01-17 00:04:37 +0000 | [diff] [blame] | 126 | PASS ([a, b] => a + b)(["a_", "b_"]) threw exception SyntaxError: Unexpected token '=>'. Expected ')' to end a compound expression.. |
| 127 | PASS ({a, b} => a + b)({a:"a_", b:"b_"}) threw exception SyntaxError: Unexpected token '=>'. Expected ')' to end a compound expression.. |
| 128 | PASS ({c:a,d:b} => a + b)({c:"a_", d:"b_"}) threw exception SyntaxError: Unexpected token '=>'. Expected ')' to end a compound expression.. |
| 129 | PASS ({c:b,d:a} => a + b)({c:"a_", d:"b_"}) threw exception SyntaxError: Unexpected token '=>'. Expected ')' to end a compound expression.. |
| 130 | PASS var arr1 = [a, b] => a + b; threw exception SyntaxError: Unexpected token '=>'. Expected ';' after variable declaration.. |
| 131 | PASS var arr2 = {a, b} => a + b; threw exception SyntaxError: Unexpected token '=>'. Expected ';' after variable declaration.. |
| 132 | PASS var arr3 = {c:a,d:b} => a + b; threw exception SyntaxError: Unexpected token '=>'. Expected ';' after variable declaration.. |
| 133 | PASS var arr3 = {c:b,d:a} => a + b; threw exception SyntaxError: Unexpected token '=>'. Expected ';' after variable declaration.. |
commit-queue@webkit.org | a63dc42 | 2016-02-08 19:29:24 +0000 | [diff] [blame] | 134 | PASS var arr4 = () => { super(); }; threw exception SyntaxError: Cannot call super() outside of a class constructor.. |
| 135 | PASS var arr4 = () => { super; }; threw exception SyntaxError: Cannot reference super.. |
| 136 | PASS var arr5 = () => { super.getValue(); }; threw exception SyntaxError: super can only be used in a method of a derived class.. |
| 137 | PASS var arr6 = () => super(); threw exception SyntaxError: Cannot call super() outside of a class constructor.. |
| 138 | PASS var arr7 = () => super; threw exception SyntaxError: Cannot reference super.. |
| 139 | PASS var arr8 = () => super.getValue(); threw exception SyntaxError: super can only be used in a method of a derived class.. |
| 140 | PASS class A { constructor() { function a () { return () => { super(); };}} threw exception SyntaxError: Cannot call super() outside of a class constructor.. |
| 141 | PASS class B { constructor() { function b () { return () => { super; }; }; }} threw exception SyntaxError: Cannot reference super.. |
| 142 | PASS class C { constructor() { function c () { return () => { super.getValue(); };}} threw exception SyntaxError: super can only be used in a method of a derived class.. |
| 143 | PASS class D { constructor() { function a () { return () => super(); }} threw exception SyntaxError: Cannot call super() outside of a class constructor.. |
| 144 | PASS class E { constructor() { function b () { return () => super; }; }} threw exception SyntaxError: Cannot reference super.. |
| 145 | PASS class F { constructor() { function c () { return () => super.getValue(); }} threw exception SyntaxError: super can only be used in a method of a derived class.. |
| 146 | PASS class G {}; class G2 extends G { getValue() { function c () { return () => super.getValue(); }} threw exception SyntaxError: super can only be used in a method of a derived class.. |
gskachkov@gmail.com | c85e6e6 | 2016-03-04 09:52:39 +0000 | [diff] [blame] | 147 | PASS class H {}; class H2 extends H { method() { function *gen() { let arr = () => super.getValue(); arr(); } } } threw exception SyntaxError: super can only be used in a method of a derived class.. |
commit-queue@webkit.org | 2a979b3 | 2015-06-26 06:49:20 +0000 | [diff] [blame] | 148 | PASS successfullyParsed is true |
| 149 | |
| 150 | TEST COMPLETE |
| 151 | |