@@ -1233,7 +1233,7 @@ module ClassNode {
1233
1233
private DataFlow:: SourceNode getAFunctionValueWithPrototype ( AbstractValue func ) {
1234
1234
exists ( result .getAPropertyReference ( "prototype" ) ) and
1235
1235
result .analyze ( ) .getAValue ( ) = pragma [ only_bind_into ] ( func ) and
1236
- func instanceof AbstractFunction // the join-order goes bad if `func` has type `AbstractFunction`.
1236
+ func instanceof AbstractCallable // the join-order goes bad if `func` has type `AbstractFunction`.
1237
1237
}
1238
1238
1239
1239
/**
@@ -1413,22 +1413,26 @@ module ClassNode {
1413
1413
* Only applies to function-style classes.
1414
1414
*/
1415
1415
DataFlow:: SourceNode getAPrototypeReference ( ) {
1416
- (
1417
- exists ( DataFlow:: SourceNode base | base = getAFunctionValueWithPrototype ( function ) |
1418
- result = base .getAPropertyRead ( "prototype" )
1419
- or
1420
- result = base .getAPropertySource ( "prototype" )
1421
- )
1416
+ exists ( DataFlow:: SourceNode base | base = getAFunctionValueWithPrototype ( function ) |
1417
+ result = base .getAPropertyRead ( "prototype" )
1422
1418
or
1423
- exists ( string name |
1424
- this = AccessPath:: getAnAssignmentTo ( name ) and
1425
- result = getAPrototypeReferenceInFile ( name , this .getFile ( ) )
1426
- )
1427
- or
1428
- exists ( ExtendCall call |
1429
- call .getDestinationOperand ( ) = this .getAPrototypeReference ( ) and
1430
- result = call .getASourceOperand ( )
1431
- )
1419
+ result = base .getAPropertySource ( "prototype" )
1420
+ )
1421
+ or
1422
+ exists ( string name |
1423
+ this = AccessPath:: getAnAssignmentTo ( name ) and
1424
+ result = getAPrototypeReferenceInFile ( name , this .getFile ( ) )
1425
+ )
1426
+ or
1427
+ exists ( string name , DataFlow:: SourceNode root |
1428
+ result =
1429
+ AccessPath:: getAReferenceOrAssignmentTo ( root , name + ".prototype" ) .getALocalSource ( ) and
1430
+ this = AccessPath:: getAnAssignmentTo ( root , name )
1431
+ )
1432
+ or
1433
+ exists ( ExtendCall call |
1434
+ call .getDestinationOperand ( ) = this .getAPrototypeReference ( ) and
1435
+ result = call .getASourceOperand ( )
1432
1436
)
1433
1437
}
1434
1438
0 commit comments