Skip to content

Commit eb8046d

Browse files
committed
JS: Add trap test showing parse error
1 parent f28cf25 commit eb8046d

File tree

2 files changed

+52
-0
lines changed

2 files changed

+52
-0
lines changed
Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,4 @@
1+
var { get, set } = x;
2+
var { get = 1 } = x;
3+
var { set = 1 } = x;
4+
var { get = 1, set = 1 } = x;
Lines changed: 48 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,48 @@
1+
#10000=@"/patterns.js;sourcefile"
2+
files(#10000,"/patterns.js")
3+
#10001=@"/;folder"
4+
folders(#10001,"/")
5+
containerparent(#10001,#10000)
6+
#10002=@"loc,{#10000},0,0,0,0"
7+
locations_default(#10002,#10000,0,0,0,0)
8+
hasLocation(#10000,#10002)
9+
#20000=@"global_scope"
10+
scopes(#20000,0)
11+
#20001=@"script;{#10000},1,1"
12+
toplevels(#20001,0)
13+
#20002=@"loc,{#10000},1,1,1,1"
14+
locations_default(#20002,#10000,1,1,1,1)
15+
hasLocation(#20001,#20002)
16+
#20003=*
17+
js_parse_errors(#20003,#20001,"Error: Unexpected token","var { get = 1 } = x;
18+
")
19+
#20004=@"loc,{#10000},2,11,2,11"
20+
locations_default(#20004,#10000,2,11,2,11)
21+
hasLocation(#20003,#20004)
22+
#20005=*
23+
lines(#20005,#20001,"var { get, set } = x;","
24+
")
25+
#20006=@"loc,{#10000},1,1,1,21"
26+
locations_default(#20006,#10000,1,1,1,21)
27+
hasLocation(#20005,#20006)
28+
#20007=*
29+
lines(#20007,#20001,"var { get = 1 } = x;","
30+
")
31+
#20008=@"loc,{#10000},2,1,2,20"
32+
locations_default(#20008,#10000,2,1,2,20)
33+
hasLocation(#20007,#20008)
34+
#20009=*
35+
lines(#20009,#20001,"var { set = 1 } = x;","
36+
")
37+
#20010=@"loc,{#10000},3,1,3,20"
38+
locations_default(#20010,#10000,3,1,3,20)
39+
hasLocation(#20009,#20010)
40+
#20011=*
41+
lines(#20011,#20001,"var { get = 1, set = 1 } = x;","
42+
")
43+
#20012=@"loc,{#10000},4,1,4,29"
44+
locations_default(#20012,#10000,4,1,4,29)
45+
hasLocation(#20011,#20012)
46+
numlines(#20001,4,0,0)
47+
numlines(#10000,4,0,0)
48+
filetype(#10000,"javascript")

0 commit comments

Comments
 (0)