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