Skip to content

Commit aa4237c

Browse files
authored
Merge pull request #4191 from erik-krogh/v8Syntax
Approved by esbena
2 parents 2ba84be + bb0e5d5 commit aa4237c

File tree

3 files changed

+75
-70
lines changed

3 files changed

+75
-70
lines changed

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

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -161,7 +161,8 @@ protected Expression parseExprAtom(DestructuringErrors refDestructuringErrors) {
161161
} else if (options.v8Extensions() && this.type == TokenType.modulo) {
162162
// parse V8 native
163163
this.next();
164-
Identifier name = this.parseIdent(true);
164+
Identifier buildinName = this.parseIdent(true);
165+
Identifier name = this.finishNode(new Identifier(new SourceLocation(startLoc), "%" + buildinName.getName()));
165166
this.expect(TokenType.parenL);
166167
List<Expression> args = this.parseExprList(TokenType.parenR, false, false, null);
167168
CallExpression node =

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

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -43,7 +43,7 @@ public class Main {
4343
* A version identifier that should be updated every time the extractor changes in such a way that
4444
* it may produce different tuples for the same file under the same {@link ExtractorConfig}.
4545
*/
46-
public static final String EXTRACTOR_VERSION = "2020-08-24";
46+
public static final String EXTRACTOR_VERSION = "2020-09-02";
4747

4848
public static final Pattern NEWLINE = Pattern.compile("\n");
4949

javascript/extractor/tests/v8/output/trap/tst.js.trap

Lines changed: 72 additions & 68 deletions
Original file line numberDiff line numberDiff line change
@@ -117,80 +117,84 @@ hasLocation(#20040,#20041)
117117
enclosingStmt(#20040,#20039)
118118
exprContainers(#20040,#20001)
119119
#20042=*
120-
exprs(#20042,79,#20040,-1,"CheckIsBootstrapping")
121-
hasLocation(#20042,#20009)
120+
exprs(#20042,79,#20040,-1,"%CheckI ... rapping")
121+
#20043=@"loc,{#10000},1,1,1,21"
122+
locations_default(#20043,#10000,1,1,1,21)
123+
hasLocation(#20042,#20043)
122124
enclosingStmt(#20042,#20039)
123125
exprContainers(#20042,#20001)
124-
literals("CheckIsBootstrapping","CheckIsBootstrapping",#20042)
125-
#20043=@"var;{CheckIsBootstrapping};{#20000}"
126-
variables(#20043,"CheckIsBootstrapping",#20000)
127-
bind(#20042,#20043)
128-
#20044=*
129-
stmts(#20044,2,#20001,1,"a%%NumberAdd(1, 2);")
130-
hasLocation(#20044,#20005)
131-
stmtContainers(#20044,#20001)
126+
literals("%CheckIsBootstrapping","%CheckIsBootstrapping",#20042)
127+
#20044=@"var;{%CheckIsBootstrapping};{#20000}"
128+
variables(#20044,"%CheckIsBootstrapping",#20000)
129+
bind(#20042,#20044)
132130
#20045=*
133-
exprs(#20045,38,#20044,0,"a%%NumberAdd(1, 2)")
134-
#20046=@"loc,{#10000},2,1,2,18"
135-
locations_default(#20046,#10000,2,1,2,18)
136-
hasLocation(#20045,#20046)
137-
enclosingStmt(#20045,#20044)
138-
exprContainers(#20045,#20001)
139-
#20047=*
140-
exprs(#20047,79,#20045,0,"a")
141-
hasLocation(#20047,#20017)
142-
enclosingStmt(#20047,#20044)
143-
exprContainers(#20047,#20001)
144-
literals("a","a",#20047)
145-
#20048=@"var;{a};{#20000}"
146-
variables(#20048,"a",#20000)
147-
bind(#20047,#20048)
148-
#20049=*
149-
exprs(#20049,13,#20045,1,"%NumberAdd(1, 2)")
150-
#20050=@"loc,{#10000},2,3,2,18"
151-
locations_default(#20050,#10000,2,3,2,18)
152-
hasLocation(#20049,#20050)
153-
enclosingStmt(#20049,#20044)
154-
exprContainers(#20049,#20001)
155-
#20051=*
156-
exprs(#20051,79,#20049,-1,"NumberAdd")
157-
hasLocation(#20051,#20023)
158-
enclosingStmt(#20051,#20044)
159-
exprContainers(#20051,#20001)
160-
literals("NumberAdd","NumberAdd",#20051)
161-
#20052=@"var;{NumberAdd};{#20000}"
162-
variables(#20052,"NumberAdd",#20000)
163-
bind(#20051,#20052)
164-
#20053=*
165-
exprs(#20053,3,#20049,0,"1")
166-
hasLocation(#20053,#20027)
167-
enclosingStmt(#20053,#20044)
168-
exprContainers(#20053,#20001)
169-
literals("1","1",#20053)
170-
#20054=*
171-
exprs(#20054,3,#20049,1,"2")
172-
hasLocation(#20054,#20031)
173-
enclosingStmt(#20054,#20044)
174-
exprContainers(#20054,#20001)
175-
literals("2","2",#20054)
131+
stmts(#20045,2,#20001,1,"a%%NumberAdd(1, 2);")
132+
hasLocation(#20045,#20005)
133+
stmtContainers(#20045,#20001)
134+
#20046=*
135+
exprs(#20046,38,#20045,0,"a%%NumberAdd(1, 2)")
136+
#20047=@"loc,{#10000},2,1,2,18"
137+
locations_default(#20047,#10000,2,1,2,18)
138+
hasLocation(#20046,#20047)
139+
enclosingStmt(#20046,#20045)
140+
exprContainers(#20046,#20001)
141+
#20048=*
142+
exprs(#20048,79,#20046,0,"a")
143+
hasLocation(#20048,#20017)
144+
enclosingStmt(#20048,#20045)
145+
exprContainers(#20048,#20001)
146+
literals("a","a",#20048)
147+
#20049=@"var;{a};{#20000}"
148+
variables(#20049,"a",#20000)
149+
bind(#20048,#20049)
150+
#20050=*
151+
exprs(#20050,13,#20046,1,"%NumberAdd(1, 2)")
152+
#20051=@"loc,{#10000},2,3,2,18"
153+
locations_default(#20051,#10000,2,3,2,18)
154+
hasLocation(#20050,#20051)
155+
enclosingStmt(#20050,#20045)
156+
exprContainers(#20050,#20001)
157+
#20052=*
158+
exprs(#20052,79,#20050,-1,"%NumberAdd")
159+
#20053=@"loc,{#10000},2,3,2,12"
160+
locations_default(#20053,#10000,2,3,2,12)
161+
hasLocation(#20052,#20053)
162+
enclosingStmt(#20052,#20045)
163+
exprContainers(#20052,#20001)
164+
literals("%NumberAdd","%NumberAdd",#20052)
165+
#20054=@"var;{%NumberAdd};{#20000}"
166+
variables(#20054,"%NumberAdd",#20000)
167+
bind(#20052,#20054)
176168
#20055=*
177-
entry_cfg_node(#20055,#20001)
178-
#20056=@"loc,{#10000},1,1,1,0"
179-
locations_default(#20056,#10000,1,1,1,0)
180-
hasLocation(#20055,#20056)
169+
exprs(#20055,3,#20050,0,"1")
170+
hasLocation(#20055,#20027)
171+
enclosingStmt(#20055,#20045)
172+
exprContainers(#20055,#20001)
173+
literals("1","1",#20055)
174+
#20056=*
175+
exprs(#20056,3,#20050,1,"2")
176+
hasLocation(#20056,#20031)
177+
enclosingStmt(#20056,#20045)
178+
exprContainers(#20056,#20001)
179+
literals("2","2",#20056)
181180
#20057=*
182-
exit_cfg_node(#20057,#20001)
183-
hasLocation(#20057,#20037)
184-
successor(#20044,#20047)
185-
successor(#20054,#20049)
186-
successor(#20053,#20054)
187-
successor(#20051,#20053)
188-
successor(#20049,#20045)
189-
successor(#20047,#20051)
190-
successor(#20045,#20057)
181+
entry_cfg_node(#20057,#20001)
182+
#20058=@"loc,{#10000},1,1,1,0"
183+
locations_default(#20058,#10000,1,1,1,0)
184+
hasLocation(#20057,#20058)
185+
#20059=*
186+
exit_cfg_node(#20059,#20001)
187+
hasLocation(#20059,#20037)
188+
successor(#20045,#20048)
189+
successor(#20056,#20050)
190+
successor(#20055,#20056)
191+
successor(#20052,#20055)
192+
successor(#20050,#20046)
193+
successor(#20048,#20052)
194+
successor(#20046,#20059)
191195
successor(#20039,#20042)
192196
successor(#20042,#20040)
193-
successor(#20040,#20044)
194-
successor(#20055,#20039)
197+
successor(#20040,#20045)
198+
successor(#20057,#20039)
195199
numlines(#10000,2,2,0)
196200
filetype(#10000,"javascript")

0 commit comments

Comments
 (0)