File tree Expand file tree Collapse file tree 2 files changed +19
-17
lines changed
lib/semmle/javascript/dataflow
test/library-tests/CallGraphs/AnnotatedTest Expand file tree Collapse file tree 2 files changed +19
-17
lines changed Original file line number Diff line number Diff line change @@ -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 ( ExtendCall call |
1428
+ call .getDestinationOperand ( ) = this .getAPrototypeReference ( ) and
1429
+ result = call .getASourceOperand ( )
1430
+ )
1431
+ or
1432
+ exists ( DataFlow:: PropRead protoRead |
1433
+ protoRead .getPropertyName ( ) = "prototype" and
1434
+ protoRead .getBase ( ) .analyze ( ) .getAValue ( ) = this .analyze ( ) .getAValue ( ) and
1435
+ result = protoRead
1432
1436
)
1433
1437
}
1434
1438
Original file line number Diff line number Diff line change @@ -2,8 +2,6 @@ spuriousCallee
2
2
missingCallee
3
3
| constructor-field.ts:40:5:40:14 | f3.build() | constructor-field.ts:13:3:13:12 | build() {} | -1 | calls |
4
4
| constructor-field.ts:71:1:71:11 | bf3.build() | constructor-field.ts:13:3:13:12 | build() {} | -1 | calls |
5
- | prototypes.js:96:5:96:15 | this.read() | prototypes.js:104:27:104:39 | function() {} | -1 | calls |
6
- | prototypes.js:96:5:96:15 | this.read() | prototypes.js:109:27:109:39 | function() {} | -1 | calls |
7
5
badAnnotation
8
6
accessorCall
9
7
| accessors.js:12:1:12:5 | obj.f | accessors.js:5:8:5:12 | () {} |
You can’t perform that action at this time.
0 commit comments