Skip to content

Commit e3e24f9

Browse files
committed
JS: Use separate ScopeManager for template exprs
1 parent b36e9e0 commit e3e24f9

File tree

1 file changed

+3
-4
lines changed

1 file changed

+3
-4
lines changed

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

Lines changed: 3 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -9,6 +9,7 @@
99
import java.util.regex.Pattern;
1010

1111
import com.semmle.extractor.html.HtmlPopulator;
12+
import com.semmle.js.extractor.ExtractorConfig.ECMAVersion;
1213
import com.semmle.js.extractor.ExtractorConfig.Platform;
1314
import com.semmle.js.extractor.ExtractorConfig.SourceType;
1415
import com.semmle.js.parser.ParseError;
@@ -96,7 +97,6 @@ public void handleElement(Element elt, HtmlPopulator.Context context) {
9697

9798
extractTemplateTags(
9899
textualExtractor,
99-
scopeManager,
100100
attr.getSource(),
101101
attr.getBegin(),
102102
attr.getEnd(),
@@ -154,7 +154,7 @@ public void handleElement(Element elt, HtmlPopulator.Context context) {
154154
public void handleText(
155155
Source src, int textBegin, int textEnd, Label parentLabel, boolean isCData) {
156156
extractTemplateTags(
157-
textualExtractor, scopeManager, src, textBegin, textEnd, () -> parentLabel);
157+
textualExtractor, src, textBegin, textEnd, () -> parentLabel);
158158
}
159159

160160
@Override
@@ -384,7 +384,6 @@ private void emitTopLevelXmlNodeBinding(
384384

385385
private void extractTemplateTags(
386386
TextualExtractor textualExtractor,
387-
ScopeManager scopeManager,
388387
Source root,
389388
int start,
390389
int end,
@@ -421,7 +420,7 @@ private void extractTemplateTags(
421420
extractSnippet(
422421
TopLevelKind.ANGULAR_STYLE_TEMPLATE,
423422
config.withSourceType(SourceType.ANGULAR_STYLE_TEMPLATE),
424-
scopeManager,
423+
new ScopeManager(textualExtractor.getTrapwriter(), ECMAVersion.ECMA2020, true),
425424
textualExtractor,
426425
m.group(bodyGroup),
427426
m.start(bodyGroup),

0 commit comments

Comments
 (0)