Skip to content

Commit 69563a7

Browse files
committed
JS: Remove restriction around effectively-constant variables
1 parent 3146007 commit 69563a7

File tree

1 file changed

+1
-10
lines changed

1 file changed

+1
-10
lines changed

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

Lines changed: 1 addition & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -378,19 +378,10 @@ module NameResolution {
378378
predicate isRelevantVariable(LexicalName var);
379379
}
380380

381-
/**
382-
* A local variable with exactly one definition, not counting implicit initialization.
383-
*/
384-
private class EffectivelyConstantVariable extends LocalVariableLike {
385-
EffectivelyConstantVariable() {
386-
count(SsaExplicitDefinition ssa | ssa.getSourceVariable() = this) <= 1 // count may be zero if ambient
387-
}
388-
}
389-
390381
/** Configuration for propagating values and namespaces */
391382
private module ValueConfig implements TypeResolutionInputSig {
392383
predicate isRelevantVariable(LexicalName var) {
393-
var instanceof EffectivelyConstantVariable
384+
var instanceof LocalVariableLike
394385
or
395386
// We merge the namespace and value declaration spaces as it seems there is
396387
// no need to distinguish them in practice.

0 commit comments

Comments
 (0)