Skip to content

Commit bf38400

Browse files
committed
JS: Treat defaultImportInteropStep as a common step
Default import interop is now used by default, and then modules are only allowed to use it in restricted cases. Previously, only modules could use it (in restricted cases).
1 parent c19ca78 commit bf38400

File tree

1 file changed

+7
-1
lines changed

1 file changed

+7
-1
lines changed

javascript/ql/lib/semmle/javascript/internal/NameResolution.qll

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -203,6 +203,8 @@ module NameResolution {
203203
node1 = fun.getArgument(i) and
204204
node2 = fun.getParameter(i)
205205
)
206+
or
207+
defaultImportInteropStep(node1, node2)
206208
}
207209

208210
pragma[inline]
@@ -533,7 +535,11 @@ module NameResolution {
533535
Node trackModule(ModuleLike mod) {
534536
result = mod
535537
or
536-
ValueFlow::step(trackModule(mod), result)
538+
exists(Node prev |
539+
prev = trackModule(mod) and
540+
ValueFlow::step(prev, result) and
541+
not defaultImportInteropStep(prev, result)
542+
)
537543
or
538544
defaultImportInteropStep(trackModule(mod), result) and
539545
not mod.(ES2015Module).hasBothNamedAndDefaultExports()

0 commit comments

Comments
 (0)