Skip to content

Commit 9825136

Browse files
author
Stephan Brandauer
committed
add support for the 'node:' prefix for importing internal modules
1 parent 82ad79f commit 9825136

File tree

1 file changed

+4
-1
lines changed
  • javascript/ql/lib/semmle/javascript/dataflow

1 file changed

+4
-1
lines changed

javascript/ql/lib/semmle/javascript/dataflow/Nodes.qll

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -741,7 +741,10 @@ module ModuleImportNode {
741741
* This predicate can be extended by subclassing `ModuleImportNode::Range`.
742742
*/
743743
cached
744-
ModuleImportNode moduleImport(string path) { Stages::Imports::ref() and result.getPath() = path }
744+
ModuleImportNode moduleImport(string path) {
745+
// NB. internal modules may be imported with a "node:" prefix
746+
Stages::Imports::ref() and result.getPath() = ["node:" + path, path]
747+
}
745748

746749
/**
747750
* Gets a (default) import of the given dependency `dep`, such as

0 commit comments

Comments
 (0)