-
Notifications
You must be signed in to change notification settings - Fork 1.6k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #15883 from RasmusWL/js-cg-tests
JS: show test changes after #15823
- Loading branch information
Showing
3 changed files
with
49 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
|
27 changes: 27 additions & 0 deletions
27
javascript/ql/test/library-tests/TypeTracking/implicit-receiver.js
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,27 @@ | ||
import 'dummy'; | ||
|
||
let trackedProp = "implicit-receiver-prop"; // name: implicit-receiver-prop | ||
|
||
function factory() { | ||
let obj = unknown(); // name: implicit-receiver-obj | ||
obj.foo = function() { | ||
track(this); // track: implicit-receiver-obj | ||
track(this.x); // track: implicit-receiver-obj track: implicit-receiver-prop | ||
} | ||
return obj; | ||
} | ||
let obj = factory(); | ||
obj.x = trackedProp; | ||
|
||
|
||
function factory2() { | ||
let obj2 = { // name: implicit-receiver-obj2 | ||
foo: function() { | ||
track(this); // track: implicit-receiver-obj2 | ||
track(this.x); // track: implicit-receiver-obj2 track: implicit-receiver-prop | ||
} | ||
} | ||
return obj2; | ||
} | ||
let obj2 = factory2() | ||
obj2.x = trackedProp; |