Skip to content

Commit 319210a

Browse files
committed
Fixup ClassValidator
1 parent a8a28a5 commit 319210a

File tree

1 file changed

+5
-1
lines changed

1 file changed

+5
-1
lines changed

javascript/ql/lib/semmle/javascript/frameworks/ClassValidator.qll

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,7 @@
33
*/
44

55
import javascript
6+
private import semmle.javascript.internal.NameResolution
67
private import semmle.javascript.internal.TypeResolution
78
private import semmle.javascript.internal.UnderlyingTypes
89

@@ -52,7 +53,10 @@ module ClassValidator {
5253

5354
pragma[noinline]
5455
private ClassDefinition getClassReferencedByPropRead(DataFlow::PropRead read) {
55-
UnderlyingTypes::nodeHasUnderlyingClassType(read.getBase().asExpr(), result.flow())
56+
exists(NameResolution::Node type |
57+
TypeResolution::valueHasType(read.getBase().asExpr(), type) and
58+
UnderlyingTypes::nodeHasUnderlyingClassType(type, result.flow())
59+
)
5660
}
5761

5862
/**

0 commit comments

Comments
 (0)