Skip to content

Commit 16e2ac8

Browse files
committed
JS: Parser: Remove direct this.strict assignment
1 parent 1985dd6 commit 16e2ac8

File tree

2 files changed

+1
-25
lines changed

2 files changed

+1
-25
lines changed

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

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3108,7 +3108,7 @@ protected BlockStatement parseBlock(boolean allowStrict) {
31083108
if (stmt != null) body.add(stmt);
31093109
if (first && allowStrict && this.isUseStrict(stmt)) {
31103110
oldStrict = this.strict;
3111-
this.setStrict(this.strict = true);
3111+
this.setStrict(true);
31123112
}
31133113
first = false;
31143114
}

javascript/extractor/tests/strictmode/output/trap/assignargs.js.trap

Lines changed: 0 additions & 24 deletions
Original file line numberDiff line numberDiff line change
@@ -196,29 +196,5 @@ successor(#20045,#20048)
196196
successor(#20057,#20041)
197197
successor(#20038,#20037)
198198
successor(#20054,#20038)
199-
#20059=*
200-
js_parse_errors(#20059,#20001,"Error: Assigning to arguments in strict mode"," arguments = 42;
201-
")
202-
#20060=@"loc,{#10000},3,3,3,3"
203-
locations_default(#20060,#10000,3,3,3,3)
204-
hasLocation(#20059,#20060)
205-
#20061=*
206-
lines(#20061,#20001,"function f() {","
207-
")
208-
hasLocation(#20061,#20003)
209-
#20062=*
210-
lines(#20062,#20001," 'use strict';","
211-
")
212-
hasLocation(#20062,#20005)
213-
indentation(#10000,2," ",2)
214-
#20063=*
215-
lines(#20063,#20001," arguments = 42;","
216-
")
217-
hasLocation(#20063,#20007)
218-
indentation(#10000,3," ",2)
219-
#20064=*
220-
lines(#20064,#20001,"}","")
221-
hasLocation(#20064,#20009)
222-
numlines(#20001,4,0,0)
223199
numlines(#10000,4,4,0)
224200
filetype(#10000,"javascript")

0 commit comments

Comments
 (0)