Thanks to visit codestin.com
Credit goes to github.com

Skip to content

Commit bb2b7fb

Browse files
committed
JS: Add test with class stored in global variable
1 parent c580ada commit bb2b7fb

3 files changed

Lines changed: 26 additions & 0 deletions

File tree

javascript/ql/test/library-tests/DOM/Customizations.expected

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -4,3 +4,9 @@ test_locationRef
44
| customization.js:3:3:3:14 | doc.location |
55
test_domValueRef
66
| customization.js:4:3:4:28 | doc.get ... 'test') |
7+
| tst.js:45:8:45:7 | this |
8+
| tst.js:46:7:46:12 | this.x |
9+
| tst.js:49:3:49:8 | window |
10+
| tst.js:50:3:50:8 | window |
11+
| tst.js:50:3:50:14 | window.myApp |
12+
| tst.js:50:3:50:18 | window.myApp.foo |
Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,10 @@
1+
/** @externs */
2+
3+
/**
4+
* @constructor
5+
* @name EventTarget
6+
*/
7+
function EventTarget() {}
8+
9+
/** @type {EventTarget} */
10+
var window;

javascript/ql/test/library-tests/DOM/tst.js

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -39,3 +39,13 @@
3939
factory2();
4040

4141
})();
42+
43+
(function pollute() {
44+
class C {
45+
foo() {
46+
this.x; // Should not be a domValueRef
47+
}
48+
}
49+
window.myApp = new C();
50+
window.myApp.foo();
51+
})();

0 commit comments

Comments
 (0)