Skip to content

Commit 38194c6

Browse files
committed
JS: Extract import assertions to DB
1 parent f454151 commit 38194c6

File tree

9 files changed

+1025
-601
lines changed

9 files changed

+1025
-601
lines changed

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

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1759,6 +1759,7 @@ public Label visit(MetaProperty nd, Context c) {
17591759
public Label visit(ExportAllDeclaration nd, Context c) {
17601760
Label lbl = super.visit(nd, c);
17611761
visit(nd.getSource(), lbl, 0);
1762+
visit(nd.getAssertion(), lbl, -10);
17621763
return lbl;
17631764
}
17641765

@@ -1774,6 +1775,7 @@ public Label visit(ExportNamedDeclaration nd, Context c) {
17741775
Label lbl = super.visit(nd, c);
17751776
visit(nd.getDeclaration(), lbl, -1);
17761777
visit(nd.getSource(), lbl, -2);
1778+
visit(nd.getAssertion(), lbl, -10);
17771779
IdContext childContext =
17781780
nd.hasSource()
17791781
? IdContext.LABEL
@@ -1797,6 +1799,7 @@ public Label visit(ExportSpecifier nd, Context c) {
17971799
public Label visit(ImportDeclaration nd, Context c) {
17981800
Label lbl = super.visit(nd, c);
17991801
visit(nd.getSource(), lbl, -1);
1802+
visit(nd.getAssertion(), lbl, -10);
18001803
IdContext childContext =
18011804
nd.hasTypeKeyword()
18021805
? IdContext.TYPE_ONLY_IMPORT
@@ -1972,6 +1975,7 @@ public Label visit(ExternalModuleReference nd, Context c) {
19721975
public Label visit(DynamicImport nd, Context c) {
19731976
Label key = super.visit(nd, c);
19741977
visit(nd.getSource(), key, 0);
1978+
visit(nd.getAttributes(), key, 1);
19751979
return key;
19761980
}
19771981

0 commit comments

Comments
 (0)