Skip to content

Commit 8e485b7

Browse files
authored
Merge pull request #996 from xiemaisi/js/first-array-elt-in
Approved by esben-semmle
2 parents f7d7b8e + 6ecdb0e commit 8e485b7

File tree

4 files changed

+106
-2
lines changed

4 files changed

+106
-2
lines changed

javascript/extractor/src/com/semmle/jcorn/CustomParser.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -147,7 +147,7 @@ protected Expression parseExprAtom(DestructuringErrors refDestructuringErrors) {
147147
this.type == TokenType.ellipsis) {
148148
elements = this.parseExprList(TokenType.bracketR, true, true, refDestructuringErrors);
149149
} else {
150-
Expression firstExpr = this.parseMaybeAssign(true, refDestructuringErrors, null);
150+
Expression firstExpr = this.parseMaybeAssign(false, refDestructuringErrors, null);
151151
// check whether this is a postfix array comprehension
152152
if (this.type == TokenType._for || this.type == TokenType._if) {
153153
ComprehensionExpression c = this.parseComprehension(startLoc, false, firstExpr);

javascript/extractor/src/com/semmle/js/extractor/Main.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -41,7 +41,7 @@ public class Main {
4141
* such a way that it may produce different tuples for the same file under the same
4242
* {@link ExtractorConfig}.
4343
*/
44-
public static final String EXTRACTOR_VERSION = "2019-02-04";
44+
public static final String EXTRACTOR_VERSION = "2019-02-27";
4545

4646
public static final Pattern NEWLINE = Pattern.compile("\n");
4747

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
[ x in y ]
Lines changed: 103 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,103 @@
1+
#10000=@"/regress.js;sourcefile"
2+
files(#10000,"/regress.js","regress","js",0)
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+
#20002=*
13+
lines(#20002,#20001,"[ x in y ]","
14+
")
15+
#20003=@"loc,{#10000},1,1,1,10"
16+
locations_default(#20003,#10000,1,1,1,10)
17+
hasLocation(#20002,#20003)
18+
numlines(#20001,1,1,0)
19+
#20004=*
20+
tokeninfo(#20004,8,#20001,0,"[")
21+
#20005=@"loc,{#10000},1,1,1,1"
22+
locations_default(#20005,#10000,1,1,1,1)
23+
hasLocation(#20004,#20005)
24+
#20006=*
25+
tokeninfo(#20006,6,#20001,1,"x")
26+
#20007=@"loc,{#10000},1,3,1,3"
27+
locations_default(#20007,#10000,1,3,1,3)
28+
hasLocation(#20006,#20007)
29+
#20008=*
30+
tokeninfo(#20008,7,#20001,2,"in")
31+
#20009=@"loc,{#10000},1,5,1,6"
32+
locations_default(#20009,#10000,1,5,1,6)
33+
hasLocation(#20008,#20009)
34+
#20010=*
35+
tokeninfo(#20010,6,#20001,3,"y")
36+
#20011=@"loc,{#10000},1,8,1,8"
37+
locations_default(#20011,#10000,1,8,1,8)
38+
hasLocation(#20010,#20011)
39+
#20012=*
40+
tokeninfo(#20012,8,#20001,4,"]")
41+
#20013=@"loc,{#10000},1,10,1,10"
42+
locations_default(#20013,#10000,1,10,1,10)
43+
hasLocation(#20012,#20013)
44+
#20014=*
45+
tokeninfo(#20014,0,#20001,5,"")
46+
#20015=@"loc,{#10000},2,1,2,0"
47+
locations_default(#20015,#10000,2,1,2,0)
48+
hasLocation(#20014,#20015)
49+
toplevels(#20001,0)
50+
#20016=@"loc,{#10000},1,1,2,0"
51+
locations_default(#20016,#10000,1,1,2,0)
52+
hasLocation(#20001,#20016)
53+
#20017=*
54+
stmts(#20017,2,#20001,0,"[ x in y ]")
55+
hasLocation(#20017,#20003)
56+
stmtContainers(#20017,#20001)
57+
#20018=*
58+
exprs(#20018,7,#20017,0,"[ x in y ]")
59+
hasLocation(#20018,#20003)
60+
enclosingStmt(#20018,#20017)
61+
exprContainers(#20018,#20001)
62+
#20019=*
63+
exprs(#20019,42,#20018,0,"x in y")
64+
#20020=@"loc,{#10000},1,3,1,8"
65+
locations_default(#20020,#10000,1,3,1,8)
66+
hasLocation(#20019,#20020)
67+
enclosingStmt(#20019,#20017)
68+
exprContainers(#20019,#20001)
69+
#20021=*
70+
exprs(#20021,79,#20019,0,"x")
71+
hasLocation(#20021,#20007)
72+
enclosingStmt(#20021,#20017)
73+
exprContainers(#20021,#20001)
74+
literals("x","x",#20021)
75+
#20022=@"var;{x};{#20000}"
76+
variables(#20022,"x",#20000)
77+
bind(#20021,#20022)
78+
#20023=*
79+
exprs(#20023,79,#20019,1,"y")
80+
hasLocation(#20023,#20011)
81+
enclosingStmt(#20023,#20017)
82+
exprContainers(#20023,#20001)
83+
literals("y","y",#20023)
84+
#20024=@"var;{y};{#20000}"
85+
variables(#20024,"y",#20000)
86+
bind(#20023,#20024)
87+
arraySize(#20018,1)
88+
#20025=*
89+
entry_cfg_node(#20025,#20001)
90+
#20026=@"loc,{#10000},1,1,1,0"
91+
locations_default(#20026,#10000,1,1,1,0)
92+
hasLocation(#20025,#20026)
93+
#20027=*
94+
exit_cfg_node(#20027,#20001)
95+
hasLocation(#20027,#20015)
96+
successor(#20017,#20018)
97+
successor(#20018,#20021)
98+
successor(#20023,#20019)
99+
successor(#20021,#20023)
100+
successor(#20019,#20027)
101+
successor(#20025,#20017)
102+
numlines(#10000,1,1,0)
103+
filetype(#10000,"javascript")

0 commit comments

Comments
 (0)