diff --git a/javascript/ql/test/library-tests/CallGraphs/getACallee.expected b/javascript/ql/test/library-tests/CallGraphs/getACallee.expected deleted file mode 100644 index fb321f9dbc55..000000000000 --- a/javascript/ql/test/library-tests/CallGraphs/getACallee.expected +++ /dev/null @@ -1,48 +0,0 @@ -| a.js:2:1:2:5 | foo() | b.js:1:16:1:27 | function(){} | -| a.js:3:1:3:5 | bar() | b.js:2:8:2:24 | function bar() {} | -| a.js:4:1:4:5 | qux() | c.js:2:8:2:24 | function bar() {} | -| classes.js:8:7:8:18 | this.hello() | classes.js:3:10:5:5 | () {\\n ... ;\\n } | -| classes.js:12:21:12:20 | super(...args) | classes.js:2:11:2:10 | () {} | -| classes.js:18:3:18:9 | new B() | classes.js:12:21:12:20 | (...arg ... rgs); } | -| classes.js:18:3:18:17 | new B().hello() | classes.js:13:10:15:5 | () {\\n ... ;\\n } | -| es2015.js:6:1:6:18 | new ExampleClass() | es2015.js:2:14:4:3 | () {\\n ... ");\\n } | -| es2015.js:10:5:10:22 | arguments.callee() | es2015.js:8:2:12:1 | functio ... \\n };\\n} | -| es2015.js:16:5:16:11 | super() | es2015.js:2:14:4:3 | () {\\n ... ");\\n } | -| es2015.js:26:5:26:11 | super() | es2015.js:20:1:22:1 | functio ... = 42;\\n} | -| es2015.js:34:1:34:17 | sum(...[1, 2, 3]) | es2015.js:31:1:33:1 | functio ... +y+z;\\n} | -| es2015.js:35:1:35:17 | sum(1, ...[2, 3]) | es2015.js:31:1:33:1 | functio ... +y+z;\\n} | -| es2015.js:36:1:36:17 | sum(1, ...[2], 3) | es2015.js:31:1:33:1 | functio ... +y+z;\\n} | -| m.js:2:1:2:11 | exports.f() | m.js:1:13:1:25 | function() {} | -| m.js:3:1:3:18 | module.exports.f() | m.js:1:13:1:25 | function() {} | -| n.js:2:1:2:5 | m.f() | m.js:1:13:1:25 | function() {} | -| n.js:5:1:5:6 | m2.f() | m2.js:2:6:2:18 | function() {} | -| reflection.js:7:1:7:22 | reflective call | reflection.js:1:1:3:1 | functio ... x+y;\\n} | -| reflection.js:8:1:8:25 | add.app ... 3, 19]) | reflection.js:5:15:5:39 | functio ... n 56; } | -| reflection.js:8:1:8:25 | reflective call | reflection.js:1:1:3:1 | functio ... x+y;\\n} | -| tst.js:6:1:6:3 | f() | tst.js:1:1:1:15 | function f() {} | -| tst.js:7:1:7:3 | g() | tst.js:2:9:2:21 | function() {} | -| tst.js:8:1:8:3 | h() | tst.js:3:5:3:17 | function() {} | -| tst.js:9:1:9:3 | k() | tst.js:2:9:2:21 | function() {} | -| tst.js:15:2:15:4 | l() | tst.js:11:1:20:1 | functio ... \\tf();\\n} | -| tst.js:16:2:16:19 | arguments.callee() | tst.js:11:1:20:1 | functio ... \\tf();\\n} | -| tst.js:17:2:17:4 | n() | tst.js:12:15:12:27 | function() {} | -| tst.js:18:2:18:4 | p() | tst.js:13:2:13:16 | function p() {} | -| tst.js:19:2:19:4 | f() | tst.js:1:1:1:15 | function f() {} | -| tst.js:22:1:22:4 | l(k) | tst.js:11:1:20:1 | functio ... \\tf();\\n} | -| tst.js:24:1:24:7 | new f() | tst.js:1:1:1:15 | function f() {} | -| tst.js:25:1:25:5 | new g | tst.js:2:9:2:21 | function() {} | -| tst.js:27:1:27:16 | (function(){})() | tst.js:27:2:27:13 | function(){} | -| tst.js:28:2:28:15 | function(){}() | tst.js:28:2:28:13 | function(){} | -| tst.js:33:4:33:11 | this.g() | tst.js:35:6:35:18 | function() {} | -| tst.js:41:1:41:5 | o.f() | tst.js:32:6:34:3 | functio ... ();\\n\\t\\t} | -| tst.js:42:1:42:34 | (functi ... o)).f() | tst.js:32:6:34:3 | functio ... ();\\n\\t\\t} | -| tst.js:42:2:42:29 | functio ... x; }(o) | tst.js:42:2:42:26 | functio ... rn x; } | -| tst.js:46:2:46:9 | this.g() | tst.js:48:17:48:29 | function() {} | -| tst.js:46:2:46:9 | this.g() | tst.js:61:17:61:29 | function() {} | -| tst.js:53:3:53:10 | this.g() | tst.js:56:39:56:51 | function() {} | -| tst.js:53:3:53:10 | this.g() | tst.js:57:39:57:51 | function() {} | -| tst.js:60:15:60:21 | new A() | tst.js:44:1:44:15 | function A() {} | -| tst.js:64:13:64:19 | new B() | tst.js:50:1:50:15 | function B() {} | -| tst.js:66:5:66:9 | b.f() | tst.js:65:11:65:23 | function() {} | -| tst.js:69:1:69:10 | globalfn() | tst3.js:1:1:1:22 | functio ... fn() {} | -| tst.js:70:1:70:11 | globalfn2() | tst3.js:2:1:2:23 | functio ... n2() {} | diff --git a/javascript/ql/test/library-tests/CallGraphs/getACallee.ql b/javascript/ql/test/library-tests/CallGraphs/getACallee.ql deleted file mode 100644 index 1ba7f75a2baf..000000000000 --- a/javascript/ql/test/library-tests/CallGraphs/getACallee.ql +++ /dev/null @@ -1,4 +0,0 @@ -import javascript - -from DataFlow::InvokeNode c -select c, c.getACallee() diff --git a/javascript/ql/test/library-tests/CallGraphs/getACallee.qll b/javascript/ql/test/library-tests/CallGraphs/getACallee.qll new file mode 100644 index 000000000000..dbf643181b5c --- /dev/null +++ b/javascript/ql/test/library-tests/CallGraphs/getACallee.qll @@ -0,0 +1,3 @@ +import javascript + +query predicate test_getACallee(DataFlow::InvokeNode c, Function res) { res = c.getACallee() } diff --git a/javascript/ql/test/library-tests/CallGraphs/getAFunctionValue.expected b/javascript/ql/test/library-tests/CallGraphs/getAFunctionValue.expected deleted file mode 100644 index c1ba5f1ce622..000000000000 --- a/javascript/ql/test/library-tests/CallGraphs/getAFunctionValue.expected +++ /dev/null @@ -1,136 +0,0 @@ -| a.js:1:8:1:10 | foo | b.js:1:16:1:27 | function(){} | -| a.js:1:15:1:17 | bar | b.js:2:8:2:24 | function bar() {} | -| a.js:1:20:1:22 | qux | c.js:2:8:2:24 | function bar() {} | -| a.js:2:1:2:3 | foo | b.js:1:16:1:27 | function(){} | -| a.js:3:1:3:3 | bar | b.js:2:8:2:24 | function bar() {} | -| a.js:4:1:4:3 | qux | c.js:2:8:2:24 | function bar() {} | -| b.js:1:16:1:27 | function(){} | b.js:1:16:1:27 | function(){} | -| b.js:2:8:2:24 | function bar() {} | b.js:2:8:2:24 | function bar() {} | -| c.js:1:16:1:27 | function(){} | c.js:1:16:1:27 | function(){} | -| c.js:2:8:2:24 | function bar() {} | c.js:2:8:2:24 | function bar() {} | -| classes.js:1:1:19:2 | (functi ... o();\\n}) | classes.js:1:2:19:1 | functio ... lo();\\n} | -| classes.js:1:2:19:1 | functio ... lo();\\n} | classes.js:1:2:19:1 | functio ... lo();\\n} | -| classes.js:2:3:10:3 | A | classes.js:2:11:2:10 | () {} | -| classes.js:2:3:10:3 | class A ... }\\n } | classes.js:2:11:2:10 | () {} | -| classes.js:2:11:2:10 | () {} | classes.js:2:11:2:10 | () {} | -| classes.js:3:10:5:5 | () {\\n ... ;\\n } | classes.js:3:10:5:5 | () {\\n ... ;\\n } | -| classes.js:7:6:9:5 | () {\\n ... ;\\n } | classes.js:7:6:9:5 | () {\\n ... ;\\n } | -| classes.js:8:7:8:16 | this.hello | classes.js:3:10:5:5 | () {\\n ... ;\\n } | -| classes.js:12:3:16:3 | B | classes.js:12:21:12:20 | (...arg ... rgs); } | -| classes.js:12:3:16:3 | class B ... }\\n } | classes.js:12:21:12:20 | (...arg ... rgs); } | -| classes.js:12:19:12:19 | A | classes.js:2:11:2:10 | () {} | -| classes.js:12:21:12:20 | (...arg ... rgs); } | classes.js:12:21:12:20 | (...arg ... rgs); } | -| classes.js:12:21:12:20 | super | classes.js:2:11:2:10 | () {} | -| classes.js:13:10:15:5 | () {\\n ... ;\\n } | classes.js:13:10:15:5 | () {\\n ... ;\\n } | -| classes.js:18:3:18:15 | new B().hello | classes.js:13:10:15:5 | () {\\n ... ;\\n } | -| classes.js:18:7:18:7 | B | classes.js:12:21:12:20 | (...arg ... rgs); } | -| es2015.js:1:1:5:1 | class E ... ;\\n }\\n} | es2015.js:2:14:4:3 | () {\\n ... ");\\n } | -| es2015.js:2:14:4:3 | () {\\n ... ");\\n } | es2015.js:2:14:4:3 | () {\\n ... ");\\n } | -| es2015.js:6:5:6:16 | ExampleClass | es2015.js:2:14:4:3 | () {\\n ... ");\\n } | -| es2015.js:8:2:12:1 | functio ... \\n };\\n} | es2015.js:8:2:12:1 | functio ... \\n };\\n} | -| es2015.js:9:10:11:3 | () => { ... ();\\n } | es2015.js:9:10:11:3 | () => { ... ();\\n } | -| es2015.js:10:5:10:20 | arguments.callee | es2015.js:8:2:12:1 | functio ... \\n };\\n} | -| es2015.js:10:5:10:22 | arguments.callee() | es2015.js:9:10:11:3 | () => { ... ();\\n } | -| es2015.js:14:1:18:1 | class S ... ;\\n }\\n} | es2015.js:15:14:17:3 | () {\\n ... ();\\n } | -| es2015.js:14:19:14:47 | ("Wait ... eClass) | es2015.js:2:14:4:3 | () {\\n ... ");\\n } | -| es2015.js:14:20:14:46 | "Wait f ... leClass | es2015.js:2:14:4:3 | () {\\n ... ");\\n } | -| es2015.js:14:35:14:46 | ExampleClass | es2015.js:2:14:4:3 | () {\\n ... ");\\n } | -| es2015.js:15:14:17:3 | () {\\n ... ();\\n } | es2015.js:15:14:17:3 | () {\\n ... ();\\n } | -| es2015.js:16:5:16:9 | super | es2015.js:2:14:4:3 | () {\\n ... ");\\n } | -| es2015.js:20:1:22:1 | functio ... = 42;\\n} | es2015.js:20:1:22:1 | functio ... = 42;\\n} | -| es2015.js:24:1:29:1 | class O ... ;\\n }\\n} | es2015.js:25:14:28:3 | () {\\n ... x);\\n } | -| es2015.js:24:24:24:34 | PseudoClass | es2015.js:20:1:22:1 | functio ... = 42;\\n} | -| es2015.js:25:14:28:3 | () {\\n ... x);\\n } | es2015.js:25:14:28:3 | () {\\n ... x);\\n } | -| es2015.js:26:5:26:9 | super | es2015.js:20:1:22:1 | functio ... = 42;\\n} | -| es2015.js:31:1:33:1 | functio ... +y+z;\\n} | es2015.js:31:1:33:1 | functio ... +y+z;\\n} | -| es2015.js:34:1:34:3 | sum | es2015.js:31:1:33:1 | functio ... +y+z;\\n} | -| es2015.js:35:1:35:3 | sum | es2015.js:31:1:33:1 | functio ... +y+z;\\n} | -| es2015.js:36:1:36:3 | sum | es2015.js:31:1:33:1 | functio ... +y+z;\\n} | -| m2.js:2:6:2:18 | function() {} | m2.js:2:6:2:18 | function() {} | -| m.js:1:1:1:25 | exports ... on() {} | m.js:1:13:1:25 | function() {} | -| m.js:1:13:1:25 | function() {} | m.js:1:13:1:25 | function() {} | -| m.js:2:1:2:9 | exports.f | m.js:1:13:1:25 | function() {} | -| m.js:3:1:3:16 | module.exports.f | m.js:1:13:1:25 | function() {} | -| n.js:2:1:2:3 | m.f | m.js:1:13:1:25 | function() {} | -| n.js:5:1:5:4 | m2.f | m2.js:2:6:2:18 | function() {} | -| reflection.js:1:1:3:1 | functio ... x+y;\\n} | reflection.js:1:1:3:1 | functio ... x+y;\\n} | -| reflection.js:5:3:5:5 | add | reflection.js:1:1:3:1 | functio ... x+y;\\n} | -| reflection.js:5:3:5:39 | add.app ... n 56; } | reflection.js:5:15:5:39 | functio ... n 56; } | -| reflection.js:5:15:5:14 | this | reflection.js:1:1:3:1 | functio ... x+y;\\n} | -| reflection.js:5:15:5:39 | functio ... n 56; } | reflection.js:5:15:5:39 | functio ... n 56; } | -| reflection.js:7:1:7:3 | add | reflection.js:1:1:3:1 | functio ... x+y;\\n} | -| reflection.js:8:1:8:3 | add | reflection.js:1:1:3:1 | functio ... x+y;\\n} | -| reflection.js:8:1:8:9 | add.apply | reflection.js:5:15:5:39 | functio ... n 56; } | -| tst3.js:1:1:1:22 | functio ... fn() {} | tst3.js:1:1:1:22 | functio ... fn() {} | -| tst3.js:2:1:2:23 | functio ... n2() {} | tst3.js:2:1:2:23 | functio ... n2() {} | -| tst.js:1:1:1:15 | function f() {} | tst.js:1:1:1:15 | function f() {} | -| tst.js:2:9:2:21 | function() {} | tst.js:2:9:2:21 | function() {} | -| tst.js:3:1:3:17 | h = function() {} | tst.js:3:5:3:17 | function() {} | -| tst.js:3:5:3:17 | function() {} | tst.js:3:5:3:17 | function() {} | -| tst.js:4:1:4:5 | k = g | tst.js:2:9:2:21 | function() {} | -| tst.js:4:5:4:5 | g | tst.js:2:9:2:21 | function() {} | -| tst.js:6:1:6:1 | f | tst.js:1:1:1:15 | function f() {} | -| tst.js:7:1:7:1 | g | tst.js:2:9:2:21 | function() {} | -| tst.js:8:1:8:1 | h | tst.js:3:5:3:17 | function() {} | -| tst.js:9:1:9:1 | k | tst.js:2:9:2:21 | function() {} | -| tst.js:11:1:20:1 | functio ... \\tf();\\n} | tst.js:11:1:20:1 | functio ... \\tf();\\n} | -| tst.js:12:6:12:27 | n | tst.js:12:15:12:27 | function() {} | -| tst.js:12:10:12:27 | m \|\| function() {} | tst.js:12:15:12:27 | function() {} | -| tst.js:12:15:12:27 | function() {} | tst.js:12:15:12:27 | function() {} | -| tst.js:13:2:13:16 | function p() {} | tst.js:13:2:13:16 | function p() {} | -| tst.js:13:11:13:11 | p | tst.js:13:2:13:16 | function p() {} | -| tst.js:15:2:15:2 | l | tst.js:11:1:20:1 | functio ... \\tf();\\n} | -| tst.js:16:2:16:17 | arguments.callee | tst.js:11:1:20:1 | functio ... \\tf();\\n} | -| tst.js:17:2:17:2 | n | tst.js:12:15:12:27 | function() {} | -| tst.js:18:2:18:2 | p | tst.js:13:2:13:16 | function p() {} | -| tst.js:19:2:19:2 | f | tst.js:1:1:1:15 | function f() {} | -| tst.js:22:1:22:1 | l | tst.js:11:1:20:1 | functio ... \\tf();\\n} | -| tst.js:22:3:22:3 | k | tst.js:2:9:2:21 | function() {} | -| tst.js:24:5:24:5 | f | tst.js:1:1:1:15 | function f() {} | -| tst.js:25:5:25:5 | g | tst.js:2:9:2:21 | function() {} | -| tst.js:27:1:27:14 | (function(){}) | tst.js:27:2:27:13 | function(){} | -| tst.js:27:2:27:13 | function(){} | tst.js:27:2:27:13 | function(){} | -| tst.js:28:2:28:13 | function(){} | tst.js:28:2:28:13 | function(){} | -| tst.js:32:6:34:3 | functio ... ();\\n\\t\\t} | tst.js:32:6:34:3 | functio ... ();\\n\\t\\t} | -| tst.js:33:4:33:9 | this.g | tst.js:35:6:35:18 | function() {} | -| tst.js:35:6:35:18 | function() {} | tst.js:35:6:35:18 | function() {} | -| tst.js:38:6:38:18 | function() {} | tst.js:38:6:38:18 | function() {} | -| tst.js:39:6:39:6 | g | tst.js:2:9:2:21 | function() {} | -| tst.js:41:1:41:3 | o.f | tst.js:32:6:34:3 | functio ... ();\\n\\t\\t} | -| tst.js:42:1:42:32 | (functi ... }(o)).f | tst.js:32:6:34:3 | functio ... ();\\n\\t\\t} | -| tst.js:42:2:42:26 | functio ... rn x; } | tst.js:42:2:42:26 | functio ... rn x; } | -| tst.js:44:1:44:15 | function A() {} | tst.js:44:1:44:15 | function A() {} | -| tst.js:45:1:45:1 | A | tst.js:44:1:44:15 | function A() {} | -| tst.js:45:1:47:1 | A.proto ... .g();\\n} | tst.js:45:17:47:1 | functio ... .g();\\n} | -| tst.js:45:17:47:1 | functio ... .g();\\n} | tst.js:45:17:47:1 | functio ... .g();\\n} | -| tst.js:46:2:46:7 | this.g | tst.js:48:17:48:29 | function() {} | -| tst.js:46:2:46:7 | this.g | tst.js:61:17:61:29 | function() {} | -| tst.js:48:1:48:1 | A | tst.js:44:1:44:15 | function A() {} | -| tst.js:48:1:48:29 | A.proto ... on() {} | tst.js:48:17:48:29 | function() {} | -| tst.js:48:17:48:29 | function() {} | tst.js:48:17:48:29 | function() {} | -| tst.js:50:1:50:15 | function B() {} | tst.js:50:1:50:15 | function B() {} | -| tst.js:51:1:51:1 | B | tst.js:50:1:50:15 | function B() {} | -| tst.js:52:5:54:2 | functio ... g();\\n\\t} | tst.js:52:5:54:2 | functio ... g();\\n\\t} | -| tst.js:53:3:53:8 | this.g | tst.js:56:39:56:51 | function() {} | -| tst.js:53:3:53:8 | this.g | tst.js:57:39:57:51 | function() {} | -| tst.js:56:1:56:1 | B | tst.js:50:1:50:15 | function B() {} | -| tst.js:56:1:57:51 | B.proto ... on() {} | tst.js:56:39:56:51 | function() {} | -| tst.js:56:1:57:51 | B.proto ... on() {} | tst.js:57:39:57:51 | function() {} | -| tst.js:56:17:57:51 | Math.ra ... on() {} | tst.js:56:39:56:51 | function() {} | -| tst.js:56:17:57:51 | Math.ra ... on() {} | tst.js:57:39:57:51 | function() {} | -| tst.js:56:39:56:51 | function() {} | tst.js:56:39:56:51 | function() {} | -| tst.js:57:39:57:51 | function() {} | tst.js:57:39:57:51 | function() {} | -| tst.js:59:1:59:15 | function C() {} | tst.js:59:1:59:15 | function C() {} | -| tst.js:60:1:60:1 | C | tst.js:59:1:59:15 | function C() {} | -| tst.js:60:19:60:19 | A | tst.js:44:1:44:15 | function A() {} | -| tst.js:61:1:61:1 | C | tst.js:59:1:59:15 | function C() {} | -| tst.js:61:1:61:29 | C.proto ... on() {} | tst.js:61:17:61:29 | function() {} | -| tst.js:61:17:61:29 | function() {} | tst.js:61:17:61:29 | function() {} | -| tst.js:63:1:67:2 | (functi ... f();\\n}) | tst.js:63:2:67:1 | functio ... .f();\\n} | -| tst.js:63:2:67:1 | functio ... .f();\\n} | tst.js:63:2:67:1 | functio ... .f();\\n} | -| tst.js:64:17:64:17 | B | tst.js:50:1:50:15 | function B() {} | -| tst.js:65:5:65:23 | b.f = function() {} | tst.js:65:11:65:23 | function() {} | -| tst.js:65:11:65:23 | function() {} | tst.js:65:11:65:23 | function() {} | -| tst.js:66:5:66:7 | b.f | tst.js:65:11:65:23 | function() {} | -| tst.js:69:1:69:8 | globalfn | tst3.js:1:1:1:22 | functio ... fn() {} | -| tst.js:70:1:70:9 | globalfn2 | tst3.js:2:1:2:23 | functio ... n2() {} | diff --git a/javascript/ql/test/library-tests/CallGraphs/getAFunctionValue.ql b/javascript/ql/test/library-tests/CallGraphs/getAFunctionValue.ql deleted file mode 100644 index ce4619d0024d..000000000000 --- a/javascript/ql/test/library-tests/CallGraphs/getAFunctionValue.ql +++ /dev/null @@ -1,4 +0,0 @@ -import javascript - -from DataFlow::Node node -select node, node.getAFunctionValue() diff --git a/javascript/ql/test/library-tests/CallGraphs/getAFunctionValue.qll b/javascript/ql/test/library-tests/CallGraphs/getAFunctionValue.qll new file mode 100644 index 000000000000..abc8a1298ab5 --- /dev/null +++ b/javascript/ql/test/library-tests/CallGraphs/getAFunctionValue.qll @@ -0,0 +1,5 @@ +import javascript + +query predicate test_getAFunctionValue(DataFlow::Node node, DataFlow::FunctionNode res) { + res = node.getAFunctionValue() +} diff --git a/javascript/ql/test/library-tests/CallGraphs/getAnArgument.expected b/javascript/ql/test/library-tests/CallGraphs/getAnArgument.expected deleted file mode 100644 index ca875d7161dd..000000000000 --- a/javascript/ql/test/library-tests/CallGraphs/getAnArgument.expected +++ /dev/null @@ -1,18 +0,0 @@ -| classes.js:4:7:4:26 | console.log("Hello") | classes.js:4:19:4:25 | "Hello" | -| classes.js:14:7:14:27 | console ... ello!") | classes.js:14:19:14:26 | "Hello!" | -| es2015.js:3:5:3:21 | console.log("hi") | es2015.js:3:17:3:20 | "hi" | -| es2015.js:27:5:27:23 | console.log(this.x) | es2015.js:27:17:27:22 | this.x | -| es2015.js:35:1:35:17 | sum(1, ...[2, 3]) | es2015.js:35:5:35:5 | 1 | -| es2015.js:36:1:36:17 | sum(1, ...[2], 3) | es2015.js:36:5:36:5 | 1 | -| es2015.js:36:1:36:17 | sum(1, ...[2], 3) | es2015.js:36:16:36:16 | 3 | -| n.js:1:9:1:22 | require('./m') | n.js:1:17:1:21 | './m' | -| n.js:4:10:4:24 | require('./m2') | n.js:4:18:4:23 | './m2' | -| reflection.js:7:1:7:22 | add.cal ... 23, 19) | reflection.js:7:10:7:13 | null | -| reflection.js:7:1:7:22 | add.cal ... 23, 19) | reflection.js:7:16:7:17 | 23 | -| reflection.js:7:1:7:22 | add.cal ... 23, 19) | reflection.js:7:20:7:21 | 19 | -| reflection.js:7:1:7:22 | reflective call | reflection.js:7:16:7:17 | 23 | -| reflection.js:7:1:7:22 | reflective call | reflection.js:7:20:7:21 | 19 | -| reflection.js:8:1:8:25 | add.app ... 3, 19]) | reflection.js:8:11:8:14 | null | -| reflection.js:8:1:8:25 | add.app ... 3, 19]) | reflection.js:8:17:8:24 | [23, 19] | -| tst.js:22:1:22:4 | l(k) | tst.js:22:3:22:3 | k | -| tst.js:42:2:42:29 | functio ... x; }(o) | tst.js:42:28:42:28 | o | diff --git a/javascript/ql/test/library-tests/CallGraphs/getAnArgument.ql b/javascript/ql/test/library-tests/CallGraphs/getAnArgument.ql deleted file mode 100644 index ee67cc483169..000000000000 --- a/javascript/ql/test/library-tests/CallGraphs/getAnArgument.ql +++ /dev/null @@ -1,4 +0,0 @@ -import javascript - -from DataFlow::InvokeNode invk -select invk, invk.getAnArgument() diff --git a/javascript/ql/test/library-tests/CallGraphs/getAnArgument.qll b/javascript/ql/test/library-tests/CallGraphs/getAnArgument.qll new file mode 100644 index 000000000000..32adf918bfa4 --- /dev/null +++ b/javascript/ql/test/library-tests/CallGraphs/getAnArgument.qll @@ -0,0 +1,5 @@ +import javascript + +query predicate test_getAnArgument(DataFlow::InvokeNode invk, DataFlow::Node res) { + res = invk.getAnArgument() +} diff --git a/javascript/ql/test/library-tests/CallGraphs/getArgument.expected b/javascript/ql/test/library-tests/CallGraphs/getArgument.expected deleted file mode 100644 index d403abc615d8..000000000000 --- a/javascript/ql/test/library-tests/CallGraphs/getArgument.expected +++ /dev/null @@ -1,17 +0,0 @@ -| classes.js:4:7:4:26 | console.log("Hello") | 0 | classes.js:4:19:4:25 | "Hello" | -| classes.js:14:7:14:27 | console ... ello!") | 0 | classes.js:14:19:14:26 | "Hello!" | -| es2015.js:3:5:3:21 | console.log("hi") | 0 | es2015.js:3:17:3:20 | "hi" | -| es2015.js:27:5:27:23 | console.log(this.x) | 0 | es2015.js:27:17:27:22 | this.x | -| es2015.js:35:1:35:17 | sum(1, ...[2, 3]) | 0 | es2015.js:35:5:35:5 | 1 | -| es2015.js:36:1:36:17 | sum(1, ...[2], 3) | 0 | es2015.js:36:5:36:5 | 1 | -| n.js:1:9:1:22 | require('./m') | 0 | n.js:1:17:1:21 | './m' | -| n.js:4:10:4:24 | require('./m2') | 0 | n.js:4:18:4:23 | './m2' | -| reflection.js:7:1:7:22 | add.cal ... 23, 19) | 0 | reflection.js:7:10:7:13 | null | -| reflection.js:7:1:7:22 | add.cal ... 23, 19) | 1 | reflection.js:7:16:7:17 | 23 | -| reflection.js:7:1:7:22 | add.cal ... 23, 19) | 2 | reflection.js:7:20:7:21 | 19 | -| reflection.js:7:1:7:22 | reflective call | 0 | reflection.js:7:16:7:17 | 23 | -| reflection.js:7:1:7:22 | reflective call | 1 | reflection.js:7:20:7:21 | 19 | -| reflection.js:8:1:8:25 | add.app ... 3, 19]) | 0 | reflection.js:8:11:8:14 | null | -| reflection.js:8:1:8:25 | add.app ... 3, 19]) | 1 | reflection.js:8:17:8:24 | [23, 19] | -| tst.js:22:1:22:4 | l(k) | 0 | tst.js:22:3:22:3 | k | -| tst.js:42:2:42:29 | functio ... x; }(o) | 0 | tst.js:42:28:42:28 | o | diff --git a/javascript/ql/test/library-tests/CallGraphs/getArgument.ql b/javascript/ql/test/library-tests/CallGraphs/getArgument.ql deleted file mode 100644 index bcbfc4c3c61a..000000000000 --- a/javascript/ql/test/library-tests/CallGraphs/getArgument.ql +++ /dev/null @@ -1,4 +0,0 @@ -import javascript - -from DataFlow::InvokeNode invk, int i -select invk, i, invk.getArgument(i) diff --git a/javascript/ql/test/library-tests/CallGraphs/getArgument.qll b/javascript/ql/test/library-tests/CallGraphs/getArgument.qll new file mode 100644 index 000000000000..26876183ed9e --- /dev/null +++ b/javascript/ql/test/library-tests/CallGraphs/getArgument.qll @@ -0,0 +1,5 @@ +import javascript + +query predicate test_getArgument(DataFlow::InvokeNode invk, int i, DataFlow::Node res) { + res = invk.getArgument(i) +} diff --git a/javascript/ql/test/library-tests/CallGraphs/getCalleeName.expected b/javascript/ql/test/library-tests/CallGraphs/getCalleeName.expected deleted file mode 100644 index 362c8d6c7803..000000000000 --- a/javascript/ql/test/library-tests/CallGraphs/getCalleeName.expected +++ /dev/null @@ -1,49 +0,0 @@ -| a.js:2:1:2:5 | foo() | foo | -| a.js:3:1:3:5 | bar() | bar | -| a.js:4:1:4:5 | qux() | qux | -| a.js:7:1:7:5 | baz() | baz | -| classes.js:4:7:4:26 | console.log("Hello") | log | -| classes.js:8:7:8:18 | this.hello() | hello | -| classes.js:14:7:14:27 | console ... ello!") | log | -| classes.js:18:3:18:9 | new B() | B | -| classes.js:18:3:18:17 | new B().hello() | hello | -| es2015.js:3:5:3:21 | console.log("hi") | log | -| es2015.js:6:1:6:18 | new ExampleClass() | ExampleClass | -| es2015.js:10:5:10:22 | arguments.callee() | callee | -| es2015.js:27:5:27:23 | console.log(this.x) | log | -| es2015.js:34:1:34:17 | sum(...[1, 2, 3]) | sum | -| es2015.js:35:1:35:17 | sum(1, ...[2, 3]) | sum | -| es2015.js:36:1:36:17 | sum(1, ...[2], 3) | sum | -| m.js:2:1:2:11 | exports.f() | f | -| m.js:3:1:3:18 | module.exports.f() | f | -| n.js:1:9:1:22 | require('./m') | require | -| n.js:2:1:2:5 | m.f() | f | -| n.js:4:10:4:24 | require('./m2') | require | -| n.js:5:1:5:6 | m2.f() | f | -| reflection.js:4:5:4:12 | sneaky() | sneaky | -| reflection.js:7:1:7:22 | add.cal ... 23, 19) | call | -| reflection.js:8:1:8:25 | add.app ... 3, 19]) | apply | -| tst.js:6:1:6:3 | f() | f | -| tst.js:7:1:7:3 | g() | g | -| tst.js:8:1:8:3 | h() | h | -| tst.js:9:1:9:3 | k() | k | -| tst.js:14:2:14:4 | m() | m | -| tst.js:15:2:15:4 | l() | l | -| tst.js:16:2:16:19 | arguments.callee() | callee | -| tst.js:17:2:17:4 | n() | n | -| tst.js:18:2:18:4 | p() | p | -| tst.js:19:2:19:4 | f() | f | -| tst.js:22:1:22:4 | l(k) | l | -| tst.js:24:1:24:7 | new f() | f | -| tst.js:25:1:25:5 | new g | g | -| tst.js:33:4:33:11 | this.g() | g | -| tst.js:41:1:41:5 | o.f() | f | -| tst.js:42:1:42:34 | (functi ... o)).f() | f | -| tst.js:46:2:46:9 | this.g() | g | -| tst.js:53:3:53:10 | this.g() | g | -| tst.js:56:17:56:29 | Math.random() | random | -| tst.js:60:15:60:21 | new A() | A | -| tst.js:64:13:64:19 | new B() | B | -| tst.js:66:5:66:9 | b.f() | f | -| tst.js:69:1:69:10 | globalfn() | globalfn | -| tst.js:70:1:70:11 | globalfn2() | globalfn2 | diff --git a/javascript/ql/test/library-tests/CallGraphs/getCalleeName.ql b/javascript/ql/test/library-tests/CallGraphs/getCalleeName.ql deleted file mode 100644 index 9ba6b8ba978b..000000000000 --- a/javascript/ql/test/library-tests/CallGraphs/getCalleeName.ql +++ /dev/null @@ -1,4 +0,0 @@ -import javascript - -from DataFlow::InvokeNode invk -select invk, invk.getCalleeName() diff --git a/javascript/ql/test/library-tests/CallGraphs/getCalleeName.qll b/javascript/ql/test/library-tests/CallGraphs/getCalleeName.qll new file mode 100644 index 000000000000..bdce70667bfa --- /dev/null +++ b/javascript/ql/test/library-tests/CallGraphs/getCalleeName.qll @@ -0,0 +1,5 @@ +import javascript + +query predicate test_getCalleeName(DataFlow::InvokeNode invk, string res) { + res = invk.getCalleeName() +} diff --git a/javascript/ql/test/library-tests/CallGraphs/getCalleeNode.expected b/javascript/ql/test/library-tests/CallGraphs/getCalleeNode.expected deleted file mode 100644 index d4c39f17f783..000000000000 --- a/javascript/ql/test/library-tests/CallGraphs/getCalleeNode.expected +++ /dev/null @@ -1,57 +0,0 @@ -| a.js:2:1:2:5 | foo() | a.js:2:1:2:3 | foo | -| a.js:3:1:3:5 | bar() | a.js:3:1:3:3 | bar | -| a.js:4:1:4:5 | qux() | a.js:4:1:4:3 | qux | -| a.js:7:1:7:5 | baz() | a.js:7:1:7:3 | baz | -| classes.js:4:7:4:26 | console.log("Hello") | classes.js:4:7:4:17 | console.log | -| classes.js:8:7:8:18 | this.hello() | classes.js:8:7:8:16 | this.hello | -| classes.js:12:21:12:20 | super(...args) | classes.js:12:21:12:20 | super | -| classes.js:14:7:14:27 | console ... ello!") | classes.js:14:7:14:17 | console.log | -| classes.js:18:3:18:9 | new B() | classes.js:18:7:18:7 | B | -| classes.js:18:3:18:17 | new B().hello() | classes.js:18:3:18:15 | new B().hello | -| es2015.js:3:5:3:21 | console.log("hi") | es2015.js:3:5:3:15 | console.log | -| es2015.js:6:1:6:18 | new ExampleClass() | es2015.js:6:5:6:16 | ExampleClass | -| es2015.js:10:5:10:22 | arguments.callee() | es2015.js:10:5:10:20 | arguments.callee | -| es2015.js:16:5:16:11 | super() | es2015.js:16:5:16:9 | super | -| es2015.js:26:5:26:11 | super() | es2015.js:26:5:26:9 | super | -| es2015.js:27:5:27:23 | console.log(this.x) | es2015.js:27:5:27:15 | console.log | -| es2015.js:34:1:34:17 | sum(...[1, 2, 3]) | es2015.js:34:1:34:3 | sum | -| es2015.js:35:1:35:17 | sum(1, ...[2, 3]) | es2015.js:35:1:35:3 | sum | -| es2015.js:36:1:36:17 | sum(1, ...[2], 3) | es2015.js:36:1:36:3 | sum | -| m.js:2:1:2:11 | exports.f() | m.js:2:1:2:9 | exports.f | -| m.js:3:1:3:18 | module.exports.f() | m.js:3:1:3:16 | module.exports.f | -| n.js:1:9:1:22 | require('./m') | n.js:1:9:1:15 | require | -| n.js:2:1:2:5 | m.f() | n.js:2:1:2:3 | m.f | -| n.js:4:10:4:24 | require('./m2') | n.js:4:10:4:16 | require | -| n.js:5:1:5:6 | m2.f() | n.js:5:1:5:4 | m2.f | -| reflection.js:4:5:4:12 | sneaky() | reflection.js:4:5:4:10 | sneaky | -| reflection.js:7:1:7:22 | add.cal ... 23, 19) | reflection.js:7:1:7:8 | add.call | -| reflection.js:7:1:7:22 | reflective call | reflection.js:7:1:7:3 | add | -| reflection.js:8:1:8:25 | add.app ... 3, 19]) | reflection.js:8:1:8:9 | add.apply | -| reflection.js:8:1:8:25 | reflective call | reflection.js:8:1:8:3 | add | -| tst.js:6:1:6:3 | f() | tst.js:6:1:6:1 | f | -| tst.js:7:1:7:3 | g() | tst.js:7:1:7:1 | g | -| tst.js:8:1:8:3 | h() | tst.js:8:1:8:1 | h | -| tst.js:9:1:9:3 | k() | tst.js:9:1:9:1 | k | -| tst.js:14:2:14:4 | m() | tst.js:14:2:14:2 | m | -| tst.js:15:2:15:4 | l() | tst.js:15:2:15:2 | l | -| tst.js:16:2:16:19 | arguments.callee() | tst.js:16:2:16:17 | arguments.callee | -| tst.js:17:2:17:4 | n() | tst.js:17:2:17:2 | n | -| tst.js:18:2:18:4 | p() | tst.js:18:2:18:2 | p | -| tst.js:19:2:19:4 | f() | tst.js:19:2:19:2 | f | -| tst.js:22:1:22:4 | l(k) | tst.js:22:1:22:1 | l | -| tst.js:24:1:24:7 | new f() | tst.js:24:5:24:5 | f | -| tst.js:25:1:25:5 | new g | tst.js:25:5:25:5 | g | -| tst.js:27:1:27:16 | (function(){})() | tst.js:27:1:27:14 | (function(){}) | -| tst.js:28:2:28:15 | function(){}() | tst.js:28:2:28:13 | function(){} | -| tst.js:33:4:33:11 | this.g() | tst.js:33:4:33:9 | this.g | -| tst.js:41:1:41:5 | o.f() | tst.js:41:1:41:3 | o.f | -| tst.js:42:1:42:34 | (functi ... o)).f() | tst.js:42:1:42:32 | (functi ... }(o)).f | -| tst.js:42:2:42:29 | functio ... x; }(o) | tst.js:42:2:42:26 | functio ... rn x; } | -| tst.js:46:2:46:9 | this.g() | tst.js:46:2:46:7 | this.g | -| tst.js:53:3:53:10 | this.g() | tst.js:53:3:53:8 | this.g | -| tst.js:56:17:56:29 | Math.random() | tst.js:56:17:56:27 | Math.random | -| tst.js:60:15:60:21 | new A() | tst.js:60:19:60:19 | A | -| tst.js:64:13:64:19 | new B() | tst.js:64:17:64:17 | B | -| tst.js:66:5:66:9 | b.f() | tst.js:66:5:66:7 | b.f | -| tst.js:69:1:69:10 | globalfn() | tst.js:69:1:69:8 | globalfn | -| tst.js:70:1:70:11 | globalfn2() | tst.js:70:1:70:9 | globalfn2 | diff --git a/javascript/ql/test/library-tests/CallGraphs/getCalleeNode.ql b/javascript/ql/test/library-tests/CallGraphs/getCalleeNode.ql deleted file mode 100644 index b853352df50d..000000000000 --- a/javascript/ql/test/library-tests/CallGraphs/getCalleeNode.ql +++ /dev/null @@ -1,4 +0,0 @@ -import javascript - -from DataFlow::InvokeNode invk -select invk, invk.getCalleeNode() diff --git a/javascript/ql/test/library-tests/CallGraphs/getCalleeNode.qll b/javascript/ql/test/library-tests/CallGraphs/getCalleeNode.qll new file mode 100644 index 000000000000..fd8bd1a6d527 --- /dev/null +++ b/javascript/ql/test/library-tests/CallGraphs/getCalleeNode.qll @@ -0,0 +1,5 @@ +import javascript + +query predicate test_getCalleeNode(DataFlow::InvokeNode invk, DataFlow::Node res) { + res = invk.getCalleeNode() +} diff --git a/javascript/ql/test/library-tests/CallGraphs/getLastArgument.expected b/javascript/ql/test/library-tests/CallGraphs/getLastArgument.expected deleted file mode 100644 index 6b568c8ba946..000000000000 --- a/javascript/ql/test/library-tests/CallGraphs/getLastArgument.expected +++ /dev/null @@ -1,11 +0,0 @@ -| classes.js:4:7:4:26 | console.log("Hello") | classes.js:4:19:4:25 | "Hello" | -| classes.js:14:7:14:27 | console ... ello!") | classes.js:14:19:14:26 | "Hello!" | -| es2015.js:3:5:3:21 | console.log("hi") | es2015.js:3:17:3:20 | "hi" | -| es2015.js:27:5:27:23 | console.log(this.x) | es2015.js:27:17:27:22 | this.x | -| n.js:1:9:1:22 | require('./m') | n.js:1:17:1:21 | './m' | -| n.js:4:10:4:24 | require('./m2') | n.js:4:18:4:23 | './m2' | -| reflection.js:7:1:7:22 | add.cal ... 23, 19) | reflection.js:7:20:7:21 | 19 | -| reflection.js:7:1:7:22 | reflective call | reflection.js:7:20:7:21 | 19 | -| reflection.js:8:1:8:25 | add.app ... 3, 19]) | reflection.js:8:17:8:24 | [23, 19] | -| tst.js:22:1:22:4 | l(k) | tst.js:22:3:22:3 | k | -| tst.js:42:2:42:29 | functio ... x; }(o) | tst.js:42:28:42:28 | o | diff --git a/javascript/ql/test/library-tests/CallGraphs/getLastArgument.ql b/javascript/ql/test/library-tests/CallGraphs/getLastArgument.ql deleted file mode 100644 index 78aaa95523b7..000000000000 --- a/javascript/ql/test/library-tests/CallGraphs/getLastArgument.ql +++ /dev/null @@ -1,4 +0,0 @@ -import javascript - -from DataFlow::InvokeNode invk -select invk, invk.getLastArgument() diff --git a/javascript/ql/test/library-tests/CallGraphs/getLastArgument.qll b/javascript/ql/test/library-tests/CallGraphs/getLastArgument.qll new file mode 100644 index 000000000000..d2bd8eb7f8b5 --- /dev/null +++ b/javascript/ql/test/library-tests/CallGraphs/getLastArgument.qll @@ -0,0 +1,5 @@ +import javascript + +query predicate test_getLastArgument(DataFlow::InvokeNode invk, DataFlow::Node res) { + res = invk.getLastArgument() +} diff --git a/javascript/ql/test/library-tests/CallGraphs/getNumArgument.expected b/javascript/ql/test/library-tests/CallGraphs/getNumArgument.expected deleted file mode 100644 index ef4abe4806d2..000000000000 --- a/javascript/ql/test/library-tests/CallGraphs/getNumArgument.expected +++ /dev/null @@ -1,52 +0,0 @@ -| a.js:2:1:2:5 | foo() | 0 | -| a.js:3:1:3:5 | bar() | 0 | -| a.js:4:1:4:5 | qux() | 0 | -| a.js:7:1:7:5 | baz() | 0 | -| classes.js:4:7:4:26 | console.log("Hello") | 1 | -| classes.js:8:7:8:18 | this.hello() | 0 | -| classes.js:14:7:14:27 | console ... ello!") | 1 | -| classes.js:18:3:18:9 | new B() | 0 | -| classes.js:18:3:18:17 | new B().hello() | 0 | -| es2015.js:3:5:3:21 | console.log("hi") | 1 | -| es2015.js:6:1:6:18 | new ExampleClass() | 0 | -| es2015.js:10:5:10:22 | arguments.callee() | 0 | -| es2015.js:16:5:16:11 | super() | 0 | -| es2015.js:26:5:26:11 | super() | 0 | -| es2015.js:27:5:27:23 | console.log(this.x) | 1 | -| m.js:2:1:2:11 | exports.f() | 0 | -| m.js:3:1:3:18 | module.exports.f() | 0 | -| n.js:1:9:1:22 | require('./m') | 1 | -| n.js:2:1:2:5 | m.f() | 0 | -| n.js:4:10:4:24 | require('./m2') | 1 | -| n.js:5:1:5:6 | m2.f() | 0 | -| reflection.js:4:5:4:12 | sneaky() | 0 | -| reflection.js:7:1:7:22 | add.cal ... 23, 19) | 3 | -| reflection.js:7:1:7:22 | reflective call | 2 | -| reflection.js:8:1:8:25 | add.app ... 3, 19]) | 2 | -| tst.js:6:1:6:3 | f() | 0 | -| tst.js:7:1:7:3 | g() | 0 | -| tst.js:8:1:8:3 | h() | 0 | -| tst.js:9:1:9:3 | k() | 0 | -| tst.js:14:2:14:4 | m() | 0 | -| tst.js:15:2:15:4 | l() | 0 | -| tst.js:16:2:16:19 | arguments.callee() | 0 | -| tst.js:17:2:17:4 | n() | 0 | -| tst.js:18:2:18:4 | p() | 0 | -| tst.js:19:2:19:4 | f() | 0 | -| tst.js:22:1:22:4 | l(k) | 1 | -| tst.js:24:1:24:7 | new f() | 0 | -| tst.js:25:1:25:5 | new g | 0 | -| tst.js:27:1:27:16 | (function(){})() | 0 | -| tst.js:28:2:28:15 | function(){}() | 0 | -| tst.js:33:4:33:11 | this.g() | 0 | -| tst.js:41:1:41:5 | o.f() | 0 | -| tst.js:42:1:42:34 | (functi ... o)).f() | 0 | -| tst.js:42:2:42:29 | functio ... x; }(o) | 1 | -| tst.js:46:2:46:9 | this.g() | 0 | -| tst.js:53:3:53:10 | this.g() | 0 | -| tst.js:56:17:56:29 | Math.random() | 0 | -| tst.js:60:15:60:21 | new A() | 0 | -| tst.js:64:13:64:19 | new B() | 0 | -| tst.js:66:5:66:9 | b.f() | 0 | -| tst.js:69:1:69:10 | globalfn() | 0 | -| tst.js:70:1:70:11 | globalfn2() | 0 | diff --git a/javascript/ql/test/library-tests/CallGraphs/getNumArgument.ql b/javascript/ql/test/library-tests/CallGraphs/getNumArgument.ql deleted file mode 100644 index 590636069bba..000000000000 --- a/javascript/ql/test/library-tests/CallGraphs/getNumArgument.ql +++ /dev/null @@ -1,4 +0,0 @@ -import javascript - -from DataFlow::InvokeNode invk -select invk, invk.getNumArgument() diff --git a/javascript/ql/test/library-tests/CallGraphs/getNumArgument.qll b/javascript/ql/test/library-tests/CallGraphs/getNumArgument.qll new file mode 100644 index 000000000000..b4f3e16f7cf2 --- /dev/null +++ b/javascript/ql/test/library-tests/CallGraphs/getNumArgument.qll @@ -0,0 +1,5 @@ +import javascript + +query predicate test_getNumArgument(DataFlow::InvokeNode invk, int res) { + res = invk.getNumArgument() +} diff --git a/javascript/ql/test/library-tests/CallGraphs/isImprecise.expected b/javascript/ql/test/library-tests/CallGraphs/isImprecise.expected deleted file mode 100644 index 64c796f99e78..000000000000 --- a/javascript/ql/test/library-tests/CallGraphs/isImprecise.expected +++ /dev/null @@ -1 +0,0 @@ -| tst.js:69:1:69:10 | globalfn() | diff --git a/javascript/ql/test/library-tests/CallGraphs/isImprecise.ql b/javascript/ql/test/library-tests/CallGraphs/isImprecise.ql deleted file mode 100644 index 085da6c7d3f9..000000000000 --- a/javascript/ql/test/library-tests/CallGraphs/isImprecise.ql +++ /dev/null @@ -1,5 +0,0 @@ -import javascript - -from DataFlow::InvokeNode invk -where invk.isImprecise() -select invk diff --git a/javascript/ql/test/library-tests/CallGraphs/isImprecise.qll b/javascript/ql/test/library-tests/CallGraphs/isImprecise.qll new file mode 100644 index 000000000000..93f4b1b17819 --- /dev/null +++ b/javascript/ql/test/library-tests/CallGraphs/isImprecise.qll @@ -0,0 +1,3 @@ +import javascript + +query predicate test_isImprecise(DataFlow::InvokeNode invk) { invk.isImprecise() } diff --git a/javascript/ql/test/library-tests/CallGraphs/isIncomplete.expected b/javascript/ql/test/library-tests/CallGraphs/isIncomplete.expected deleted file mode 100644 index 05643c0f5ab8..000000000000 --- a/javascript/ql/test/library-tests/CallGraphs/isIncomplete.expected +++ /dev/null @@ -1,30 +0,0 @@ -| a.js:7:1:7:5 | baz() | -| classes.js:4:7:4:26 | console.log("Hello") | -| classes.js:8:7:8:18 | this.hello() | -| classes.js:14:7:14:27 | console ... ello!") | -| classes.js:18:3:18:17 | new B().hello() | -| es2015.js:3:5:3:21 | console.log("hi") | -| es2015.js:27:5:27:23 | console.log(this.x) | -| m.js:2:1:2:11 | exports.f() | -| m.js:3:1:3:18 | module.exports.f() | -| n.js:1:9:1:22 | require('./m') | -| n.js:2:1:2:5 | m.f() | -| n.js:4:10:4:24 | require('./m2') | -| n.js:5:1:5:6 | m2.f() | -| reflection.js:7:1:7:22 | add.cal ... 23, 19) | -| reflection.js:8:1:8:25 | add.app ... 3, 19]) | -| tst.js:6:1:6:3 | f() | -| tst.js:7:1:7:3 | g() | -| tst.js:9:1:9:3 | k() | -| tst.js:14:2:14:4 | m() | -| tst.js:17:2:17:4 | n() | -| tst.js:19:2:19:4 | f() | -| tst.js:24:1:24:7 | new f() | -| tst.js:25:1:25:5 | new g | -| tst.js:33:4:33:11 | this.g() | -| tst.js:41:1:41:5 | o.f() | -| tst.js:42:1:42:34 | (functi ... o)).f() | -| tst.js:46:2:46:9 | this.g() | -| tst.js:53:3:53:10 | this.g() | -| tst.js:56:17:56:29 | Math.random() | -| tst.js:66:5:66:9 | b.f() | diff --git a/javascript/ql/test/library-tests/CallGraphs/isIncomplete.ql b/javascript/ql/test/library-tests/CallGraphs/isIncomplete.ql deleted file mode 100644 index c6da44516a36..000000000000 --- a/javascript/ql/test/library-tests/CallGraphs/isIncomplete.ql +++ /dev/null @@ -1,5 +0,0 @@ -import javascript - -from DataFlow::InvokeNode invk -where invk.isIncomplete() -select invk diff --git a/javascript/ql/test/library-tests/CallGraphs/isIncomplete.qll b/javascript/ql/test/library-tests/CallGraphs/isIncomplete.qll new file mode 100644 index 000000000000..d28a280625ca --- /dev/null +++ b/javascript/ql/test/library-tests/CallGraphs/isIncomplete.qll @@ -0,0 +1,3 @@ +import javascript + +query predicate test_isIncomplete(DataFlow::InvokeNode invk) { invk.isIncomplete() } diff --git a/javascript/ql/test/library-tests/CallGraphs/isUncertain.expected b/javascript/ql/test/library-tests/CallGraphs/isUncertain.expected deleted file mode 100644 index 8b8d23e043b2..000000000000 --- a/javascript/ql/test/library-tests/CallGraphs/isUncertain.expected +++ /dev/null @@ -1,31 +0,0 @@ -| a.js:7:1:7:5 | baz() | -| classes.js:4:7:4:26 | console.log("Hello") | -| classes.js:8:7:8:18 | this.hello() | -| classes.js:14:7:14:27 | console ... ello!") | -| classes.js:18:3:18:17 | new B().hello() | -| es2015.js:3:5:3:21 | console.log("hi") | -| es2015.js:27:5:27:23 | console.log(this.x) | -| m.js:2:1:2:11 | exports.f() | -| m.js:3:1:3:18 | module.exports.f() | -| n.js:1:9:1:22 | require('./m') | -| n.js:2:1:2:5 | m.f() | -| n.js:4:10:4:24 | require('./m2') | -| n.js:5:1:5:6 | m2.f() | -| reflection.js:7:1:7:22 | add.cal ... 23, 19) | -| reflection.js:8:1:8:25 | add.app ... 3, 19]) | -| tst.js:6:1:6:3 | f() | -| tst.js:7:1:7:3 | g() | -| tst.js:9:1:9:3 | k() | -| tst.js:14:2:14:4 | m() | -| tst.js:17:2:17:4 | n() | -| tst.js:19:2:19:4 | f() | -| tst.js:24:1:24:7 | new f() | -| tst.js:25:1:25:5 | new g | -| tst.js:33:4:33:11 | this.g() | -| tst.js:41:1:41:5 | o.f() | -| tst.js:42:1:42:34 | (functi ... o)).f() | -| tst.js:46:2:46:9 | this.g() | -| tst.js:53:3:53:10 | this.g() | -| tst.js:56:17:56:29 | Math.random() | -| tst.js:66:5:66:9 | b.f() | -| tst.js:69:1:69:10 | globalfn() | diff --git a/javascript/ql/test/library-tests/CallGraphs/isUncertain.ql b/javascript/ql/test/library-tests/CallGraphs/isUncertain.ql deleted file mode 100644 index 3e2a2c372c70..000000000000 --- a/javascript/ql/test/library-tests/CallGraphs/isUncertain.ql +++ /dev/null @@ -1,5 +0,0 @@ -import javascript - -from DataFlow::InvokeNode invk -where invk.isUncertain() -select invk diff --git a/javascript/ql/test/library-tests/CallGraphs/isUncertain.qll b/javascript/ql/test/library-tests/CallGraphs/isUncertain.qll new file mode 100644 index 000000000000..4d2f9a04b3c1 --- /dev/null +++ b/javascript/ql/test/library-tests/CallGraphs/isUncertain.qll @@ -0,0 +1,3 @@ +import javascript + +query predicate test_isUncertain(DataFlow::InvokeNode invk) { invk.isUncertain() } diff --git a/javascript/ql/test/library-tests/CallGraphs/tests.expected b/javascript/ql/test/library-tests/CallGraphs/tests.expected new file mode 100644 index 000000000000..b3a63a1726d2 --- /dev/null +++ b/javascript/ql/test/library-tests/CallGraphs/tests.expected @@ -0,0 +1,461 @@ +test_isUncertain +| a.js:7:1:7:5 | baz() | +| classes.js:4:7:4:26 | console.log("Hello") | +| classes.js:8:7:8:18 | this.hello() | +| classes.js:14:7:14:27 | console ... ello!") | +| classes.js:18:3:18:17 | new B().hello() | +| es2015.js:3:5:3:21 | console.log("hi") | +| es2015.js:27:5:27:23 | console.log(this.x) | +| m.js:2:1:2:11 | exports.f() | +| m.js:3:1:3:18 | module.exports.f() | +| n.js:1:9:1:22 | require('./m') | +| n.js:2:1:2:5 | m.f() | +| n.js:4:10:4:24 | require('./m2') | +| n.js:5:1:5:6 | m2.f() | +| reflection.js:7:1:7:22 | add.cal ... 23, 19) | +| reflection.js:8:1:8:25 | add.app ... 3, 19]) | +| tst.js:6:1:6:3 | f() | +| tst.js:7:1:7:3 | g() | +| tst.js:9:1:9:3 | k() | +| tst.js:14:2:14:4 | m() | +| tst.js:17:2:17:4 | n() | +| tst.js:19:2:19:4 | f() | +| tst.js:24:1:24:7 | new f() | +| tst.js:25:1:25:5 | new g | +| tst.js:33:4:33:11 | this.g() | +| tst.js:41:1:41:5 | o.f() | +| tst.js:42:1:42:34 | (functi ... o)).f() | +| tst.js:46:2:46:9 | this.g() | +| tst.js:53:3:53:10 | this.g() | +| tst.js:56:17:56:29 | Math.random() | +| tst.js:66:5:66:9 | b.f() | +| tst.js:69:1:69:10 | globalfn() | +test_getAFunctionValue +| a.js:1:8:1:10 | foo | b.js:1:16:1:27 | function(){} | +| a.js:1:15:1:17 | bar | b.js:2:8:2:24 | function bar() {} | +| a.js:1:20:1:22 | qux | c.js:2:8:2:24 | function bar() {} | +| a.js:2:1:2:3 | foo | b.js:1:16:1:27 | function(){} | +| a.js:3:1:3:3 | bar | b.js:2:8:2:24 | function bar() {} | +| a.js:4:1:4:3 | qux | c.js:2:8:2:24 | function bar() {} | +| b.js:1:16:1:27 | function(){} | b.js:1:16:1:27 | function(){} | +| b.js:2:8:2:24 | function bar() {} | b.js:2:8:2:24 | function bar() {} | +| c.js:1:16:1:27 | function(){} | c.js:1:16:1:27 | function(){} | +| c.js:2:8:2:24 | function bar() {} | c.js:2:8:2:24 | function bar() {} | +| classes.js:1:1:19:2 | (functi ... o();\\n}) | classes.js:1:2:19:1 | functio ... lo();\\n} | +| classes.js:1:2:19:1 | functio ... lo();\\n} | classes.js:1:2:19:1 | functio ... lo();\\n} | +| classes.js:2:3:10:3 | A | classes.js:2:11:2:10 | () {} | +| classes.js:2:3:10:3 | class A ... }\\n } | classes.js:2:11:2:10 | () {} | +| classes.js:2:11:2:10 | () {} | classes.js:2:11:2:10 | () {} | +| classes.js:3:10:5:5 | () {\\n ... ;\\n } | classes.js:3:10:5:5 | () {\\n ... ;\\n } | +| classes.js:7:6:9:5 | () {\\n ... ;\\n } | classes.js:7:6:9:5 | () {\\n ... ;\\n } | +| classes.js:8:7:8:16 | this.hello | classes.js:3:10:5:5 | () {\\n ... ;\\n } | +| classes.js:12:3:16:3 | B | classes.js:12:21:12:20 | (...arg ... rgs); } | +| classes.js:12:3:16:3 | class B ... }\\n } | classes.js:12:21:12:20 | (...arg ... rgs); } | +| classes.js:12:19:12:19 | A | classes.js:2:11:2:10 | () {} | +| classes.js:12:21:12:20 | (...arg ... rgs); } | classes.js:12:21:12:20 | (...arg ... rgs); } | +| classes.js:12:21:12:20 | super | classes.js:2:11:2:10 | () {} | +| classes.js:13:10:15:5 | () {\\n ... ;\\n } | classes.js:13:10:15:5 | () {\\n ... ;\\n } | +| classes.js:18:3:18:15 | new B().hello | classes.js:13:10:15:5 | () {\\n ... ;\\n } | +| classes.js:18:7:18:7 | B | classes.js:12:21:12:20 | (...arg ... rgs); } | +| es2015.js:1:1:5:1 | class E ... ;\\n }\\n} | es2015.js:2:14:4:3 | () {\\n ... ");\\n } | +| es2015.js:2:14:4:3 | () {\\n ... ");\\n } | es2015.js:2:14:4:3 | () {\\n ... ");\\n } | +| es2015.js:6:5:6:16 | ExampleClass | es2015.js:2:14:4:3 | () {\\n ... ");\\n } | +| es2015.js:8:2:12:1 | functio ... \\n };\\n} | es2015.js:8:2:12:1 | functio ... \\n };\\n} | +| es2015.js:9:10:11:3 | () => { ... ();\\n } | es2015.js:9:10:11:3 | () => { ... ();\\n } | +| es2015.js:10:5:10:20 | arguments.callee | es2015.js:8:2:12:1 | functio ... \\n };\\n} | +| es2015.js:10:5:10:22 | arguments.callee() | es2015.js:9:10:11:3 | () => { ... ();\\n } | +| es2015.js:14:1:18:1 | class S ... ;\\n }\\n} | es2015.js:15:14:17:3 | () {\\n ... ();\\n } | +| es2015.js:14:19:14:47 | ("Wait ... eClass) | es2015.js:2:14:4:3 | () {\\n ... ");\\n } | +| es2015.js:14:20:14:46 | "Wait f ... leClass | es2015.js:2:14:4:3 | () {\\n ... ");\\n } | +| es2015.js:14:35:14:46 | ExampleClass | es2015.js:2:14:4:3 | () {\\n ... ");\\n } | +| es2015.js:15:14:17:3 | () {\\n ... ();\\n } | es2015.js:15:14:17:3 | () {\\n ... ();\\n } | +| es2015.js:16:5:16:9 | super | es2015.js:2:14:4:3 | () {\\n ... ");\\n } | +| es2015.js:20:1:22:1 | functio ... = 42;\\n} | es2015.js:20:1:22:1 | functio ... = 42;\\n} | +| es2015.js:24:1:29:1 | class O ... ;\\n }\\n} | es2015.js:25:14:28:3 | () {\\n ... x);\\n } | +| es2015.js:24:24:24:34 | PseudoClass | es2015.js:20:1:22:1 | functio ... = 42;\\n} | +| es2015.js:25:14:28:3 | () {\\n ... x);\\n } | es2015.js:25:14:28:3 | () {\\n ... x);\\n } | +| es2015.js:26:5:26:9 | super | es2015.js:20:1:22:1 | functio ... = 42;\\n} | +| es2015.js:31:1:33:1 | functio ... +y+z;\\n} | es2015.js:31:1:33:1 | functio ... +y+z;\\n} | +| es2015.js:34:1:34:3 | sum | es2015.js:31:1:33:1 | functio ... +y+z;\\n} | +| es2015.js:35:1:35:3 | sum | es2015.js:31:1:33:1 | functio ... +y+z;\\n} | +| es2015.js:36:1:36:3 | sum | es2015.js:31:1:33:1 | functio ... +y+z;\\n} | +| m2.js:2:6:2:18 | function() {} | m2.js:2:6:2:18 | function() {} | +| m.js:1:1:1:25 | exports ... on() {} | m.js:1:13:1:25 | function() {} | +| m.js:1:13:1:25 | function() {} | m.js:1:13:1:25 | function() {} | +| m.js:2:1:2:9 | exports.f | m.js:1:13:1:25 | function() {} | +| m.js:3:1:3:16 | module.exports.f | m.js:1:13:1:25 | function() {} | +| n.js:2:1:2:3 | m.f | m.js:1:13:1:25 | function() {} | +| n.js:5:1:5:4 | m2.f | m2.js:2:6:2:18 | function() {} | +| reflection.js:1:1:3:1 | functio ... x+y;\\n} | reflection.js:1:1:3:1 | functio ... x+y;\\n} | +| reflection.js:5:3:5:5 | add | reflection.js:1:1:3:1 | functio ... x+y;\\n} | +| reflection.js:5:3:5:39 | add.app ... n 56; } | reflection.js:5:15:5:39 | functio ... n 56; } | +| reflection.js:5:15:5:14 | this | reflection.js:1:1:3:1 | functio ... x+y;\\n} | +| reflection.js:5:15:5:39 | functio ... n 56; } | reflection.js:5:15:5:39 | functio ... n 56; } | +| reflection.js:7:1:7:3 | add | reflection.js:1:1:3:1 | functio ... x+y;\\n} | +| reflection.js:8:1:8:3 | add | reflection.js:1:1:3:1 | functio ... x+y;\\n} | +| reflection.js:8:1:8:9 | add.apply | reflection.js:5:15:5:39 | functio ... n 56; } | +| tst3.js:1:1:1:22 | functio ... fn() {} | tst3.js:1:1:1:22 | functio ... fn() {} | +| tst3.js:2:1:2:23 | functio ... n2() {} | tst3.js:2:1:2:23 | functio ... n2() {} | +| tst.js:1:1:1:15 | function f() {} | tst.js:1:1:1:15 | function f() {} | +| tst.js:2:9:2:21 | function() {} | tst.js:2:9:2:21 | function() {} | +| tst.js:3:1:3:17 | h = function() {} | tst.js:3:5:3:17 | function() {} | +| tst.js:3:5:3:17 | function() {} | tst.js:3:5:3:17 | function() {} | +| tst.js:4:1:4:5 | k = g | tst.js:2:9:2:21 | function() {} | +| tst.js:4:5:4:5 | g | tst.js:2:9:2:21 | function() {} | +| tst.js:6:1:6:1 | f | tst.js:1:1:1:15 | function f() {} | +| tst.js:7:1:7:1 | g | tst.js:2:9:2:21 | function() {} | +| tst.js:8:1:8:1 | h | tst.js:3:5:3:17 | function() {} | +| tst.js:9:1:9:1 | k | tst.js:2:9:2:21 | function() {} | +| tst.js:11:1:20:1 | functio ... \\tf();\\n} | tst.js:11:1:20:1 | functio ... \\tf();\\n} | +| tst.js:12:6:12:27 | n | tst.js:12:15:12:27 | function() {} | +| tst.js:12:10:12:27 | m \|\| function() {} | tst.js:12:15:12:27 | function() {} | +| tst.js:12:15:12:27 | function() {} | tst.js:12:15:12:27 | function() {} | +| tst.js:13:2:13:16 | function p() {} | tst.js:13:2:13:16 | function p() {} | +| tst.js:13:11:13:11 | p | tst.js:13:2:13:16 | function p() {} | +| tst.js:15:2:15:2 | l | tst.js:11:1:20:1 | functio ... \\tf();\\n} | +| tst.js:16:2:16:17 | arguments.callee | tst.js:11:1:20:1 | functio ... \\tf();\\n} | +| tst.js:17:2:17:2 | n | tst.js:12:15:12:27 | function() {} | +| tst.js:18:2:18:2 | p | tst.js:13:2:13:16 | function p() {} | +| tst.js:19:2:19:2 | f | tst.js:1:1:1:15 | function f() {} | +| tst.js:22:1:22:1 | l | tst.js:11:1:20:1 | functio ... \\tf();\\n} | +| tst.js:22:3:22:3 | k | tst.js:2:9:2:21 | function() {} | +| tst.js:24:5:24:5 | f | tst.js:1:1:1:15 | function f() {} | +| tst.js:25:5:25:5 | g | tst.js:2:9:2:21 | function() {} | +| tst.js:27:1:27:14 | (function(){}) | tst.js:27:2:27:13 | function(){} | +| tst.js:27:2:27:13 | function(){} | tst.js:27:2:27:13 | function(){} | +| tst.js:28:2:28:13 | function(){} | tst.js:28:2:28:13 | function(){} | +| tst.js:32:6:34:3 | functio ... ();\\n\\t\\t} | tst.js:32:6:34:3 | functio ... ();\\n\\t\\t} | +| tst.js:33:4:33:9 | this.g | tst.js:35:6:35:18 | function() {} | +| tst.js:35:6:35:18 | function() {} | tst.js:35:6:35:18 | function() {} | +| tst.js:38:6:38:18 | function() {} | tst.js:38:6:38:18 | function() {} | +| tst.js:39:6:39:6 | g | tst.js:2:9:2:21 | function() {} | +| tst.js:41:1:41:3 | o.f | tst.js:32:6:34:3 | functio ... ();\\n\\t\\t} | +| tst.js:42:1:42:32 | (functi ... }(o)).f | tst.js:32:6:34:3 | functio ... ();\\n\\t\\t} | +| tst.js:42:2:42:26 | functio ... rn x; } | tst.js:42:2:42:26 | functio ... rn x; } | +| tst.js:44:1:44:15 | function A() {} | tst.js:44:1:44:15 | function A() {} | +| tst.js:45:1:45:1 | A | tst.js:44:1:44:15 | function A() {} | +| tst.js:45:1:47:1 | A.proto ... .g();\\n} | tst.js:45:17:47:1 | functio ... .g();\\n} | +| tst.js:45:17:47:1 | functio ... .g();\\n} | tst.js:45:17:47:1 | functio ... .g();\\n} | +| tst.js:46:2:46:7 | this.g | tst.js:48:17:48:29 | function() {} | +| tst.js:46:2:46:7 | this.g | tst.js:61:17:61:29 | function() {} | +| tst.js:48:1:48:1 | A | tst.js:44:1:44:15 | function A() {} | +| tst.js:48:1:48:29 | A.proto ... on() {} | tst.js:48:17:48:29 | function() {} | +| tst.js:48:17:48:29 | function() {} | tst.js:48:17:48:29 | function() {} | +| tst.js:50:1:50:15 | function B() {} | tst.js:50:1:50:15 | function B() {} | +| tst.js:51:1:51:1 | B | tst.js:50:1:50:15 | function B() {} | +| tst.js:52:5:54:2 | functio ... g();\\n\\t} | tst.js:52:5:54:2 | functio ... g();\\n\\t} | +| tst.js:53:3:53:8 | this.g | tst.js:56:39:56:51 | function() {} | +| tst.js:53:3:53:8 | this.g | tst.js:57:39:57:51 | function() {} | +| tst.js:56:1:56:1 | B | tst.js:50:1:50:15 | function B() {} | +| tst.js:56:1:57:51 | B.proto ... on() {} | tst.js:56:39:56:51 | function() {} | +| tst.js:56:1:57:51 | B.proto ... on() {} | tst.js:57:39:57:51 | function() {} | +| tst.js:56:17:57:51 | Math.ra ... on() {} | tst.js:56:39:56:51 | function() {} | +| tst.js:56:17:57:51 | Math.ra ... on() {} | tst.js:57:39:57:51 | function() {} | +| tst.js:56:39:56:51 | function() {} | tst.js:56:39:56:51 | function() {} | +| tst.js:57:39:57:51 | function() {} | tst.js:57:39:57:51 | function() {} | +| tst.js:59:1:59:15 | function C() {} | tst.js:59:1:59:15 | function C() {} | +| tst.js:60:1:60:1 | C | tst.js:59:1:59:15 | function C() {} | +| tst.js:60:19:60:19 | A | tst.js:44:1:44:15 | function A() {} | +| tst.js:61:1:61:1 | C | tst.js:59:1:59:15 | function C() {} | +| tst.js:61:1:61:29 | C.proto ... on() {} | tst.js:61:17:61:29 | function() {} | +| tst.js:61:17:61:29 | function() {} | tst.js:61:17:61:29 | function() {} | +| tst.js:63:1:67:2 | (functi ... f();\\n}) | tst.js:63:2:67:1 | functio ... .f();\\n} | +| tst.js:63:2:67:1 | functio ... .f();\\n} | tst.js:63:2:67:1 | functio ... .f();\\n} | +| tst.js:64:17:64:17 | B | tst.js:50:1:50:15 | function B() {} | +| tst.js:65:5:65:23 | b.f = function() {} | tst.js:65:11:65:23 | function() {} | +| tst.js:65:11:65:23 | function() {} | tst.js:65:11:65:23 | function() {} | +| tst.js:66:5:66:7 | b.f | tst.js:65:11:65:23 | function() {} | +| tst.js:69:1:69:8 | globalfn | tst3.js:1:1:1:22 | functio ... fn() {} | +| tst.js:70:1:70:9 | globalfn2 | tst3.js:2:1:2:23 | functio ... n2() {} | +test_getArgument +| classes.js:4:7:4:26 | console.log("Hello") | 0 | classes.js:4:19:4:25 | "Hello" | +| classes.js:14:7:14:27 | console ... ello!") | 0 | classes.js:14:19:14:26 | "Hello!" | +| es2015.js:3:5:3:21 | console.log("hi") | 0 | es2015.js:3:17:3:20 | "hi" | +| es2015.js:27:5:27:23 | console.log(this.x) | 0 | es2015.js:27:17:27:22 | this.x | +| es2015.js:35:1:35:17 | sum(1, ...[2, 3]) | 0 | es2015.js:35:5:35:5 | 1 | +| es2015.js:36:1:36:17 | sum(1, ...[2], 3) | 0 | es2015.js:36:5:36:5 | 1 | +| n.js:1:9:1:22 | require('./m') | 0 | n.js:1:17:1:21 | './m' | +| n.js:4:10:4:24 | require('./m2') | 0 | n.js:4:18:4:23 | './m2' | +| reflection.js:7:1:7:22 | add.cal ... 23, 19) | 0 | reflection.js:7:10:7:13 | null | +| reflection.js:7:1:7:22 | add.cal ... 23, 19) | 1 | reflection.js:7:16:7:17 | 23 | +| reflection.js:7:1:7:22 | add.cal ... 23, 19) | 2 | reflection.js:7:20:7:21 | 19 | +| reflection.js:7:1:7:22 | reflective call | 0 | reflection.js:7:16:7:17 | 23 | +| reflection.js:7:1:7:22 | reflective call | 1 | reflection.js:7:20:7:21 | 19 | +| reflection.js:8:1:8:25 | add.app ... 3, 19]) | 0 | reflection.js:8:11:8:14 | null | +| reflection.js:8:1:8:25 | add.app ... 3, 19]) | 1 | reflection.js:8:17:8:24 | [23, 19] | +| tst.js:22:1:22:4 | l(k) | 0 | tst.js:22:3:22:3 | k | +| tst.js:42:2:42:29 | functio ... x; }(o) | 0 | tst.js:42:28:42:28 | o | +test_getNumArgument +| a.js:2:1:2:5 | foo() | 0 | +| a.js:3:1:3:5 | bar() | 0 | +| a.js:4:1:4:5 | qux() | 0 | +| a.js:7:1:7:5 | baz() | 0 | +| classes.js:4:7:4:26 | console.log("Hello") | 1 | +| classes.js:8:7:8:18 | this.hello() | 0 | +| classes.js:14:7:14:27 | console ... ello!") | 1 | +| classes.js:18:3:18:9 | new B() | 0 | +| classes.js:18:3:18:17 | new B().hello() | 0 | +| es2015.js:3:5:3:21 | console.log("hi") | 1 | +| es2015.js:6:1:6:18 | new ExampleClass() | 0 | +| es2015.js:10:5:10:22 | arguments.callee() | 0 | +| es2015.js:16:5:16:11 | super() | 0 | +| es2015.js:26:5:26:11 | super() | 0 | +| es2015.js:27:5:27:23 | console.log(this.x) | 1 | +| m.js:2:1:2:11 | exports.f() | 0 | +| m.js:3:1:3:18 | module.exports.f() | 0 | +| n.js:1:9:1:22 | require('./m') | 1 | +| n.js:2:1:2:5 | m.f() | 0 | +| n.js:4:10:4:24 | require('./m2') | 1 | +| n.js:5:1:5:6 | m2.f() | 0 | +| reflection.js:4:5:4:12 | sneaky() | 0 | +| reflection.js:7:1:7:22 | add.cal ... 23, 19) | 3 | +| reflection.js:7:1:7:22 | reflective call | 2 | +| reflection.js:8:1:8:25 | add.app ... 3, 19]) | 2 | +| tst.js:6:1:6:3 | f() | 0 | +| tst.js:7:1:7:3 | g() | 0 | +| tst.js:8:1:8:3 | h() | 0 | +| tst.js:9:1:9:3 | k() | 0 | +| tst.js:14:2:14:4 | m() | 0 | +| tst.js:15:2:15:4 | l() | 0 | +| tst.js:16:2:16:19 | arguments.callee() | 0 | +| tst.js:17:2:17:4 | n() | 0 | +| tst.js:18:2:18:4 | p() | 0 | +| tst.js:19:2:19:4 | f() | 0 | +| tst.js:22:1:22:4 | l(k) | 1 | +| tst.js:24:1:24:7 | new f() | 0 | +| tst.js:25:1:25:5 | new g | 0 | +| tst.js:27:1:27:16 | (function(){})() | 0 | +| tst.js:28:2:28:15 | function(){}() | 0 | +| tst.js:33:4:33:11 | this.g() | 0 | +| tst.js:41:1:41:5 | o.f() | 0 | +| tst.js:42:1:42:34 | (functi ... o)).f() | 0 | +| tst.js:42:2:42:29 | functio ... x; }(o) | 1 | +| tst.js:46:2:46:9 | this.g() | 0 | +| tst.js:53:3:53:10 | this.g() | 0 | +| tst.js:56:17:56:29 | Math.random() | 0 | +| tst.js:60:15:60:21 | new A() | 0 | +| tst.js:64:13:64:19 | new B() | 0 | +| tst.js:66:5:66:9 | b.f() | 0 | +| tst.js:69:1:69:10 | globalfn() | 0 | +| tst.js:70:1:70:11 | globalfn2() | 0 | +test_isIncomplete +| a.js:7:1:7:5 | baz() | +| classes.js:4:7:4:26 | console.log("Hello") | +| classes.js:8:7:8:18 | this.hello() | +| classes.js:14:7:14:27 | console ... ello!") | +| classes.js:18:3:18:17 | new B().hello() | +| es2015.js:3:5:3:21 | console.log("hi") | +| es2015.js:27:5:27:23 | console.log(this.x) | +| m.js:2:1:2:11 | exports.f() | +| m.js:3:1:3:18 | module.exports.f() | +| n.js:1:9:1:22 | require('./m') | +| n.js:2:1:2:5 | m.f() | +| n.js:4:10:4:24 | require('./m2') | +| n.js:5:1:5:6 | m2.f() | +| reflection.js:7:1:7:22 | add.cal ... 23, 19) | +| reflection.js:8:1:8:25 | add.app ... 3, 19]) | +| tst.js:6:1:6:3 | f() | +| tst.js:7:1:7:3 | g() | +| tst.js:9:1:9:3 | k() | +| tst.js:14:2:14:4 | m() | +| tst.js:17:2:17:4 | n() | +| tst.js:19:2:19:4 | f() | +| tst.js:24:1:24:7 | new f() | +| tst.js:25:1:25:5 | new g | +| tst.js:33:4:33:11 | this.g() | +| tst.js:41:1:41:5 | o.f() | +| tst.js:42:1:42:34 | (functi ... o)).f() | +| tst.js:46:2:46:9 | this.g() | +| tst.js:53:3:53:10 | this.g() | +| tst.js:56:17:56:29 | Math.random() | +| tst.js:66:5:66:9 | b.f() | +test_getCalleeNode +| a.js:2:1:2:5 | foo() | a.js:2:1:2:3 | foo | +| a.js:3:1:3:5 | bar() | a.js:3:1:3:3 | bar | +| a.js:4:1:4:5 | qux() | a.js:4:1:4:3 | qux | +| a.js:7:1:7:5 | baz() | a.js:7:1:7:3 | baz | +| classes.js:4:7:4:26 | console.log("Hello") | classes.js:4:7:4:17 | console.log | +| classes.js:8:7:8:18 | this.hello() | classes.js:8:7:8:16 | this.hello | +| classes.js:12:21:12:20 | super(...args) | classes.js:12:21:12:20 | super | +| classes.js:14:7:14:27 | console ... ello!") | classes.js:14:7:14:17 | console.log | +| classes.js:18:3:18:9 | new B() | classes.js:18:7:18:7 | B | +| classes.js:18:3:18:17 | new B().hello() | classes.js:18:3:18:15 | new B().hello | +| es2015.js:3:5:3:21 | console.log("hi") | es2015.js:3:5:3:15 | console.log | +| es2015.js:6:1:6:18 | new ExampleClass() | es2015.js:6:5:6:16 | ExampleClass | +| es2015.js:10:5:10:22 | arguments.callee() | es2015.js:10:5:10:20 | arguments.callee | +| es2015.js:16:5:16:11 | super() | es2015.js:16:5:16:9 | super | +| es2015.js:26:5:26:11 | super() | es2015.js:26:5:26:9 | super | +| es2015.js:27:5:27:23 | console.log(this.x) | es2015.js:27:5:27:15 | console.log | +| es2015.js:34:1:34:17 | sum(...[1, 2, 3]) | es2015.js:34:1:34:3 | sum | +| es2015.js:35:1:35:17 | sum(1, ...[2, 3]) | es2015.js:35:1:35:3 | sum | +| es2015.js:36:1:36:17 | sum(1, ...[2], 3) | es2015.js:36:1:36:3 | sum | +| m.js:2:1:2:11 | exports.f() | m.js:2:1:2:9 | exports.f | +| m.js:3:1:3:18 | module.exports.f() | m.js:3:1:3:16 | module.exports.f | +| n.js:1:9:1:22 | require('./m') | n.js:1:9:1:15 | require | +| n.js:2:1:2:5 | m.f() | n.js:2:1:2:3 | m.f | +| n.js:4:10:4:24 | require('./m2') | n.js:4:10:4:16 | require | +| n.js:5:1:5:6 | m2.f() | n.js:5:1:5:4 | m2.f | +| reflection.js:4:5:4:12 | sneaky() | reflection.js:4:5:4:10 | sneaky | +| reflection.js:7:1:7:22 | add.cal ... 23, 19) | reflection.js:7:1:7:8 | add.call | +| reflection.js:7:1:7:22 | reflective call | reflection.js:7:1:7:3 | add | +| reflection.js:8:1:8:25 | add.app ... 3, 19]) | reflection.js:8:1:8:9 | add.apply | +| reflection.js:8:1:8:25 | reflective call | reflection.js:8:1:8:3 | add | +| tst.js:6:1:6:3 | f() | tst.js:6:1:6:1 | f | +| tst.js:7:1:7:3 | g() | tst.js:7:1:7:1 | g | +| tst.js:8:1:8:3 | h() | tst.js:8:1:8:1 | h | +| tst.js:9:1:9:3 | k() | tst.js:9:1:9:1 | k | +| tst.js:14:2:14:4 | m() | tst.js:14:2:14:2 | m | +| tst.js:15:2:15:4 | l() | tst.js:15:2:15:2 | l | +| tst.js:16:2:16:19 | arguments.callee() | tst.js:16:2:16:17 | arguments.callee | +| tst.js:17:2:17:4 | n() | tst.js:17:2:17:2 | n | +| tst.js:18:2:18:4 | p() | tst.js:18:2:18:2 | p | +| tst.js:19:2:19:4 | f() | tst.js:19:2:19:2 | f | +| tst.js:22:1:22:4 | l(k) | tst.js:22:1:22:1 | l | +| tst.js:24:1:24:7 | new f() | tst.js:24:5:24:5 | f | +| tst.js:25:1:25:5 | new g | tst.js:25:5:25:5 | g | +| tst.js:27:1:27:16 | (function(){})() | tst.js:27:1:27:14 | (function(){}) | +| tst.js:28:2:28:15 | function(){}() | tst.js:28:2:28:13 | function(){} | +| tst.js:33:4:33:11 | this.g() | tst.js:33:4:33:9 | this.g | +| tst.js:41:1:41:5 | o.f() | tst.js:41:1:41:3 | o.f | +| tst.js:42:1:42:34 | (functi ... o)).f() | tst.js:42:1:42:32 | (functi ... }(o)).f | +| tst.js:42:2:42:29 | functio ... x; }(o) | tst.js:42:2:42:26 | functio ... rn x; } | +| tst.js:46:2:46:9 | this.g() | tst.js:46:2:46:7 | this.g | +| tst.js:53:3:53:10 | this.g() | tst.js:53:3:53:8 | this.g | +| tst.js:56:17:56:29 | Math.random() | tst.js:56:17:56:27 | Math.random | +| tst.js:60:15:60:21 | new A() | tst.js:60:19:60:19 | A | +| tst.js:64:13:64:19 | new B() | tst.js:64:17:64:17 | B | +| tst.js:66:5:66:9 | b.f() | tst.js:66:5:66:7 | b.f | +| tst.js:69:1:69:10 | globalfn() | tst.js:69:1:69:8 | globalfn | +| tst.js:70:1:70:11 | globalfn2() | tst.js:70:1:70:9 | globalfn2 | +test_getLastArgument +| classes.js:4:7:4:26 | console.log("Hello") | classes.js:4:19:4:25 | "Hello" | +| classes.js:14:7:14:27 | console ... ello!") | classes.js:14:19:14:26 | "Hello!" | +| es2015.js:3:5:3:21 | console.log("hi") | es2015.js:3:17:3:20 | "hi" | +| es2015.js:27:5:27:23 | console.log(this.x) | es2015.js:27:17:27:22 | this.x | +| n.js:1:9:1:22 | require('./m') | n.js:1:17:1:21 | './m' | +| n.js:4:10:4:24 | require('./m2') | n.js:4:18:4:23 | './m2' | +| reflection.js:7:1:7:22 | add.cal ... 23, 19) | reflection.js:7:20:7:21 | 19 | +| reflection.js:7:1:7:22 | reflective call | reflection.js:7:20:7:21 | 19 | +| reflection.js:8:1:8:25 | add.app ... 3, 19]) | reflection.js:8:17:8:24 | [23, 19] | +| tst.js:22:1:22:4 | l(k) | tst.js:22:3:22:3 | k | +| tst.js:42:2:42:29 | functio ... x; }(o) | tst.js:42:28:42:28 | o | +test_getAnArgument +| classes.js:4:7:4:26 | console.log("Hello") | classes.js:4:19:4:25 | "Hello" | +| classes.js:14:7:14:27 | console ... ello!") | classes.js:14:19:14:26 | "Hello!" | +| es2015.js:3:5:3:21 | console.log("hi") | es2015.js:3:17:3:20 | "hi" | +| es2015.js:27:5:27:23 | console.log(this.x) | es2015.js:27:17:27:22 | this.x | +| es2015.js:35:1:35:17 | sum(1, ...[2, 3]) | es2015.js:35:5:35:5 | 1 | +| es2015.js:36:1:36:17 | sum(1, ...[2], 3) | es2015.js:36:5:36:5 | 1 | +| es2015.js:36:1:36:17 | sum(1, ...[2], 3) | es2015.js:36:16:36:16 | 3 | +| n.js:1:9:1:22 | require('./m') | n.js:1:17:1:21 | './m' | +| n.js:4:10:4:24 | require('./m2') | n.js:4:18:4:23 | './m2' | +| reflection.js:7:1:7:22 | add.cal ... 23, 19) | reflection.js:7:10:7:13 | null | +| reflection.js:7:1:7:22 | add.cal ... 23, 19) | reflection.js:7:16:7:17 | 23 | +| reflection.js:7:1:7:22 | add.cal ... 23, 19) | reflection.js:7:20:7:21 | 19 | +| reflection.js:7:1:7:22 | reflective call | reflection.js:7:16:7:17 | 23 | +| reflection.js:7:1:7:22 | reflective call | reflection.js:7:20:7:21 | 19 | +| reflection.js:8:1:8:25 | add.app ... 3, 19]) | reflection.js:8:11:8:14 | null | +| reflection.js:8:1:8:25 | add.app ... 3, 19]) | reflection.js:8:17:8:24 | [23, 19] | +| tst.js:22:1:22:4 | l(k) | tst.js:22:3:22:3 | k | +| tst.js:42:2:42:29 | functio ... x; }(o) | tst.js:42:28:42:28 | o | +test_getACallee +| a.js:2:1:2:5 | foo() | b.js:1:16:1:27 | function(){} | +| a.js:3:1:3:5 | bar() | b.js:2:8:2:24 | function bar() {} | +| a.js:4:1:4:5 | qux() | c.js:2:8:2:24 | function bar() {} | +| classes.js:8:7:8:18 | this.hello() | classes.js:3:10:5:5 | () {\\n ... ;\\n } | +| classes.js:12:21:12:20 | super(...args) | classes.js:2:11:2:10 | () {} | +| classes.js:18:3:18:9 | new B() | classes.js:12:21:12:20 | (...arg ... rgs); } | +| classes.js:18:3:18:17 | new B().hello() | classes.js:13:10:15:5 | () {\\n ... ;\\n } | +| es2015.js:6:1:6:18 | new ExampleClass() | es2015.js:2:14:4:3 | () {\\n ... ");\\n } | +| es2015.js:10:5:10:22 | arguments.callee() | es2015.js:8:2:12:1 | functio ... \\n };\\n} | +| es2015.js:16:5:16:11 | super() | es2015.js:2:14:4:3 | () {\\n ... ");\\n } | +| es2015.js:26:5:26:11 | super() | es2015.js:20:1:22:1 | functio ... = 42;\\n} | +| es2015.js:34:1:34:17 | sum(...[1, 2, 3]) | es2015.js:31:1:33:1 | functio ... +y+z;\\n} | +| es2015.js:35:1:35:17 | sum(1, ...[2, 3]) | es2015.js:31:1:33:1 | functio ... +y+z;\\n} | +| es2015.js:36:1:36:17 | sum(1, ...[2], 3) | es2015.js:31:1:33:1 | functio ... +y+z;\\n} | +| m.js:2:1:2:11 | exports.f() | m.js:1:13:1:25 | function() {} | +| m.js:3:1:3:18 | module.exports.f() | m.js:1:13:1:25 | function() {} | +| n.js:2:1:2:5 | m.f() | m.js:1:13:1:25 | function() {} | +| n.js:5:1:5:6 | m2.f() | m2.js:2:6:2:18 | function() {} | +| reflection.js:7:1:7:22 | reflective call | reflection.js:1:1:3:1 | functio ... x+y;\\n} | +| reflection.js:8:1:8:25 | add.app ... 3, 19]) | reflection.js:5:15:5:39 | functio ... n 56; } | +| reflection.js:8:1:8:25 | reflective call | reflection.js:1:1:3:1 | functio ... x+y;\\n} | +| tst.js:6:1:6:3 | f() | tst.js:1:1:1:15 | function f() {} | +| tst.js:7:1:7:3 | g() | tst.js:2:9:2:21 | function() {} | +| tst.js:8:1:8:3 | h() | tst.js:3:5:3:17 | function() {} | +| tst.js:9:1:9:3 | k() | tst.js:2:9:2:21 | function() {} | +| tst.js:15:2:15:4 | l() | tst.js:11:1:20:1 | functio ... \\tf();\\n} | +| tst.js:16:2:16:19 | arguments.callee() | tst.js:11:1:20:1 | functio ... \\tf();\\n} | +| tst.js:17:2:17:4 | n() | tst.js:12:15:12:27 | function() {} | +| tst.js:18:2:18:4 | p() | tst.js:13:2:13:16 | function p() {} | +| tst.js:19:2:19:4 | f() | tst.js:1:1:1:15 | function f() {} | +| tst.js:22:1:22:4 | l(k) | tst.js:11:1:20:1 | functio ... \\tf();\\n} | +| tst.js:24:1:24:7 | new f() | tst.js:1:1:1:15 | function f() {} | +| tst.js:25:1:25:5 | new g | tst.js:2:9:2:21 | function() {} | +| tst.js:27:1:27:16 | (function(){})() | tst.js:27:2:27:13 | function(){} | +| tst.js:28:2:28:15 | function(){}() | tst.js:28:2:28:13 | function(){} | +| tst.js:33:4:33:11 | this.g() | tst.js:35:6:35:18 | function() {} | +| tst.js:41:1:41:5 | o.f() | tst.js:32:6:34:3 | functio ... ();\\n\\t\\t} | +| tst.js:42:1:42:34 | (functi ... o)).f() | tst.js:32:6:34:3 | functio ... ();\\n\\t\\t} | +| tst.js:42:2:42:29 | functio ... x; }(o) | tst.js:42:2:42:26 | functio ... rn x; } | +| tst.js:46:2:46:9 | this.g() | tst.js:48:17:48:29 | function() {} | +| tst.js:46:2:46:9 | this.g() | tst.js:61:17:61:29 | function() {} | +| tst.js:53:3:53:10 | this.g() | tst.js:56:39:56:51 | function() {} | +| tst.js:53:3:53:10 | this.g() | tst.js:57:39:57:51 | function() {} | +| tst.js:60:15:60:21 | new A() | tst.js:44:1:44:15 | function A() {} | +| tst.js:64:13:64:19 | new B() | tst.js:50:1:50:15 | function B() {} | +| tst.js:66:5:66:9 | b.f() | tst.js:65:11:65:23 | function() {} | +| tst.js:69:1:69:10 | globalfn() | tst3.js:1:1:1:22 | functio ... fn() {} | +| tst.js:70:1:70:11 | globalfn2() | tst3.js:2:1:2:23 | functio ... n2() {} | +test_getCalleeName +| a.js:2:1:2:5 | foo() | foo | +| a.js:3:1:3:5 | bar() | bar | +| a.js:4:1:4:5 | qux() | qux | +| a.js:7:1:7:5 | baz() | baz | +| classes.js:4:7:4:26 | console.log("Hello") | log | +| classes.js:8:7:8:18 | this.hello() | hello | +| classes.js:14:7:14:27 | console ... ello!") | log | +| classes.js:18:3:18:9 | new B() | B | +| classes.js:18:3:18:17 | new B().hello() | hello | +| es2015.js:3:5:3:21 | console.log("hi") | log | +| es2015.js:6:1:6:18 | new ExampleClass() | ExampleClass | +| es2015.js:10:5:10:22 | arguments.callee() | callee | +| es2015.js:27:5:27:23 | console.log(this.x) | log | +| es2015.js:34:1:34:17 | sum(...[1, 2, 3]) | sum | +| es2015.js:35:1:35:17 | sum(1, ...[2, 3]) | sum | +| es2015.js:36:1:36:17 | sum(1, ...[2], 3) | sum | +| m.js:2:1:2:11 | exports.f() | f | +| m.js:3:1:3:18 | module.exports.f() | f | +| n.js:1:9:1:22 | require('./m') | require | +| n.js:2:1:2:5 | m.f() | f | +| n.js:4:10:4:24 | require('./m2') | require | +| n.js:5:1:5:6 | m2.f() | f | +| reflection.js:4:5:4:12 | sneaky() | sneaky | +| reflection.js:7:1:7:22 | add.cal ... 23, 19) | call | +| reflection.js:8:1:8:25 | add.app ... 3, 19]) | apply | +| tst.js:6:1:6:3 | f() | f | +| tst.js:7:1:7:3 | g() | g | +| tst.js:8:1:8:3 | h() | h | +| tst.js:9:1:9:3 | k() | k | +| tst.js:14:2:14:4 | m() | m | +| tst.js:15:2:15:4 | l() | l | +| tst.js:16:2:16:19 | arguments.callee() | callee | +| tst.js:17:2:17:4 | n() | n | +| tst.js:18:2:18:4 | p() | p | +| tst.js:19:2:19:4 | f() | f | +| tst.js:22:1:22:4 | l(k) | l | +| tst.js:24:1:24:7 | new f() | f | +| tst.js:25:1:25:5 | new g | g | +| tst.js:33:4:33:11 | this.g() | g | +| tst.js:41:1:41:5 | o.f() | f | +| tst.js:42:1:42:34 | (functi ... o)).f() | f | +| tst.js:46:2:46:9 | this.g() | g | +| tst.js:53:3:53:10 | this.g() | g | +| tst.js:56:17:56:29 | Math.random() | random | +| tst.js:60:15:60:21 | new A() | A | +| tst.js:64:13:64:19 | new B() | B | +| tst.js:66:5:66:9 | b.f() | f | +| tst.js:69:1:69:10 | globalfn() | globalfn | +| tst.js:70:1:70:11 | globalfn2() | globalfn2 | +test_isImprecise +| tst.js:69:1:69:10 | globalfn() | diff --git a/javascript/ql/test/library-tests/CallGraphs/tests.ql b/javascript/ql/test/library-tests/CallGraphs/tests.ql new file mode 100644 index 000000000000..38e42300a10c --- /dev/null +++ b/javascript/ql/test/library-tests/CallGraphs/tests.ql @@ -0,0 +1,11 @@ +import isUncertain +import getAFunctionValue +import getArgument +import getNumArgument +import isIncomplete +import getCalleeNode +import getLastArgument +import getAnArgument +import getACallee +import getCalleeName +import isImprecise diff --git a/javascript/ql/test/library-tests/Classes/AccessorMethods.expected b/javascript/ql/test/library-tests/Classes/AccessorMethods.expected deleted file mode 100644 index 79c67d31ac5c..000000000000 --- a/javascript/ql/test/library-tests/Classes/AccessorMethods.expected +++ /dev/null @@ -1 +0,0 @@ -| points.js:7:3:9:3 | get dis ... y);\\n } | diff --git a/javascript/ql/test/library-tests/Classes/AccessorMethods.ql b/javascript/ql/test/library-tests/Classes/AccessorMethods.ql deleted file mode 100644 index 2e68ed4e1314..000000000000 --- a/javascript/ql/test/library-tests/Classes/AccessorMethods.ql +++ /dev/null @@ -1,4 +0,0 @@ -import javascript - -from AccessorMethodDefinition amd -select amd diff --git a/javascript/ql/test/library-tests/Classes/AccessorMethods.qll b/javascript/ql/test/library-tests/Classes/AccessorMethods.qll new file mode 100644 index 000000000000..32dca6cabc8d --- /dev/null +++ b/javascript/ql/test/library-tests/Classes/AccessorMethods.qll @@ -0,0 +1,3 @@ +import javascript + +query predicate test_AccessorMethods(AccessorMethodDefinition amd) { any() } diff --git a/javascript/ql/test/library-tests/Classes/ClassDefinition_getName.expected b/javascript/ql/test/library-tests/Classes/ClassDefinition_getName.expected deleted file mode 100644 index 2e14daf32343..000000000000 --- a/javascript/ql/test/library-tests/Classes/ClassDefinition_getName.expected +++ /dev/null @@ -1,6 +0,0 @@ -| fields.js:1:1:4:1 | class C ... = 42\\n} | C | -| points.js:1:1:18:1 | class P ... ;\\n }\\n} | Point | -| points.js:20:1:33:1 | class C ... ;\\n }\\n} | ColouredPoint | -| staticConstructor.js:1:1:3:1 | class M ... r"; }\\n} | MyClass | -| tst.js:6:1:8:1 | class B ... t); }\\n} | B | -| tst.js:11:1:14:1 | class C ... () {}\\n} | C | diff --git a/javascript/ql/test/library-tests/Classes/ClassDefinition_getName.ql b/javascript/ql/test/library-tests/Classes/ClassDefinition_getName.ql deleted file mode 100644 index 11e4c8d64c99..000000000000 --- a/javascript/ql/test/library-tests/Classes/ClassDefinition_getName.ql +++ /dev/null @@ -1,4 +0,0 @@ -import javascript - -from ClassDefinition cd -select cd, cd.getName() diff --git a/javascript/ql/test/library-tests/Classes/ClassDefinition_getName.qll b/javascript/ql/test/library-tests/Classes/ClassDefinition_getName.qll new file mode 100644 index 000000000000..0eb8bec773c5 --- /dev/null +++ b/javascript/ql/test/library-tests/Classes/ClassDefinition_getName.qll @@ -0,0 +1,3 @@ +import javascript + +query predicate test_ClassDefinition_getName(ClassDefinition cd, string res) { res = cd.getName() } diff --git a/javascript/ql/test/library-tests/Classes/ClassDefinition_getSuperClass.expected b/javascript/ql/test/library-tests/Classes/ClassDefinition_getSuperClass.expected deleted file mode 100644 index 2a908e6dbf02..000000000000 --- a/javascript/ql/test/library-tests/Classes/ClassDefinition_getSuperClass.expected +++ /dev/null @@ -1,2 +0,0 @@ -| points.js:20:1:33:1 | class C ... ;\\n }\\n} | points.js:20:29:20:33 | Point | -| tst.js:6:1:8:1 | class B ... t); }\\n} | tst.js:6:17:6:17 | A | diff --git a/javascript/ql/test/library-tests/Classes/ClassDefinition_getSuperClass.ql b/javascript/ql/test/library-tests/Classes/ClassDefinition_getSuperClass.ql deleted file mode 100644 index b5f854597b85..000000000000 --- a/javascript/ql/test/library-tests/Classes/ClassDefinition_getSuperClass.ql +++ /dev/null @@ -1,4 +0,0 @@ -import javascript - -from ClassDefinition cd -select cd, cd.getSuperClass() diff --git a/javascript/ql/test/library-tests/Classes/ClassDefinition_getSuperClass.qll b/javascript/ql/test/library-tests/Classes/ClassDefinition_getSuperClass.qll new file mode 100644 index 000000000000..30bf54a496af --- /dev/null +++ b/javascript/ql/test/library-tests/Classes/ClassDefinition_getSuperClass.qll @@ -0,0 +1,5 @@ +import javascript + +query predicate test_ClassDefinition_getSuperClass(ClassDefinition cd, Expr res) { + res = cd.getSuperClass() +} diff --git a/javascript/ql/test/library-tests/Classes/ClassDefinitions.expected b/javascript/ql/test/library-tests/Classes/ClassDefinitions.expected deleted file mode 100644 index bae7f8ec8da8..000000000000 --- a/javascript/ql/test/library-tests/Classes/ClassDefinitions.expected +++ /dev/null @@ -1,7 +0,0 @@ -| fields.js:1:1:4:1 | class C ... = 42\\n} | -| points.js:1:1:18:1 | class P ... ;\\n }\\n} | -| points.js:20:1:33:1 | class C ... ;\\n }\\n} | -| staticConstructor.js:1:1:3:1 | class M ... r"; }\\n} | -| tst.js:1:9:4:1 | class { ... */ }\\n} | -| tst.js:6:1:8:1 | class B ... t); }\\n} | -| tst.js:11:1:14:1 | class C ... () {}\\n} | diff --git a/javascript/ql/test/library-tests/Classes/ClassDefinitions.ql b/javascript/ql/test/library-tests/Classes/ClassDefinitions.ql deleted file mode 100644 index c405a0bd048d..000000000000 --- a/javascript/ql/test/library-tests/Classes/ClassDefinitions.ql +++ /dev/null @@ -1,4 +0,0 @@ -import javascript - -from ClassDefinition cd -select cd diff --git a/javascript/ql/test/library-tests/Classes/ClassDefinitions.qll b/javascript/ql/test/library-tests/Classes/ClassDefinitions.qll new file mode 100644 index 000000000000..94150fd65a1e --- /dev/null +++ b/javascript/ql/test/library-tests/Classes/ClassDefinitions.qll @@ -0,0 +1,3 @@ +import javascript + +query predicate test_ClassDefinitions(ClassDefinition cd) { any() } diff --git a/javascript/ql/test/library-tests/Classes/ClassNodeConstructor.expected b/javascript/ql/test/library-tests/Classes/ClassNodeConstructor.expected deleted file mode 100644 index d850dfce0f1c..000000000000 --- a/javascript/ql/test/library-tests/Classes/ClassNodeConstructor.expected +++ /dev/null @@ -1,7 +0,0 @@ -| fields.js:1:1:4:1 | class C ... = 42\\n} | fields.js:1:9:1:8 | () {} | -| points.js:1:1:18:1 | class P ... ;\\n }\\n} | points.js:2:14:5:3 | (x, y) ... y;\\n } | -| points.js:20:1:33:1 | class C ... ;\\n }\\n} | points.js:21:14:24:3 | (x, y, ... c;\\n } | -| staticConstructor.js:1:1:3:1 | class M ... r"; }\\n} | staticConstructor.js:1:15:1:14 | () {} | -| tst.js:1:9:4:1 | class { ... */ }\\n} | tst.js:2:16:2:50 | () { /* ... r. */ } | -| tst.js:6:1:8:1 | class B ... t); }\\n} | tst.js:7:14:7:38 | () { su ... get); } | -| tst.js:11:1:14:1 | class C ... () {}\\n} | tst.js:11:9:11:8 | () {} | diff --git a/javascript/ql/test/library-tests/Classes/ClassNodeConstructor.ql b/javascript/ql/test/library-tests/Classes/ClassNodeConstructor.ql deleted file mode 100644 index cba12e5f3daf..000000000000 --- a/javascript/ql/test/library-tests/Classes/ClassNodeConstructor.ql +++ /dev/null @@ -1,4 +0,0 @@ -import javascript - -from DataFlow::ClassNode class_ -select class_, class_.getConstructor() diff --git a/javascript/ql/test/library-tests/Classes/ClassNodeConstructor.qll b/javascript/ql/test/library-tests/Classes/ClassNodeConstructor.qll new file mode 100644 index 000000000000..da1abf434c93 --- /dev/null +++ b/javascript/ql/test/library-tests/Classes/ClassNodeConstructor.qll @@ -0,0 +1,5 @@ +import javascript + +query predicate test_ClassNodeConstructor(DataFlow::ClassNode class_, DataFlow::FunctionNode res) { + res = class_.getConstructor() +} diff --git a/javascript/ql/test/library-tests/Classes/ClassNodeInstanceMethod.expected b/javascript/ql/test/library-tests/Classes/ClassNodeInstanceMethod.expected deleted file mode 100644 index aa6a3a2e3cf1..000000000000 --- a/javascript/ql/test/library-tests/Classes/ClassNodeInstanceMethod.expected +++ /dev/null @@ -1,4 +0,0 @@ -| points.js:1:1:18:1 | class P ... ;\\n }\\n} | toString | points.js:11:11:13:3 | () {\\n ... )";\\n } | -| points.js:20:1:33:1 | class C ... ;\\n }\\n} | toString | points.js:26:11:28:3 | () {\\n ... ur;\\n } | -| tst.js:1:9:4:1 | class { ... */ }\\n} | constructor | tst.js:3:18:3:56 | () { /* ... r. */ } | -| tst.js:11:1:14:1 | class C ... () {}\\n} | m | tst.js:12:4:12:8 | () {} | diff --git a/javascript/ql/test/library-tests/Classes/ClassNodeInstanceMethod.ql b/javascript/ql/test/library-tests/Classes/ClassNodeInstanceMethod.ql deleted file mode 100644 index dd64123052cc..000000000000 --- a/javascript/ql/test/library-tests/Classes/ClassNodeInstanceMethod.ql +++ /dev/null @@ -1,4 +0,0 @@ -import javascript - -from DataFlow::ClassNode class_, string name -select class_, name, class_.getInstanceMethod(name) diff --git a/javascript/ql/test/library-tests/Classes/ClassNodeInstanceMethod.qll b/javascript/ql/test/library-tests/Classes/ClassNodeInstanceMethod.qll new file mode 100644 index 000000000000..a631a7b11682 --- /dev/null +++ b/javascript/ql/test/library-tests/Classes/ClassNodeInstanceMethod.qll @@ -0,0 +1,7 @@ +import javascript + +query predicate test_ClassNodeInstanceMethod( + DataFlow::ClassNode class_, string name, DataFlow::FunctionNode res +) { + res = class_.getInstanceMethod(name) +} diff --git a/javascript/ql/test/library-tests/Classes/ClassNodeStaticMethod.expected b/javascript/ql/test/library-tests/Classes/ClassNodeStaticMethod.expected deleted file mode 100644 index b2e46468dce6..000000000000 --- a/javascript/ql/test/library-tests/Classes/ClassNodeStaticMethod.expected +++ /dev/null @@ -1,3 +0,0 @@ -| points.js:1:1:18:1 | class P ... ;\\n }\\n} | className | points.js:15:19:17:3 | () {\\n ... t";\\n } | -| points.js:20:1:33:1 | class C ... ;\\n }\\n} | className | points.js:30:19:32:3 | () {\\n ... t";\\n } | -| staticConstructor.js:1:1:3:1 | class M ... r"; }\\n} | constructor | staticConstructor.js:2:21:2:59 | () { re ... tor"; } | diff --git a/javascript/ql/test/library-tests/Classes/ClassNodeStaticMethod.ql b/javascript/ql/test/library-tests/Classes/ClassNodeStaticMethod.ql deleted file mode 100644 index f3b63ba69ea6..000000000000 --- a/javascript/ql/test/library-tests/Classes/ClassNodeStaticMethod.ql +++ /dev/null @@ -1,4 +0,0 @@ -import javascript - -from DataFlow::ClassNode class_, string name -select class_, name, class_.getStaticMethod(name) diff --git a/javascript/ql/test/library-tests/Classes/ClassNodeStaticMethod.qll b/javascript/ql/test/library-tests/Classes/ClassNodeStaticMethod.qll new file mode 100644 index 000000000000..d2070cbd2cfd --- /dev/null +++ b/javascript/ql/test/library-tests/Classes/ClassNodeStaticMethod.qll @@ -0,0 +1,5 @@ +import javascript + +query predicate test_ClassNodeStaticMethod(DataFlow::ClassNode class_, string name, DataFlow::FunctionNode res) { + res = class_.getStaticMethod(name) +} diff --git a/javascript/ql/test/library-tests/Classes/ComputedMethods.expected b/javascript/ql/test/library-tests/Classes/ComputedMethods.expected deleted file mode 100644 index 398d02977907..000000000000 --- a/javascript/ql/test/library-tests/Classes/ComputedMethods.expected +++ /dev/null @@ -1,2 +0,0 @@ -| tst.js:3:3:3:56 | ["const ... r. */ } | -| tst.js:13:3:13:10 | [m]() {} | diff --git a/javascript/ql/test/library-tests/Classes/ComputedMethods.ql b/javascript/ql/test/library-tests/Classes/ComputedMethods.ql deleted file mode 100644 index 56a029654f88..000000000000 --- a/javascript/ql/test/library-tests/Classes/ComputedMethods.ql +++ /dev/null @@ -1,5 +0,0 @@ -import javascript - -from MethodDefinition md -where md.isComputed() -select md diff --git a/javascript/ql/test/library-tests/Classes/ComputedMethods.qll b/javascript/ql/test/library-tests/Classes/ComputedMethods.qll new file mode 100644 index 000000000000..190879037660 --- /dev/null +++ b/javascript/ql/test/library-tests/Classes/ComputedMethods.qll @@ -0,0 +1,3 @@ +import javascript + +query predicate test_ComputedMethods(MethodDefinition md) { md.isComputed() } diff --git a/javascript/ql/test/library-tests/Classes/ConstructorDefinitions.expected b/javascript/ql/test/library-tests/Classes/ConstructorDefinitions.expected deleted file mode 100644 index 46285fc0a03e..000000000000 --- a/javascript/ql/test/library-tests/Classes/ConstructorDefinitions.expected +++ /dev/null @@ -1,7 +0,0 @@ -| fields.js:1:9:1:8 | constructor() {} | -| points.js:2:3:5:3 | constru ... y;\\n } | -| points.js:21:3:24:3 | constru ... c;\\n } | -| staticConstructor.js:1:15:1:14 | constructor() {} | -| tst.js:2:3:2:50 | "constr ... r. */ } | -| tst.js:7:3:7:38 | constru ... get); } | -| tst.js:11:9:11:8 | constructor() {} | diff --git a/javascript/ql/test/library-tests/Classes/ConstructorDefinitions.ql b/javascript/ql/test/library-tests/Classes/ConstructorDefinitions.ql deleted file mode 100644 index 5dd6eb38f388..000000000000 --- a/javascript/ql/test/library-tests/Classes/ConstructorDefinitions.ql +++ /dev/null @@ -1,4 +0,0 @@ -import javascript - -from ConstructorDefinition cd -select cd diff --git a/javascript/ql/test/library-tests/Classes/ConstructorDefinitions.qll b/javascript/ql/test/library-tests/Classes/ConstructorDefinitions.qll new file mode 100644 index 000000000000..e4478cee98e2 --- /dev/null +++ b/javascript/ql/test/library-tests/Classes/ConstructorDefinitions.qll @@ -0,0 +1,3 @@ +import javascript + +query predicate test_ConstructorDefinitions(ConstructorDefinition cd) { any() } diff --git a/javascript/ql/test/library-tests/Classes/FieldInits.expected b/javascript/ql/test/library-tests/Classes/FieldInits.expected deleted file mode 100644 index a74056b9ef21..000000000000 --- a/javascript/ql/test/library-tests/Classes/FieldInits.expected +++ /dev/null @@ -1 +0,0 @@ -| fields.js:3:3:3:8 | y = 42 | fields.js:3:7:3:8 | 42 | diff --git a/javascript/ql/test/library-tests/Classes/FieldInits.ql b/javascript/ql/test/library-tests/Classes/FieldInits.ql deleted file mode 100644 index 3c37505ffc75..000000000000 --- a/javascript/ql/test/library-tests/Classes/FieldInits.ql +++ /dev/null @@ -1,4 +0,0 @@ -import javascript - -from FieldDefinition field -select field, field.getInit() diff --git a/javascript/ql/test/library-tests/Classes/FieldInits.qll b/javascript/ql/test/library-tests/Classes/FieldInits.qll new file mode 100644 index 000000000000..5ea976652073 --- /dev/null +++ b/javascript/ql/test/library-tests/Classes/FieldInits.qll @@ -0,0 +1,3 @@ +import javascript + +query predicate test_FieldInits(FieldDefinition field, Expr res) { res = field.getInit() } diff --git a/javascript/ql/test/library-tests/Classes/Fields.expected b/javascript/ql/test/library-tests/Classes/Fields.expected deleted file mode 100644 index e4e739fe831e..000000000000 --- a/javascript/ql/test/library-tests/Classes/Fields.expected +++ /dev/null @@ -1,2 +0,0 @@ -| fields.js:2:3:2:4 | x; | fields.js:2:3:2:3 | x | -| fields.js:3:3:3:8 | y = 42 | fields.js:3:3:3:3 | y | diff --git a/javascript/ql/test/library-tests/Classes/Fields.ql b/javascript/ql/test/library-tests/Classes/Fields.ql deleted file mode 100644 index c5de2f963c8b..000000000000 --- a/javascript/ql/test/library-tests/Classes/Fields.ql +++ /dev/null @@ -1,4 +0,0 @@ -import javascript - -from FieldDefinition field -select field, field.getNameExpr() diff --git a/javascript/ql/test/library-tests/Classes/Fields.qll b/javascript/ql/test/library-tests/Classes/Fields.qll new file mode 100644 index 000000000000..fcb73440a49f --- /dev/null +++ b/javascript/ql/test/library-tests/Classes/Fields.qll @@ -0,0 +1,3 @@ +import javascript + +query predicate test_Fields(FieldDefinition field, Expr res) { res = field.getNameExpr() } diff --git a/javascript/ql/test/library-tests/Classes/MethodDefinitions.expected b/javascript/ql/test/library-tests/Classes/MethodDefinitions.expected deleted file mode 100644 index ab366544b115..000000000000 --- a/javascript/ql/test/library-tests/Classes/MethodDefinitions.expected +++ /dev/null @@ -1,16 +0,0 @@ -| fields.js:1:9:1:8 | constructor() {} | fields.js:1:9:1:8 | constructor | fields.js:1:9:1:8 | () {} | fields.js:1:1:4:1 | class C ... = 42\\n} | -| points.js:2:3:5:3 | constru ... y;\\n } | points.js:2:3:2:13 | constructor | points.js:2:14:5:3 | (x, y) ... y;\\n } | points.js:1:1:18:1 | class P ... ;\\n }\\n} | -| points.js:7:3:9:3 | get dis ... y);\\n } | points.js:7:7:7:10 | dist | points.js:7:11:9:3 | () {\\n ... y);\\n } | points.js:1:1:18:1 | class P ... ;\\n }\\n} | -| points.js:11:3:13:3 | toStrin ... )";\\n } | points.js:11:3:11:10 | toString | points.js:11:11:13:3 | () {\\n ... )";\\n } | points.js:1:1:18:1 | class P ... ;\\n }\\n} | -| points.js:15:3:17:3 | static ... t";\\n } | points.js:15:10:15:18 | className | points.js:15:19:17:3 | () {\\n ... t";\\n } | points.js:1:1:18:1 | class P ... ;\\n }\\n} | -| points.js:21:3:24:3 | constru ... c;\\n } | points.js:21:3:21:13 | constructor | points.js:21:14:24:3 | (x, y, ... c;\\n } | points.js:20:1:33:1 | class C ... ;\\n }\\n} | -| points.js:26:3:28:3 | toStrin ... ur;\\n } | points.js:26:3:26:10 | toString | points.js:26:11:28:3 | () {\\n ... ur;\\n } | points.js:20:1:33:1 | class C ... ;\\n }\\n} | -| points.js:30:3:32:3 | static ... t";\\n } | points.js:30:10:30:18 | className | points.js:30:19:32:3 | () {\\n ... t";\\n } | points.js:20:1:33:1 | class C ... ;\\n }\\n} | -| staticConstructor.js:1:15:1:14 | constructor() {} | staticConstructor.js:1:15:1:14 | constructor | staticConstructor.js:1:15:1:14 | () {} | staticConstructor.js:1:1:3:1 | class M ... r"; }\\n} | -| staticConstructor.js:2:3:2:59 | static ... tor"; } | staticConstructor.js:2:10:2:20 | constructor | staticConstructor.js:2:21:2:59 | () { re ... tor"; } | staticConstructor.js:1:1:3:1 | class M ... r"; }\\n} | -| tst.js:2:3:2:50 | "constr ... r. */ } | tst.js:2:3:2:15 | "constructor" | tst.js:2:16:2:50 | () { /* ... r. */ } | tst.js:1:9:4:1 | class { ... */ }\\n} | -| tst.js:3:3:3:56 | ["const ... r. */ } | tst.js:3:4:3:16 | "constructor" | tst.js:3:18:3:56 | () { /* ... r. */ } | tst.js:1:9:4:1 | class { ... */ }\\n} | -| tst.js:7:3:7:38 | constru ... get); } | tst.js:7:3:7:13 | constructor | tst.js:7:14:7:38 | () { su ... get); } | tst.js:6:1:8:1 | class B ... t); }\\n} | -| tst.js:11:9:11:8 | constructor() {} | tst.js:11:9:11:8 | constructor | tst.js:11:9:11:8 | () {} | tst.js:11:1:14:1 | class C ... () {}\\n} | -| tst.js:12:3:12:8 | m() {} | tst.js:12:3:12:3 | m | tst.js:12:4:12:8 | () {} | tst.js:11:1:14:1 | class C ... () {}\\n} | -| tst.js:13:3:13:10 | [m]() {} | tst.js:13:4:13:4 | m | tst.js:13:6:13:10 | () {} | tst.js:11:1:14:1 | class C ... () {}\\n} | diff --git a/javascript/ql/test/library-tests/Classes/MethodDefinitions.ql b/javascript/ql/test/library-tests/Classes/MethodDefinitions.ql deleted file mode 100644 index ea2afd6ce555..000000000000 --- a/javascript/ql/test/library-tests/Classes/MethodDefinitions.ql +++ /dev/null @@ -1,4 +0,0 @@ -import javascript - -from MethodDefinition md -select md, md.getNameExpr(), md.getBody(), md.getDeclaringClass() diff --git a/javascript/ql/test/library-tests/Classes/MethodDefinitions.qll b/javascript/ql/test/library-tests/Classes/MethodDefinitions.qll new file mode 100644 index 000000000000..89a93217160a --- /dev/null +++ b/javascript/ql/test/library-tests/Classes/MethodDefinitions.qll @@ -0,0 +1,7 @@ +import javascript + +query predicate test_MethodDefinitions( + MethodDefinition md, Expr res0, FunctionExpr res1, ClassDefinition res2 +) { + res0 = md.getNameExpr() and res1 = md.getBody() and res2 = md.getDeclaringClass() +} diff --git a/javascript/ql/test/library-tests/Classes/MethodNames.expected b/javascript/ql/test/library-tests/Classes/MethodNames.expected deleted file mode 100644 index fc618c3134bb..000000000000 --- a/javascript/ql/test/library-tests/Classes/MethodNames.expected +++ /dev/null @@ -1,15 +0,0 @@ -| fields.js:1:9:1:8 | constructor() {} | constructor | -| points.js:2:3:5:3 | constru ... y;\\n } | constructor | -| points.js:7:3:9:3 | get dis ... y);\\n } | dist | -| points.js:11:3:13:3 | toStrin ... )";\\n } | toString | -| points.js:15:3:17:3 | static ... t";\\n } | className | -| points.js:21:3:24:3 | constru ... c;\\n } | constructor | -| points.js:26:3:28:3 | toStrin ... ur;\\n } | toString | -| points.js:30:3:32:3 | static ... t";\\n } | className | -| staticConstructor.js:1:15:1:14 | constructor() {} | constructor | -| staticConstructor.js:2:3:2:59 | static ... tor"; } | constructor | -| tst.js:2:3:2:50 | "constr ... r. */ } | constructor | -| tst.js:3:3:3:56 | ["const ... r. */ } | constructor | -| tst.js:7:3:7:38 | constru ... get); } | constructor | -| tst.js:11:9:11:8 | constructor() {} | constructor | -| tst.js:12:3:12:8 | m() {} | m | diff --git a/javascript/ql/test/library-tests/Classes/MethodNames.ql b/javascript/ql/test/library-tests/Classes/MethodNames.ql deleted file mode 100644 index 95838f97c3bf..000000000000 --- a/javascript/ql/test/library-tests/Classes/MethodNames.ql +++ /dev/null @@ -1,4 +0,0 @@ -import javascript - -from MethodDefinition md -select md, md.getName() diff --git a/javascript/ql/test/library-tests/Classes/MethodNames.qll b/javascript/ql/test/library-tests/Classes/MethodNames.qll new file mode 100644 index 000000000000..d956696ac714 --- /dev/null +++ b/javascript/ql/test/library-tests/Classes/MethodNames.qll @@ -0,0 +1,3 @@ +import javascript + +query predicate test_MethodNames(MethodDefinition md, string res) { res = md.getName() } diff --git a/javascript/ql/test/library-tests/Classes/NewTargetExpr.expected b/javascript/ql/test/library-tests/Classes/NewTargetExpr.expected deleted file mode 100644 index 42f20d6cb803..000000000000 --- a/javascript/ql/test/library-tests/Classes/NewTargetExpr.expected +++ /dev/null @@ -1 +0,0 @@ -| tst.js:7:25:7:34 | new.target | diff --git a/javascript/ql/test/library-tests/Classes/NewTargetExpr.ql b/javascript/ql/test/library-tests/Classes/NewTargetExpr.ql deleted file mode 100644 index bddb459e7a93..000000000000 --- a/javascript/ql/test/library-tests/Classes/NewTargetExpr.ql +++ /dev/null @@ -1,4 +0,0 @@ -import javascript - -from NewTargetExpr e -select e diff --git a/javascript/ql/test/library-tests/Classes/NewTargetExpr.qll b/javascript/ql/test/library-tests/Classes/NewTargetExpr.qll new file mode 100644 index 000000000000..ea35cb80d110 --- /dev/null +++ b/javascript/ql/test/library-tests/Classes/NewTargetExpr.qll @@ -0,0 +1,3 @@ +import javascript + +query predicate test_NewTargetExpr(NewTargetExpr e) { any() } diff --git a/javascript/ql/test/library-tests/Classes/StaticMethods.expected b/javascript/ql/test/library-tests/Classes/StaticMethods.expected deleted file mode 100644 index af0fbaac8cce..000000000000 --- a/javascript/ql/test/library-tests/Classes/StaticMethods.expected +++ /dev/null @@ -1,3 +0,0 @@ -| points.js:15:3:17:3 | static ... t";\\n } | -| points.js:30:3:32:3 | static ... t";\\n } | -| staticConstructor.js:2:3:2:59 | static ... tor"; } | diff --git a/javascript/ql/test/library-tests/Classes/StaticMethods.ql b/javascript/ql/test/library-tests/Classes/StaticMethods.ql deleted file mode 100644 index 460e60bde70c..000000000000 --- a/javascript/ql/test/library-tests/Classes/StaticMethods.ql +++ /dev/null @@ -1,5 +0,0 @@ -import javascript - -from MethodDefinition md -where md.isStatic() -select md diff --git a/javascript/ql/test/library-tests/Classes/StaticMethods.qll b/javascript/ql/test/library-tests/Classes/StaticMethods.qll new file mode 100644 index 000000000000..ba0f01f54d77 --- /dev/null +++ b/javascript/ql/test/library-tests/Classes/StaticMethods.qll @@ -0,0 +1,3 @@ +import javascript + +query predicate test_StaticMethods(MethodDefinition md) { md.isStatic() } diff --git a/javascript/ql/test/library-tests/Classes/SuperExpr.expected b/javascript/ql/test/library-tests/Classes/SuperExpr.expected deleted file mode 100644 index cd4c05309044..000000000000 --- a/javascript/ql/test/library-tests/Classes/SuperExpr.expected +++ /dev/null @@ -1,3 +0,0 @@ -| points.js:22:5:22:9 | super | -| points.js:27:12:27:16 | super | -| tst.js:7:19:7:23 | super | diff --git a/javascript/ql/test/library-tests/Classes/SuperExpr.ql b/javascript/ql/test/library-tests/Classes/SuperExpr.ql deleted file mode 100644 index 0aa2c48771b8..000000000000 --- a/javascript/ql/test/library-tests/Classes/SuperExpr.ql +++ /dev/null @@ -1,4 +0,0 @@ -import javascript - -from SuperExpr s -select s diff --git a/javascript/ql/test/library-tests/Classes/SuperExpr.qll b/javascript/ql/test/library-tests/Classes/SuperExpr.qll new file mode 100644 index 000000000000..b5ca8b95073f --- /dev/null +++ b/javascript/ql/test/library-tests/Classes/SuperExpr.qll @@ -0,0 +1,3 @@ +import javascript + +query predicate test_SuperExpr(SuperExpr s) { any() } diff --git a/javascript/ql/test/library-tests/Classes/SyntheticConstructors.expected b/javascript/ql/test/library-tests/Classes/SyntheticConstructors.expected deleted file mode 100644 index af7eb7515cf3..000000000000 --- a/javascript/ql/test/library-tests/Classes/SyntheticConstructors.expected +++ /dev/null @@ -1,3 +0,0 @@ -| fields.js:1:9:1:8 | constructor() {} | -| staticConstructor.js:1:15:1:14 | constructor() {} | -| tst.js:11:9:11:8 | constructor() {} | diff --git a/javascript/ql/test/library-tests/Classes/SyntheticConstructors.ql b/javascript/ql/test/library-tests/Classes/SyntheticConstructors.ql deleted file mode 100644 index 5f188f861665..000000000000 --- a/javascript/ql/test/library-tests/Classes/SyntheticConstructors.ql +++ /dev/null @@ -1,5 +0,0 @@ -import javascript - -from ConstructorDefinition cd -where cd.isSynthetic() -select cd diff --git a/javascript/ql/test/library-tests/Classes/SyntheticConstructors.qll b/javascript/ql/test/library-tests/Classes/SyntheticConstructors.qll new file mode 100644 index 000000000000..2f379fe8af15 --- /dev/null +++ b/javascript/ql/test/library-tests/Classes/SyntheticConstructors.qll @@ -0,0 +1,3 @@ +import javascript + +query predicate test_SyntheticConstructors(ConstructorDefinition cd) { cd.isSynthetic() } diff --git a/javascript/ql/test/library-tests/Classes/getAMember.expected b/javascript/ql/test/library-tests/Classes/getAMember.expected deleted file mode 100644 index 24e5ed8f7544..000000000000 --- a/javascript/ql/test/library-tests/Classes/getAMember.expected +++ /dev/null @@ -1,18 +0,0 @@ -| fields.js:1:1:4:1 | class C ... = 42\\n} | fields.js:1:9:1:8 | constructor() {} | -| fields.js:1:1:4:1 | class C ... = 42\\n} | fields.js:2:3:2:4 | x; | -| fields.js:1:1:4:1 | class C ... = 42\\n} | fields.js:3:3:3:8 | y = 42 | -| points.js:1:1:18:1 | class P ... ;\\n }\\n} | points.js:2:3:5:3 | constru ... y;\\n } | -| points.js:1:1:18:1 | class P ... ;\\n }\\n} | points.js:7:3:9:3 | get dis ... y);\\n } | -| points.js:1:1:18:1 | class P ... ;\\n }\\n} | points.js:11:3:13:3 | toStrin ... )";\\n } | -| points.js:1:1:18:1 | class P ... ;\\n }\\n} | points.js:15:3:17:3 | static ... t";\\n } | -| points.js:20:1:33:1 | class C ... ;\\n }\\n} | points.js:21:3:24:3 | constru ... c;\\n } | -| points.js:20:1:33:1 | class C ... ;\\n }\\n} | points.js:26:3:28:3 | toStrin ... ur;\\n } | -| points.js:20:1:33:1 | class C ... ;\\n }\\n} | points.js:30:3:32:3 | static ... t";\\n } | -| staticConstructor.js:1:1:3:1 | class M ... r"; }\\n} | staticConstructor.js:1:15:1:14 | constructor() {} | -| staticConstructor.js:1:1:3:1 | class M ... r"; }\\n} | staticConstructor.js:2:3:2:59 | static ... tor"; } | -| tst.js:1:9:4:1 | class { ... */ }\\n} | tst.js:2:3:2:50 | "constr ... r. */ } | -| tst.js:1:9:4:1 | class { ... */ }\\n} | tst.js:3:3:3:56 | ["const ... r. */ } | -| tst.js:6:1:8:1 | class B ... t); }\\n} | tst.js:7:3:7:38 | constru ... get); } | -| tst.js:11:1:14:1 | class C ... () {}\\n} | tst.js:11:9:11:8 | constructor() {} | -| tst.js:11:1:14:1 | class C ... () {}\\n} | tst.js:12:3:12:8 | m() {} | -| tst.js:11:1:14:1 | class C ... () {}\\n} | tst.js:13:3:13:10 | [m]() {} | diff --git a/javascript/ql/test/library-tests/Classes/getAMember.ql b/javascript/ql/test/library-tests/Classes/getAMember.ql deleted file mode 100644 index d291521364ff..000000000000 --- a/javascript/ql/test/library-tests/Classes/getAMember.ql +++ /dev/null @@ -1,4 +0,0 @@ -import javascript - -from ClassDefinition c -select c, c.getAMember() diff --git a/javascript/ql/test/library-tests/Classes/getAMember.qll b/javascript/ql/test/library-tests/Classes/getAMember.qll new file mode 100644 index 000000000000..0ba3084bcd8d --- /dev/null +++ b/javascript/ql/test/library-tests/Classes/getAMember.qll @@ -0,0 +1,3 @@ +import javascript + +query predicate test_getAMember(ClassDefinition c, MemberDeclaration res) { res = c.getAMember() } diff --git a/javascript/ql/test/library-tests/Classes/tests.expected b/javascript/ql/test/library-tests/Classes/tests.expected new file mode 100644 index 000000000000..f788c963c1cf --- /dev/null +++ b/javascript/ql/test/library-tests/Classes/tests.expected @@ -0,0 +1,119 @@ +test_FieldInits +| fields.js:3:3:3:8 | y = 42 | fields.js:3:7:3:8 | 42 | +test_ComputedMethods +| tst.js:3:3:3:56 | ["const ... r. */ } | +| tst.js:13:3:13:10 | [m]() {} | +test_StaticMethods +| points.js:15:3:17:3 | static ... t";\\n } | +| points.js:30:3:32:3 | static ... t";\\n } | +| staticConstructor.js:2:3:2:59 | static ... tor"; } | +test_ClassDefinition_getSuperClass +| points.js:20:1:33:1 | class C ... ;\\n }\\n} | points.js:20:29:20:33 | Point | +| tst.js:6:1:8:1 | class B ... t); }\\n} | tst.js:6:17:6:17 | A | +test_ClassNodeStaticMethod +| points.js:1:1:18:1 | class P ... ;\\n }\\n} | className | points.js:15:19:17:3 | () {\\n ... t";\\n } | +| points.js:20:1:33:1 | class C ... ;\\n }\\n} | className | points.js:30:19:32:3 | () {\\n ... t";\\n } | +| staticConstructor.js:1:1:3:1 | class M ... r"; }\\n} | constructor | staticConstructor.js:2:21:2:59 | () { re ... tor"; } | +test_ClassDefinitions +| fields.js:1:1:4:1 | class C ... = 42\\n} | +| points.js:1:1:18:1 | class P ... ;\\n }\\n} | +| points.js:20:1:33:1 | class C ... ;\\n }\\n} | +| staticConstructor.js:1:1:3:1 | class M ... r"; }\\n} | +| tst.js:1:9:4:1 | class { ... */ }\\n} | +| tst.js:6:1:8:1 | class B ... t); }\\n} | +| tst.js:11:1:14:1 | class C ... () {}\\n} | +test_AccessorMethods +| points.js:7:3:9:3 | get dis ... y);\\n } | +test_Fields +| fields.js:2:3:2:4 | x; | fields.js:2:3:2:3 | x | +| fields.js:3:3:3:8 | y = 42 | fields.js:3:3:3:3 | y | +test_ClassDefinition_getName +| fields.js:1:1:4:1 | class C ... = 42\\n} | C | +| points.js:1:1:18:1 | class P ... ;\\n }\\n} | Point | +| points.js:20:1:33:1 | class C ... ;\\n }\\n} | ColouredPoint | +| staticConstructor.js:1:1:3:1 | class M ... r"; }\\n} | MyClass | +| tst.js:6:1:8:1 | class B ... t); }\\n} | B | +| tst.js:11:1:14:1 | class C ... () {}\\n} | C | +test_MethodDefinitions +| fields.js:1:9:1:8 | constructor() {} | fields.js:1:9:1:8 | constructor | fields.js:1:9:1:8 | () {} | fields.js:1:1:4:1 | class C ... = 42\\n} | +| points.js:2:3:5:3 | constru ... y;\\n } | points.js:2:3:2:13 | constructor | points.js:2:14:5:3 | (x, y) ... y;\\n } | points.js:1:1:18:1 | class P ... ;\\n }\\n} | +| points.js:7:3:9:3 | get dis ... y);\\n } | points.js:7:7:7:10 | dist | points.js:7:11:9:3 | () {\\n ... y);\\n } | points.js:1:1:18:1 | class P ... ;\\n }\\n} | +| points.js:11:3:13:3 | toStrin ... )";\\n } | points.js:11:3:11:10 | toString | points.js:11:11:13:3 | () {\\n ... )";\\n } | points.js:1:1:18:1 | class P ... ;\\n }\\n} | +| points.js:15:3:17:3 | static ... t";\\n } | points.js:15:10:15:18 | className | points.js:15:19:17:3 | () {\\n ... t";\\n } | points.js:1:1:18:1 | class P ... ;\\n }\\n} | +| points.js:21:3:24:3 | constru ... c;\\n } | points.js:21:3:21:13 | constructor | points.js:21:14:24:3 | (x, y, ... c;\\n } | points.js:20:1:33:1 | class C ... ;\\n }\\n} | +| points.js:26:3:28:3 | toStrin ... ur;\\n } | points.js:26:3:26:10 | toString | points.js:26:11:28:3 | () {\\n ... ur;\\n } | points.js:20:1:33:1 | class C ... ;\\n }\\n} | +| points.js:30:3:32:3 | static ... t";\\n } | points.js:30:10:30:18 | className | points.js:30:19:32:3 | () {\\n ... t";\\n } | points.js:20:1:33:1 | class C ... ;\\n }\\n} | +| staticConstructor.js:1:15:1:14 | constructor() {} | staticConstructor.js:1:15:1:14 | constructor | staticConstructor.js:1:15:1:14 | () {} | staticConstructor.js:1:1:3:1 | class M ... r"; }\\n} | +| staticConstructor.js:2:3:2:59 | static ... tor"; } | staticConstructor.js:2:10:2:20 | constructor | staticConstructor.js:2:21:2:59 | () { re ... tor"; } | staticConstructor.js:1:1:3:1 | class M ... r"; }\\n} | +| tst.js:2:3:2:50 | "constr ... r. */ } | tst.js:2:3:2:15 | "constructor" | tst.js:2:16:2:50 | () { /* ... r. */ } | tst.js:1:9:4:1 | class { ... */ }\\n} | +| tst.js:3:3:3:56 | ["const ... r. */ } | tst.js:3:4:3:16 | "constructor" | tst.js:3:18:3:56 | () { /* ... r. */ } | tst.js:1:9:4:1 | class { ... */ }\\n} | +| tst.js:7:3:7:38 | constru ... get); } | tst.js:7:3:7:13 | constructor | tst.js:7:14:7:38 | () { su ... get); } | tst.js:6:1:8:1 | class B ... t); }\\n} | +| tst.js:11:9:11:8 | constructor() {} | tst.js:11:9:11:8 | constructor | tst.js:11:9:11:8 | () {} | tst.js:11:1:14:1 | class C ... () {}\\n} | +| tst.js:12:3:12:8 | m() {} | tst.js:12:3:12:3 | m | tst.js:12:4:12:8 | () {} | tst.js:11:1:14:1 | class C ... () {}\\n} | +| tst.js:13:3:13:10 | [m]() {} | tst.js:13:4:13:4 | m | tst.js:13:6:13:10 | () {} | tst.js:11:1:14:1 | class C ... () {}\\n} | +test_getAMember +| fields.js:1:1:4:1 | class C ... = 42\\n} | fields.js:1:9:1:8 | constructor() {} | +| fields.js:1:1:4:1 | class C ... = 42\\n} | fields.js:2:3:2:4 | x; | +| fields.js:1:1:4:1 | class C ... = 42\\n} | fields.js:3:3:3:8 | y = 42 | +| points.js:1:1:18:1 | class P ... ;\\n }\\n} | points.js:2:3:5:3 | constru ... y;\\n } | +| points.js:1:1:18:1 | class P ... ;\\n }\\n} | points.js:7:3:9:3 | get dis ... y);\\n } | +| points.js:1:1:18:1 | class P ... ;\\n }\\n} | points.js:11:3:13:3 | toStrin ... )";\\n } | +| points.js:1:1:18:1 | class P ... ;\\n }\\n} | points.js:15:3:17:3 | static ... t";\\n } | +| points.js:20:1:33:1 | class C ... ;\\n }\\n} | points.js:21:3:24:3 | constru ... c;\\n } | +| points.js:20:1:33:1 | class C ... ;\\n }\\n} | points.js:26:3:28:3 | toStrin ... ur;\\n } | +| points.js:20:1:33:1 | class C ... ;\\n }\\n} | points.js:30:3:32:3 | static ... t";\\n } | +| staticConstructor.js:1:1:3:1 | class M ... r"; }\\n} | staticConstructor.js:1:15:1:14 | constructor() {} | +| staticConstructor.js:1:1:3:1 | class M ... r"; }\\n} | staticConstructor.js:2:3:2:59 | static ... tor"; } | +| tst.js:1:9:4:1 | class { ... */ }\\n} | tst.js:2:3:2:50 | "constr ... r. */ } | +| tst.js:1:9:4:1 | class { ... */ }\\n} | tst.js:3:3:3:56 | ["const ... r. */ } | +| tst.js:6:1:8:1 | class B ... t); }\\n} | tst.js:7:3:7:38 | constru ... get); } | +| tst.js:11:1:14:1 | class C ... () {}\\n} | tst.js:11:9:11:8 | constructor() {} | +| tst.js:11:1:14:1 | class C ... () {}\\n} | tst.js:12:3:12:8 | m() {} | +| tst.js:11:1:14:1 | class C ... () {}\\n} | tst.js:13:3:13:10 | [m]() {} | +test_MethodNames +| fields.js:1:9:1:8 | constructor() {} | constructor | +| points.js:2:3:5:3 | constru ... y;\\n } | constructor | +| points.js:7:3:9:3 | get dis ... y);\\n } | dist | +| points.js:11:3:13:3 | toStrin ... )";\\n } | toString | +| points.js:15:3:17:3 | static ... t";\\n } | className | +| points.js:21:3:24:3 | constru ... c;\\n } | constructor | +| points.js:26:3:28:3 | toStrin ... ur;\\n } | toString | +| points.js:30:3:32:3 | static ... t";\\n } | className | +| staticConstructor.js:1:15:1:14 | constructor() {} | constructor | +| staticConstructor.js:2:3:2:59 | static ... tor"; } | constructor | +| tst.js:2:3:2:50 | "constr ... r. */ } | constructor | +| tst.js:3:3:3:56 | ["const ... r. */ } | constructor | +| tst.js:7:3:7:38 | constru ... get); } | constructor | +| tst.js:11:9:11:8 | constructor() {} | constructor | +| tst.js:12:3:12:8 | m() {} | m | +test_NewTargetExpr +| tst.js:7:25:7:34 | new.target | +test_SuperExpr +| points.js:22:5:22:9 | super | +| points.js:27:12:27:16 | super | +| tst.js:7:19:7:23 | super | +test_SyntheticConstructors +| fields.js:1:9:1:8 | constructor() {} | +| staticConstructor.js:1:15:1:14 | constructor() {} | +| tst.js:11:9:11:8 | constructor() {} | +test_ConstructorDefinitions +| fields.js:1:9:1:8 | constructor() {} | +| points.js:2:3:5:3 | constru ... y;\\n } | +| points.js:21:3:24:3 | constru ... c;\\n } | +| staticConstructor.js:1:15:1:14 | constructor() {} | +| tst.js:2:3:2:50 | "constr ... r. */ } | +| tst.js:7:3:7:38 | constru ... get); } | +| tst.js:11:9:11:8 | constructor() {} | +test_ClassNodeConstructor +| fields.js:1:1:4:1 | class C ... = 42\\n} | fields.js:1:9:1:8 | () {} | +| points.js:1:1:18:1 | class P ... ;\\n }\\n} | points.js:2:14:5:3 | (x, y) ... y;\\n } | +| points.js:20:1:33:1 | class C ... ;\\n }\\n} | points.js:21:14:24:3 | (x, y, ... c;\\n } | +| staticConstructor.js:1:1:3:1 | class M ... r"; }\\n} | staticConstructor.js:1:15:1:14 | () {} | +| tst.js:1:9:4:1 | class { ... */ }\\n} | tst.js:2:16:2:50 | () { /* ... r. */ } | +| tst.js:6:1:8:1 | class B ... t); }\\n} | tst.js:7:14:7:38 | () { su ... get); } | +| tst.js:11:1:14:1 | class C ... () {}\\n} | tst.js:11:9:11:8 | () {} | +test_ClassNodeInstanceMethod +| points.js:1:1:18:1 | class P ... ;\\n }\\n} | toString | points.js:11:11:13:3 | () {\\n ... )";\\n } | +| points.js:20:1:33:1 | class C ... ;\\n }\\n} | toString | points.js:26:11:28:3 | () {\\n ... ur;\\n } | +| tst.js:1:9:4:1 | class { ... */ }\\n} | constructor | tst.js:3:18:3:56 | () { /* ... r. */ } | +| tst.js:11:1:14:1 | class C ... () {}\\n} | m | tst.js:12:4:12:8 | () {} | diff --git a/javascript/ql/test/library-tests/Classes/tests.ql b/javascript/ql/test/library-tests/Classes/tests.ql new file mode 100644 index 000000000000..3009546636c3 --- /dev/null +++ b/javascript/ql/test/library-tests/Classes/tests.ql @@ -0,0 +1,18 @@ +import FieldInits +import ComputedMethods +import StaticMethods +import ClassDefinition_getSuperClass +import ClassNodeStaticMethod +import ClassDefinitions +import AccessorMethods +import Fields +import ClassDefinition_getName +import MethodDefinitions +import getAMember +import MethodNames +import NewTargetExpr +import SuperExpr +import SyntheticConstructors +import ConstructorDefinitions +import ClassNodeConstructor +import ClassNodeInstanceMethod diff --git a/javascript/ql/test/library-tests/DOM/AttributeDefinition.expected b/javascript/ql/test/library-tests/DOM/AttributeDefinition.expected deleted file mode 100644 index 62dcbc292607..000000000000 --- a/javascript/ql/test/library-tests/DOM/AttributeDefinition.expected +++ /dev/null @@ -1,13 +0,0 @@ -| tst.html:3:6:3:30 | href=https://semmle.com | -| tst.html:3:32:3:46 | target=_blank | -| tst.js:2:22:2:37 | target: "_blank" | -| tst.js:3:11:3:66 | $(" ... e.com") | -| tst.js:4:3:4:27 | a.attr( ... pener") | -| tst.js:5:3:7:4 | a.attr( ... f"\\n }) | -| tst.js:8:3:8:29 | a.prop( ... errer") | -| tst.js:9:3:11:4 | a.prop( ... f"\\n }) | -| tst.js:12:3:12:41 | $.attr( ... errer") | -| tst.js:13:3:13:28 | $.prop( ... d", "") | -| tst.jsx:4:14:4:38 | href="h ... le.com" | -| tst.jsx:4:40:4:48 | rel={rel} | -| tst.jsx:4:50:4:64 | {...otherAttrs} | diff --git a/javascript/ql/test/library-tests/DOM/AttributeDefinition.ql b/javascript/ql/test/library-tests/DOM/AttributeDefinition.ql deleted file mode 100644 index 5b403ec03a1a..000000000000 --- a/javascript/ql/test/library-tests/DOM/AttributeDefinition.ql +++ /dev/null @@ -1,4 +0,0 @@ -import javascript - -from DOM::AttributeDefinition a -select a diff --git a/javascript/ql/test/library-tests/DOM/AttributeDefinition.qll b/javascript/ql/test/library-tests/DOM/AttributeDefinition.qll new file mode 100644 index 000000000000..4db18c09a511 --- /dev/null +++ b/javascript/ql/test/library-tests/DOM/AttributeDefinition.qll @@ -0,0 +1,3 @@ +import javascript + +query predicate test_AttributeDefinition(DOM::AttributeDefinition a) { any() } diff --git a/javascript/ql/test/library-tests/DOM/AttributeDefinition_getName.expected b/javascript/ql/test/library-tests/DOM/AttributeDefinition_getName.expected deleted file mode 100644 index a648edc17acf..000000000000 --- a/javascript/ql/test/library-tests/DOM/AttributeDefinition_getName.expected +++ /dev/null @@ -1,12 +0,0 @@ -| tst.html:3:6:3:30 | href=https://semmle.com | href | -| tst.html:3:32:3:46 | target=_blank | target | -| tst.js:2:22:2:37 | target: "_blank" | target | -| tst.js:3:11:3:66 | $(" ... e.com") | href | -| tst.js:4:3:4:27 | a.attr( ... pener") | rel | -| tst.js:5:3:7:4 | a.attr( ... f"\\n }) | data-bind | -| tst.js:8:3:8:29 | a.prop( ... errer") | rel | -| tst.js:9:3:11:4 | a.prop( ... f"\\n }) | data-bind | -| tst.js:12:3:12:41 | $.attr( ... errer") | rel | -| tst.js:13:3:13:28 | $.prop( ... d", "") | data-bind | -| tst.jsx:4:14:4:38 | href="h ... le.com" | href | -| tst.jsx:4:40:4:48 | rel={rel} | rel | diff --git a/javascript/ql/test/library-tests/DOM/AttributeDefinition_getName.ql b/javascript/ql/test/library-tests/DOM/AttributeDefinition_getName.ql deleted file mode 100644 index d44332096061..000000000000 --- a/javascript/ql/test/library-tests/DOM/AttributeDefinition_getName.ql +++ /dev/null @@ -1,4 +0,0 @@ -import javascript - -from DOM::AttributeDefinition a -select a, a.getName() diff --git a/javascript/ql/test/library-tests/DOM/AttributeDefinition_getName.qll b/javascript/ql/test/library-tests/DOM/AttributeDefinition_getName.qll new file mode 100644 index 000000000000..247e46fe6519 --- /dev/null +++ b/javascript/ql/test/library-tests/DOM/AttributeDefinition_getName.qll @@ -0,0 +1,5 @@ +import javascript + +query predicate test_AttributeDefinition_getName(DOM::AttributeDefinition a, string res) { + res = a.getName() +} diff --git a/javascript/ql/test/library-tests/DOM/AttributeDefinition_getStringValue.expected b/javascript/ql/test/library-tests/DOM/AttributeDefinition_getStringValue.expected deleted file mode 100644 index b2a590c80594..000000000000 --- a/javascript/ql/test/library-tests/DOM/AttributeDefinition_getStringValue.expected +++ /dev/null @@ -1,11 +0,0 @@ -| tst.html:3:6:3:30 | href=https://semmle.com | https://semmle.com | -| tst.html:3:32:3:46 | target=_blank | _blank | -| tst.js:2:22:2:37 | target: "_blank" | _blank | -| tst.js:3:11:3:66 | $(" ... e.com") | https://semmle.com | -| tst.js:4:3:4:27 | a.attr( ... pener") | noopener | -| tst.js:5:3:7:4 | a.attr( ... f"\\n }) | stuff | -| tst.js:8:3:8:29 | a.prop( ... errer") | noreferrer | -| tst.js:9:3:11:4 | a.prop( ... f"\\n }) | otherstuff | -| tst.js:12:3:12:41 | $.attr( ... errer") | noopener noreferrer | -| tst.js:13:3:13:28 | $.prop( ... d", "") | | -| tst.jsx:4:14:4:38 | href="h ... le.com" | https://semmle.com | diff --git a/javascript/ql/test/library-tests/DOM/AttributeDefinition_getStringValue.ql b/javascript/ql/test/library-tests/DOM/AttributeDefinition_getStringValue.ql deleted file mode 100644 index e425c142c30c..000000000000 --- a/javascript/ql/test/library-tests/DOM/AttributeDefinition_getStringValue.ql +++ /dev/null @@ -1,4 +0,0 @@ -import javascript - -from DOM::AttributeDefinition a -select a, a.getStringValue() diff --git a/javascript/ql/test/library-tests/DOM/AttributeDefinition_getStringValue.qll b/javascript/ql/test/library-tests/DOM/AttributeDefinition_getStringValue.qll new file mode 100644 index 000000000000..e844eea7583d --- /dev/null +++ b/javascript/ql/test/library-tests/DOM/AttributeDefinition_getStringValue.qll @@ -0,0 +1,5 @@ +import javascript + +query predicate test_AttributeDefinition_getStringValue(DOM::AttributeDefinition a, string res) { + res = a.getStringValue() +} diff --git a/javascript/ql/test/library-tests/DOM/AttributeDefinition_getValueNode.expected b/javascript/ql/test/library-tests/DOM/AttributeDefinition_getValueNode.expected deleted file mode 100644 index 79a397386182..000000000000 --- a/javascript/ql/test/library-tests/DOM/AttributeDefinition_getValueNode.expected +++ /dev/null @@ -1,11 +0,0 @@ -| tst.js:2:22:2:37 | target: "_blank" | tst.js:2:30:2:37 | "_blank" | -| tst.js:3:11:3:66 | $(" ... e.com") | tst.js:3:46:3:65 | "https://semmle.com" | -| tst.js:4:3:4:27 | a.attr( ... pener") | tst.js:4:17:4:26 | "noopener" | -| tst.js:5:3:7:4 | a.attr( ... f"\\n }) | tst.js:6:18:6:24 | "stuff" | -| tst.js:8:3:8:29 | a.prop( ... errer") | tst.js:8:17:8:28 | "noreferrer" | -| tst.js:9:3:11:4 | a.prop( ... f"\\n }) | tst.js:10:18:10:29 | "otherstuff" | -| tst.js:12:3:12:41 | $.attr( ... errer") | tst.js:12:20:12:40 | "noopen ... ferrer" | -| tst.js:13:3:13:28 | $.prop( ... d", "") | tst.js:13:26:13:27 | "" | -| tst.jsx:4:14:4:38 | href="h ... le.com" | tst.jsx:4:19:4:38 | "https://semmle.com" | -| tst.jsx:4:40:4:48 | rel={rel} | tst.jsx:4:45:4:47 | rel | -| tst.jsx:4:50:4:64 | {...otherAttrs} | tst.jsx:4:50:4:64 | ...otherAttrs | diff --git a/javascript/ql/test/library-tests/DOM/AttributeDefinition_getValueNode.ql b/javascript/ql/test/library-tests/DOM/AttributeDefinition_getValueNode.ql deleted file mode 100644 index 2863b2ee5ac9..000000000000 --- a/javascript/ql/test/library-tests/DOM/AttributeDefinition_getValueNode.ql +++ /dev/null @@ -1,4 +0,0 @@ -import javascript - -from DOM::AttributeDefinition a -select a, a.getValueNode() diff --git a/javascript/ql/test/library-tests/DOM/AttributeDefinition_getValueNode.qll b/javascript/ql/test/library-tests/DOM/AttributeDefinition_getValueNode.qll new file mode 100644 index 000000000000..e42bccf0a188 --- /dev/null +++ b/javascript/ql/test/library-tests/DOM/AttributeDefinition_getValueNode.qll @@ -0,0 +1,5 @@ +import javascript + +query predicate test_AttributeDefinition_getValueNode(DOM::AttributeDefinition a, DataFlow::Node res) { + res = a.getValueNode() +} diff --git a/javascript/ql/test/library-tests/DOM/Element.expected b/javascript/ql/test/library-tests/DOM/Element.expected deleted file mode 100644 index a2574e5f93ff..000000000000 --- a/javascript/ql/test/library-tests/DOM/Element.expected +++ /dev/null @@ -1,23 +0,0 @@ -| tst.html:1:1:5:7 | ... | tst.html:1:1:5:7 | ... | -| tst.html:2:1:4:7 | ... | tst.html:2:1:4:7 | ... | -| tst.html:3:3:3:57 | ... | tst.html:3:3:3:57 | ... | -| tst.js:3:11:3:31 | $(" ... rAttrs) | tst.js:3:11:3:31 | $(" ... rAttrs) | -| tst.js:3:11:3:66 | $(" ... e.com") | tst.js:3:11:3:31 | $(" ... rAttrs) | -| tst.js:4:3:4:3 | a | tst.js:3:11:3:31 | $(" ... rAttrs) | -| tst.js:4:3:4:27 | a.attr( ... pener") | tst.js:3:11:3:31 | $(" ... rAttrs) | -| tst.js:5:3:5:3 | a | tst.js:3:11:3:31 | $(" ... rAttrs) | -| tst.js:5:3:7:4 | a.attr( ... f"\\n }) | tst.js:3:11:3:31 | $(" ... rAttrs) | -| tst.js:8:3:8:3 | a | tst.js:3:11:3:31 | $(" ... rAttrs) | -| tst.js:8:3:8:29 | a.prop( ... errer") | tst.js:3:11:3:31 | $(" ... rAttrs) | -| tst.js:9:3:9:3 | a | tst.js:3:11:3:31 | $(" ... rAttrs) | -| tst.js:9:3:11:4 | a.prop( ... f"\\n }) | tst.js:3:11:3:31 | $(" ... rAttrs) | -| tst.js:12:10:12:10 | a | tst.js:3:11:3:31 | $(" ... rAttrs) | -| tst.js:13:10:13:10 | a | tst.js:3:11:3:31 | $(" ... rAttrs) | -| tst.js:23:5:23:30 | React.c ... ('div') | tst.js:23:5:23:30 | React.c ... ('div') | -| tst.js:24:5:24:55 | React.c ... , null) | tst.js:24:5:24:55 | React.c ... , null) | -| tst.js:27:5:27:14 | factory1() | tst.js:27:5:27:14 | factory1() | -| tst.js:31:20:31:55 |
He ... }
| tst.js:31:20:31:55 |
He ... }
| -| tst.js:36:5:36:55 | React.c ... , null) | tst.js:36:5:36:55 | React.c ... , null) | -| tst.js:39:5:39:14 | factory2() | tst.js:39:5:39:14 | factory2() | -| tst.jsx:4:11:4:75 |
| tst.jsx:4:11:4:75 | | -| tst.jsx:5:3:5:3 | a | tst.jsx:4:11:4:75 | | diff --git a/javascript/ql/test/library-tests/DOM/Element.ql b/javascript/ql/test/library-tests/DOM/Element.ql deleted file mode 100644 index c853f4ebedff..000000000000 --- a/javascript/ql/test/library-tests/DOM/Element.ql +++ /dev/null @@ -1,4 +0,0 @@ -import javascript - -from DOM::Element e -select e, e.getDefinition() diff --git a/javascript/ql/test/library-tests/DOM/Element.qll b/javascript/ql/test/library-tests/DOM/Element.qll new file mode 100644 index 000000000000..84dd85b83191 --- /dev/null +++ b/javascript/ql/test/library-tests/DOM/Element.qll @@ -0,0 +1,3 @@ +import javascript + +query predicate test_Element(DOM::Element e, DOM::ElementDefinition res) { res = e.getDefinition() } diff --git a/javascript/ql/test/library-tests/DOM/ElementDefinition.expected b/javascript/ql/test/library-tests/DOM/ElementDefinition.expected deleted file mode 100644 index 5205174216b8..000000000000 --- a/javascript/ql/test/library-tests/DOM/ElementDefinition.expected +++ /dev/null @@ -1,9 +0,0 @@ -| tst.html:1:1:5:7 | ... | html | -| tst.html:2:1:4:7 | ... | body | -| tst.html:3:3:3:57 | ... | a | -| tst.js:3:11:3:31 | $(" ... rAttrs) | a | -| tst.js:23:5:23:30 | React.c ... ('div') | div | -| tst.js:24:5:24:55 | React.c ... , null) | div | -| tst.js:27:5:27:14 | factory1() | div | -| tst.js:31:20:31:55 |
He ... }
| div | -| tst.jsx:4:11:4:75 |
| a | diff --git a/javascript/ql/test/library-tests/DOM/ElementDefinition.ql b/javascript/ql/test/library-tests/DOM/ElementDefinition.ql deleted file mode 100644 index 7ac2adcc4f2a..000000000000 --- a/javascript/ql/test/library-tests/DOM/ElementDefinition.ql +++ /dev/null @@ -1,4 +0,0 @@ -import javascript - -from DOM::ElementDefinition e -select e, e.getName() diff --git a/javascript/ql/test/library-tests/DOM/ElementDefinition.qll b/javascript/ql/test/library-tests/DOM/ElementDefinition.qll new file mode 100644 index 000000000000..684b5c2d73d8 --- /dev/null +++ b/javascript/ql/test/library-tests/DOM/ElementDefinition.qll @@ -0,0 +1,3 @@ +import javascript + +query predicate test_ElementDefinition(DOM::ElementDefinition e, string res) { res = e.getName() } diff --git a/javascript/ql/test/library-tests/DOM/ElementDefinition_getAttribute.expected b/javascript/ql/test/library-tests/DOM/ElementDefinition_getAttribute.expected deleted file mode 100644 index 8e58ad2dad36..000000000000 --- a/javascript/ql/test/library-tests/DOM/ElementDefinition_getAttribute.expected +++ /dev/null @@ -1,5 +0,0 @@ -| tst.html:3:3:3:57 | ... | 0 | tst.html:3:6:3:30 | href=https://semmle.com | -| tst.html:3:3:3:57 | ... | 1 | tst.html:3:32:3:46 | target=_blank | -| tst.jsx:4:11:4:75 | | 0 | tst.jsx:4:14:4:38 | href="h ... le.com" | -| tst.jsx:4:11:4:75 | | 1 | tst.jsx:4:40:4:48 | rel={rel} | -| tst.jsx:4:11:4:75 | | 2 | tst.jsx:4:50:4:64 | {...otherAttrs} | diff --git a/javascript/ql/test/library-tests/DOM/ElementDefinition_getAttribute.ql b/javascript/ql/test/library-tests/DOM/ElementDefinition_getAttribute.ql deleted file mode 100644 index ee53291d820e..000000000000 --- a/javascript/ql/test/library-tests/DOM/ElementDefinition_getAttribute.ql +++ /dev/null @@ -1,4 +0,0 @@ -import javascript - -from DOM::ElementDefinition e, int i -select e, i, e.getAttribute(i) diff --git a/javascript/ql/test/library-tests/DOM/ElementDefinition_getAttribute.qll b/javascript/ql/test/library-tests/DOM/ElementDefinition_getAttribute.qll new file mode 100644 index 000000000000..eebece774982 --- /dev/null +++ b/javascript/ql/test/library-tests/DOM/ElementDefinition_getAttribute.qll @@ -0,0 +1,7 @@ +import javascript + +query predicate test_ElementDefinition_getAttribute( + DOM::ElementDefinition e, int i, DOM::AttributeDefinition res +) { + res = e.getAttribute(i) +} diff --git a/javascript/ql/test/library-tests/DOM/ElementDefinition_getAttributeByName.expected b/javascript/ql/test/library-tests/DOM/ElementDefinition_getAttributeByName.expected deleted file mode 100644 index db8f2834960f..000000000000 --- a/javascript/ql/test/library-tests/DOM/ElementDefinition_getAttributeByName.expected +++ /dev/null @@ -1,12 +0,0 @@ -| tst.html:3:3:3:57 | ... | href | tst.html:3:6:3:30 | href=https://semmle.com | -| tst.html:3:3:3:57 | ... | target | tst.html:3:32:3:46 | target=_blank | -| tst.js:3:11:3:31 | $(" ... rAttrs) | data-bind | tst.js:5:3:7:4 | a.attr( ... f"\\n }) | -| tst.js:3:11:3:31 | $(" ... rAttrs) | data-bind | tst.js:9:3:11:4 | a.prop( ... f"\\n }) | -| tst.js:3:11:3:31 | $(" ... rAttrs) | data-bind | tst.js:13:3:13:28 | $.prop( ... d", "") | -| tst.js:3:11:3:31 | $(" ... rAttrs) | href | tst.js:3:11:3:66 | $(" ... e.com") | -| tst.js:3:11:3:31 | $(" ... rAttrs) | rel | tst.js:4:3:4:27 | a.attr( ... pener") | -| tst.js:3:11:3:31 | $(" ... rAttrs) | rel | tst.js:8:3:8:29 | a.prop( ... errer") | -| tst.js:3:11:3:31 | $(" ... rAttrs) | rel | tst.js:12:3:12:41 | $.attr( ... errer") | -| tst.js:3:11:3:31 | $(" ... rAttrs) | target | tst.js:2:22:2:37 | target: "_blank" | -| tst.jsx:4:11:4:75 | | href | tst.jsx:4:14:4:38 | href="h ... le.com" | -| tst.jsx:4:11:4:75 | | rel | tst.jsx:4:40:4:48 | rel={rel} | diff --git a/javascript/ql/test/library-tests/DOM/ElementDefinition_getAttributeByName.ql b/javascript/ql/test/library-tests/DOM/ElementDefinition_getAttributeByName.ql deleted file mode 100644 index 3e0565b682c0..000000000000 --- a/javascript/ql/test/library-tests/DOM/ElementDefinition_getAttributeByName.ql +++ /dev/null @@ -1,4 +0,0 @@ -import javascript - -from DOM::ElementDefinition e, string s -select e, s, e.getAttributeByName(s) diff --git a/javascript/ql/test/library-tests/DOM/ElementDefinition_getAttributeByName.qll b/javascript/ql/test/library-tests/DOM/ElementDefinition_getAttributeByName.qll new file mode 100644 index 000000000000..e98bd2150305 --- /dev/null +++ b/javascript/ql/test/library-tests/DOM/ElementDefinition_getAttributeByName.qll @@ -0,0 +1,7 @@ +import javascript + +query predicate test_ElementDefinition_getAttributeByName( + DOM::ElementDefinition e, string s, DOM::AttributeDefinition res +) { + res = e.getAttributeByName(s) +} diff --git a/javascript/ql/test/library-tests/DOM/ElementDefinition_getRoot.expected b/javascript/ql/test/library-tests/DOM/ElementDefinition_getRoot.expected deleted file mode 100644 index 8966b79b221b..000000000000 --- a/javascript/ql/test/library-tests/DOM/ElementDefinition_getRoot.expected +++ /dev/null @@ -1,11 +0,0 @@ -| tst.html:1:1:5:7 | ... | tst.html:1:1:5:7 | ... | -| tst.html:2:1:4:7 | ... | tst.html:1:1:5:7 | ... | -| tst.html:3:3:3:57 | ... | tst.html:1:1:5:7 | ... | -| tst.js:3:11:3:31 | $(" ... rAttrs) | tst.js:3:11:3:31 | $(" ... rAttrs) | -| tst.js:23:5:23:30 | React.c ... ('div') | tst.js:23:5:23:30 | React.c ... ('div') | -| tst.js:24:5:24:55 | React.c ... , null) | tst.js:24:5:24:55 | React.c ... , null) | -| tst.js:27:5:27:14 | factory1() | tst.js:27:5:27:14 | factory1() | -| tst.js:31:20:31:55 |
He ... }
| tst.js:31:20:31:55 |
He ... }
| -| tst.js:36:5:36:55 | React.c ... , null) | tst.js:36:5:36:55 | React.c ... , null) | -| tst.js:39:5:39:14 | factory2() | tst.js:39:5:39:14 | factory2() | -| tst.jsx:4:11:4:75 |
| tst.jsx:4:11:4:75 | | diff --git a/javascript/ql/test/library-tests/DOM/ElementDefinition_getRoot.ql b/javascript/ql/test/library-tests/DOM/ElementDefinition_getRoot.ql deleted file mode 100644 index 8ddb91e088c3..000000000000 --- a/javascript/ql/test/library-tests/DOM/ElementDefinition_getRoot.ql +++ /dev/null @@ -1,4 +0,0 @@ -import javascript - -from DOM::ElementDefinition e -select e, e.getRoot() diff --git a/javascript/ql/test/library-tests/DOM/ElementDefinition_getRoot.qll b/javascript/ql/test/library-tests/DOM/ElementDefinition_getRoot.qll new file mode 100644 index 000000000000..dcb025860a6e --- /dev/null +++ b/javascript/ql/test/library-tests/DOM/ElementDefinition_getRoot.qll @@ -0,0 +1,5 @@ +import javascript + +query predicate test_ElementDefinition_getRoot(DOM::ElementDefinition e, DOM::ElementDefinition res) { + res = e.getRoot() +} diff --git a/javascript/ql/test/library-tests/DOM/WebStorageWrite.expected b/javascript/ql/test/library-tests/DOM/WebStorageWrite.expected deleted file mode 100644 index 619b0a62b546..000000000000 --- a/javascript/ql/test/library-tests/DOM/WebStorageWrite.expected +++ /dev/null @@ -1,4 +0,0 @@ -| tst.js:15:22:15:28 | "value" | -| tst.js:16:31:16:37 | "value" | -| tst.js:17:24:17:30 | "value" | -| tst.js:18:33:18:39 | "value" | diff --git a/javascript/ql/test/library-tests/DOM/WebStorageWrite.ql b/javascript/ql/test/library-tests/DOM/WebStorageWrite.ql deleted file mode 100644 index ae57221b021a..000000000000 --- a/javascript/ql/test/library-tests/DOM/WebStorageWrite.ql +++ /dev/null @@ -1,4 +0,0 @@ -import javascript - -from WebStorageWrite w -select w diff --git a/javascript/ql/test/library-tests/DOM/WebStorageWrite.qll b/javascript/ql/test/library-tests/DOM/WebStorageWrite.qll new file mode 100644 index 000000000000..eb47d7f45c99 --- /dev/null +++ b/javascript/ql/test/library-tests/DOM/WebStorageWrite.qll @@ -0,0 +1,3 @@ +import javascript + +query predicate test_WebStorageWrite(WebStorageWrite w) { any() } diff --git a/javascript/ql/test/library-tests/DOM/tests.expected b/javascript/ql/test/library-tests/DOM/tests.expected new file mode 100644 index 000000000000..fa34eb9341b2 --- /dev/null +++ b/javascript/ql/test/library-tests/DOM/tests.expected @@ -0,0 +1,121 @@ +test_AttributeDefinition +| tst.html:3:6:3:30 | href=https://semmle.com | +| tst.html:3:32:3:46 | target=_blank | +| tst.js:2:22:2:37 | target: "_blank" | +| tst.js:3:11:3:66 | $(" ... e.com") | +| tst.js:4:3:4:27 | a.attr( ... pener") | +| tst.js:5:3:7:4 | a.attr( ... f"\\n }) | +| tst.js:8:3:8:29 | a.prop( ... errer") | +| tst.js:9:3:11:4 | a.prop( ... f"\\n }) | +| tst.js:12:3:12:41 | $.attr( ... errer") | +| tst.js:13:3:13:28 | $.prop( ... d", "") | +| tst.jsx:4:14:4:38 | href="h ... le.com" | +| tst.jsx:4:40:4:48 | rel={rel} | +| tst.jsx:4:50:4:64 | {...otherAttrs} | +test_ElementDefinition_getAttribute +| tst.html:3:3:3:57 | ... | 0 | tst.html:3:6:3:30 | href=https://semmle.com | +| tst.html:3:3:3:57 | ... | 1 | tst.html:3:32:3:46 | target=_blank | +| tst.jsx:4:11:4:75 | | 0 | tst.jsx:4:14:4:38 | href="h ... le.com" | +| tst.jsx:4:11:4:75 | | 1 | tst.jsx:4:40:4:48 | rel={rel} | +| tst.jsx:4:11:4:75 | | 2 | tst.jsx:4:50:4:64 | {...otherAttrs} | +test_ElementDefinition_getRoot +| tst.html:1:1:5:7 | ... | tst.html:1:1:5:7 | ... | +| tst.html:2:1:4:7 | ... | tst.html:1:1:5:7 | ... | +| tst.html:3:3:3:57 | ... | tst.html:1:1:5:7 | ... | +| tst.js:3:11:3:31 | $(" ... rAttrs) | tst.js:3:11:3:31 | $(" ... rAttrs) | +| tst.js:23:5:23:30 | React.c ... ('div') | tst.js:23:5:23:30 | React.c ... ('div') | +| tst.js:24:5:24:55 | React.c ... , null) | tst.js:24:5:24:55 | React.c ... , null) | +| tst.js:27:5:27:14 | factory1() | tst.js:27:5:27:14 | factory1() | +| tst.js:31:20:31:55 |
He ... }
| tst.js:31:20:31:55 |
He ... }
| +| tst.js:36:5:36:55 | React.c ... , null) | tst.js:36:5:36:55 | React.c ... , null) | +| tst.js:39:5:39:14 | factory2() | tst.js:39:5:39:14 | factory2() | +| tst.jsx:4:11:4:75 |
| tst.jsx:4:11:4:75 | | +test_WebStorageWrite +| tst.js:15:22:15:28 | "value" | +| tst.js:16:31:16:37 | "value" | +| tst.js:17:24:17:30 | "value" | +| tst.js:18:33:18:39 | "value" | +test_ElementDefinition_getAttributeByName +| tst.html:3:3:3:57 | ... | href | tst.html:3:6:3:30 | href=https://semmle.com | +| tst.html:3:3:3:57 | ... | target | tst.html:3:32:3:46 | target=_blank | +| tst.js:3:11:3:31 | $(" ... rAttrs) | data-bind | tst.js:5:3:7:4 | a.attr( ... f"\\n }) | +| tst.js:3:11:3:31 | $(" ... rAttrs) | data-bind | tst.js:9:3:11:4 | a.prop( ... f"\\n }) | +| tst.js:3:11:3:31 | $(" ... rAttrs) | data-bind | tst.js:13:3:13:28 | $.prop( ... d", "") | +| tst.js:3:11:3:31 | $(" ... rAttrs) | href | tst.js:3:11:3:66 | $(" ... e.com") | +| tst.js:3:11:3:31 | $(" ... rAttrs) | rel | tst.js:4:3:4:27 | a.attr( ... pener") | +| tst.js:3:11:3:31 | $(" ... rAttrs) | rel | tst.js:8:3:8:29 | a.prop( ... errer") | +| tst.js:3:11:3:31 | $(" ... rAttrs) | rel | tst.js:12:3:12:41 | $.attr( ... errer") | +| tst.js:3:11:3:31 | $(" ... rAttrs) | target | tst.js:2:22:2:37 | target: "_blank" | +| tst.jsx:4:11:4:75 | | href | tst.jsx:4:14:4:38 | href="h ... le.com" | +| tst.jsx:4:11:4:75 | | rel | tst.jsx:4:40:4:48 | rel={rel} | +test_AttributeDefinition_getStringValue +| tst.html:3:6:3:30 | href=https://semmle.com | https://semmle.com | +| tst.html:3:32:3:46 | target=_blank | _blank | +| tst.js:2:22:2:37 | target: "_blank" | _blank | +| tst.js:3:11:3:66 | $(" ... e.com") | https://semmle.com | +| tst.js:4:3:4:27 | a.attr( ... pener") | noopener | +| tst.js:5:3:7:4 | a.attr( ... f"\\n }) | stuff | +| tst.js:8:3:8:29 | a.prop( ... errer") | noreferrer | +| tst.js:9:3:11:4 | a.prop( ... f"\\n }) | otherstuff | +| tst.js:12:3:12:41 | $.attr( ... errer") | noopener noreferrer | +| tst.js:13:3:13:28 | $.prop( ... d", "") | | +| tst.jsx:4:14:4:38 | href="h ... le.com" | https://semmle.com | +test_AttributeDefinition_getName +| tst.html:3:6:3:30 | href=https://semmle.com | href | +| tst.html:3:32:3:46 | target=_blank | target | +| tst.js:2:22:2:37 | target: "_blank" | target | +| tst.js:3:11:3:66 | $(" ... e.com") | href | +| tst.js:4:3:4:27 | a.attr( ... pener") | rel | +| tst.js:5:3:7:4 | a.attr( ... f"\\n }) | data-bind | +| tst.js:8:3:8:29 | a.prop( ... errer") | rel | +| tst.js:9:3:11:4 | a.prop( ... f"\\n }) | data-bind | +| tst.js:12:3:12:41 | $.attr( ... errer") | rel | +| tst.js:13:3:13:28 | $.prop( ... d", "") | data-bind | +| tst.jsx:4:14:4:38 | href="h ... le.com" | href | +| tst.jsx:4:40:4:48 | rel={rel} | rel | +test_Element +| tst.html:1:1:5:7 | ... | tst.html:1:1:5:7 | ... | +| tst.html:2:1:4:7 | ... | tst.html:2:1:4:7 | ... | +| tst.html:3:3:3:57 | ... | tst.html:3:3:3:57 | ... | +| tst.js:3:11:3:31 | $(" ... rAttrs) | tst.js:3:11:3:31 | $(" ... rAttrs) | +| tst.js:3:11:3:66 | $(" ... e.com") | tst.js:3:11:3:31 | $(" ... rAttrs) | +| tst.js:4:3:4:3 | a | tst.js:3:11:3:31 | $(" ... rAttrs) | +| tst.js:4:3:4:27 | a.attr( ... pener") | tst.js:3:11:3:31 | $(" ... rAttrs) | +| tst.js:5:3:5:3 | a | tst.js:3:11:3:31 | $(" ... rAttrs) | +| tst.js:5:3:7:4 | a.attr( ... f"\\n }) | tst.js:3:11:3:31 | $(" ... rAttrs) | +| tst.js:8:3:8:3 | a | tst.js:3:11:3:31 | $(" ... rAttrs) | +| tst.js:8:3:8:29 | a.prop( ... errer") | tst.js:3:11:3:31 | $(" ... rAttrs) | +| tst.js:9:3:9:3 | a | tst.js:3:11:3:31 | $(" ... rAttrs) | +| tst.js:9:3:11:4 | a.prop( ... f"\\n }) | tst.js:3:11:3:31 | $(" ... rAttrs) | +| tst.js:12:10:12:10 | a | tst.js:3:11:3:31 | $(" ... rAttrs) | +| tst.js:13:10:13:10 | a | tst.js:3:11:3:31 | $(" ... rAttrs) | +| tst.js:23:5:23:30 | React.c ... ('div') | tst.js:23:5:23:30 | React.c ... ('div') | +| tst.js:24:5:24:55 | React.c ... , null) | tst.js:24:5:24:55 | React.c ... , null) | +| tst.js:27:5:27:14 | factory1() | tst.js:27:5:27:14 | factory1() | +| tst.js:31:20:31:55 |
He ... }
| tst.js:31:20:31:55 |
He ... }
| +| tst.js:36:5:36:55 | React.c ... , null) | tst.js:36:5:36:55 | React.c ... , null) | +| tst.js:39:5:39:14 | factory2() | tst.js:39:5:39:14 | factory2() | +| tst.jsx:4:11:4:75 |
| tst.jsx:4:11:4:75 | | +| tst.jsx:5:3:5:3 | a | tst.jsx:4:11:4:75 | | +test_AttributeDefinition_getValueNode +| tst.js:2:22:2:37 | target: "_blank" | tst.js:2:30:2:37 | "_blank" | +| tst.js:3:11:3:66 | $(" ... e.com") | tst.js:3:46:3:65 | "https://semmle.com" | +| tst.js:4:3:4:27 | a.attr( ... pener") | tst.js:4:17:4:26 | "noopener" | +| tst.js:5:3:7:4 | a.attr( ... f"\\n }) | tst.js:6:18:6:24 | "stuff" | +| tst.js:8:3:8:29 | a.prop( ... errer") | tst.js:8:17:8:28 | "noreferrer" | +| tst.js:9:3:11:4 | a.prop( ... f"\\n }) | tst.js:10:18:10:29 | "otherstuff" | +| tst.js:12:3:12:41 | $.attr( ... errer") | tst.js:12:20:12:40 | "noopen ... ferrer" | +| tst.js:13:3:13:28 | $.prop( ... d", "") | tst.js:13:26:13:27 | "" | +| tst.jsx:4:14:4:38 | href="h ... le.com" | tst.jsx:4:19:4:38 | "https://semmle.com" | +| tst.jsx:4:40:4:48 | rel={rel} | tst.jsx:4:45:4:47 | rel | +| tst.jsx:4:50:4:64 | {...otherAttrs} | tst.jsx:4:50:4:64 | ...otherAttrs | +test_ElementDefinition +| tst.html:1:1:5:7 | ... | html | +| tst.html:2:1:4:7 | ... | body | +| tst.html:3:3:3:57 | ... | a | +| tst.js:3:11:3:31 | $(" ... rAttrs) | a | +| tst.js:23:5:23:30 | React.c ... ('div') | div | +| tst.js:24:5:24:55 | React.c ... , null) | div | +| tst.js:27:5:27:14 | factory1() | div | +| tst.js:31:20:31:55 |
He ... }
| div | +| tst.jsx:4:11:4:75 |
| a | diff --git a/javascript/ql/test/library-tests/DOM/tests.ql b/javascript/ql/test/library-tests/DOM/tests.ql new file mode 100644 index 000000000000..f5c32b026830 --- /dev/null +++ b/javascript/ql/test/library-tests/DOM/tests.ql @@ -0,0 +1,10 @@ +import AttributeDefinition +import ElementDefinition_getAttribute +import ElementDefinition_getRoot +import WebStorageWrite +import ElementDefinition_getAttributeByName +import AttributeDefinition_getStringValue +import AttributeDefinition_getName +import Element +import AttributeDefinition_getValueNode +import ElementDefinition diff --git a/javascript/ql/test/library-tests/Expr/LetExpr.expected b/javascript/ql/test/library-tests/Expr/LetExpr.expected deleted file mode 100644 index 31650f68e0f4..000000000000 --- a/javascript/ql/test/library-tests/Expr/LetExpr.expected +++ /dev/null @@ -1,2 +0,0 @@ -| legacyletexpr.js:1:13:1:38 | let (x ... ) x + y | 0 | legacyletexpr.js:1:18:1:23 | x = 23 | legacyletexpr.js:1:34:1:38 | x + y | -| legacyletexpr.js:1:13:1:38 | let (x ... ) x + y | 1 | legacyletexpr.js:1:26:1:31 | y = 19 | legacyletexpr.js:1:34:1:38 | x + y | diff --git a/javascript/ql/test/library-tests/Expr/LetExpr.ql b/javascript/ql/test/library-tests/Expr/LetExpr.ql deleted file mode 100644 index 0506c22135a3..000000000000 --- a/javascript/ql/test/library-tests/Expr/LetExpr.ql +++ /dev/null @@ -1,4 +0,0 @@ -import javascript - -from LegacyLetExpr l, int i -select l, i, l.getDecl(i), l.getBody() diff --git a/javascript/ql/test/library-tests/Expr/LetExpr.qll b/javascript/ql/test/library-tests/Expr/LetExpr.qll new file mode 100644 index 000000000000..99f5f01a12fd --- /dev/null +++ b/javascript/ql/test/library-tests/Expr/LetExpr.qll @@ -0,0 +1,5 @@ +import javascript + +query predicate test_LetExpr(LegacyLetExpr l, int i, VariableDeclarator res0, Expr res1) { + res0 = l.getDecl(i) and res1 = l.getBody() +} diff --git a/javascript/ql/test/library-tests/Expr/RelationalComparisons.expected b/javascript/ql/test/library-tests/Expr/RelationalComparisons.expected deleted file mode 100644 index e84d8f416c14..000000000000 --- a/javascript/ql/test/library-tests/Expr/RelationalComparisons.expected +++ /dev/null @@ -1,5 +0,0 @@ -| comparison.js:5:1:5:5 | 1 < 2 | comparison.js:5:1:5:1 | 1 | comparison.js:5:5:5:5 | 2 | -| comparison.js:6:1:6:6 | 1 <= 2 | comparison.js:6:1:6:1 | 1 | comparison.js:6:6:6:6 | 2 | -| comparison.js:7:1:7:5 | 2 > 1 | comparison.js:7:5:7:5 | 1 | comparison.js:7:1:7:1 | 2 | -| comparison.js:8:1:8:6 | 2 >= 1 | comparison.js:8:6:8:6 | 1 | comparison.js:8:1:8:1 | 2 | -| es2015.js:23:8:23:12 | n-->0 | es2015.js:23:12:23:12 | 0 | es2015.js:23:8:23:10 | n-- | diff --git a/javascript/ql/test/library-tests/Expr/RelationalComparisons.ql b/javascript/ql/test/library-tests/Expr/RelationalComparisons.ql deleted file mode 100644 index 29e36a9193fa..000000000000 --- a/javascript/ql/test/library-tests/Expr/RelationalComparisons.ql +++ /dev/null @@ -1,4 +0,0 @@ -import javascript - -from RelationalComparison rel -select rel, rel.getLesserOperand(), rel.getGreaterOperand() diff --git a/javascript/ql/test/library-tests/Expr/RelationalComparisons.qll b/javascript/ql/test/library-tests/Expr/RelationalComparisons.qll new file mode 100644 index 000000000000..dabe52193668 --- /dev/null +++ b/javascript/ql/test/library-tests/Expr/RelationalComparisons.qll @@ -0,0 +1,5 @@ +import javascript + +query predicate test_RelationalComparisons(RelationalComparison rel, Expr res0, Expr res1) { + res0 = rel.getLesserOperand() and res1 = rel.getGreaterOperand() +} diff --git a/javascript/ql/test/library-tests/Expr/YieldExpr.expected b/javascript/ql/test/library-tests/Expr/YieldExpr.expected deleted file mode 100644 index cb4dd1ffd037..000000000000 --- a/javascript/ql/test/library-tests/Expr/YieldExpr.expected +++ /dev/null @@ -1,2 +0,0 @@ -| es2015.js:24:3:24:9 | yield n | not delegating | -| es2015.js:25:2:25:14 | yield* foo(1) | delegating | diff --git a/javascript/ql/test/library-tests/Expr/YieldExpr.ql b/javascript/ql/test/library-tests/Expr/YieldExpr.ql deleted file mode 100644 index 69b0185f70a8..000000000000 --- a/javascript/ql/test/library-tests/Expr/YieldExpr.ql +++ /dev/null @@ -1,5 +0,0 @@ -import javascript - -from YieldExpr yield, string s -where if yield.isDelegating() then s = "delegating" else s = "not delegating" -select yield, s diff --git a/javascript/ql/test/library-tests/Expr/YieldExpr.qll b/javascript/ql/test/library-tests/Expr/YieldExpr.qll new file mode 100644 index 000000000000..eb71cfab0fcd --- /dev/null +++ b/javascript/ql/test/library-tests/Expr/YieldExpr.qll @@ -0,0 +1,5 @@ +import javascript + +query predicate test_YieldExpr(YieldExpr yield, string s) { + if yield.isDelegating() then s = "delegating" else s = "not delegating" +} diff --git a/javascript/ql/test/library-tests/Expr/getChild.expected b/javascript/ql/test/library-tests/Expr/getChild.expected deleted file mode 100644 index 9ceacea49960..000000000000 --- a/javascript/ql/test/library-tests/Expr/getChild.expected +++ /dev/null @@ -1,197 +0,0 @@ -| assignment.js:1:1:1:6 | a = 23 | 0 | assignment.js:1:1:1:1 | a | -| assignment.js:1:1:1:6 | a = 23 | 1 | assignment.js:1:5:1:6 | 23 | -| assignment.js:2:1:2:7 | a += 19 | 0 | assignment.js:2:1:2:1 | a | -| assignment.js:2:1:2:7 | a += 19 | 1 | assignment.js:2:6:2:7 | 19 | -| assignment.js:3:1:3:6 | a -= 9 | 0 | assignment.js:3:1:3:1 | a | -| assignment.js:3:1:3:6 | a -= 9 | 1 | assignment.js:3:6:3:6 | 9 | -| assignment.js:4:1:4:6 | a *= b | 0 | assignment.js:4:1:4:1 | a | -| assignment.js:4:1:4:6 | a *= b | 1 | assignment.js:4:6:4:6 | b | -| assignment.js:5:1:5:6 | a /= 2 | 0 | assignment.js:5:1:5:1 | a | -| assignment.js:5:1:5:6 | a /= 2 | 1 | assignment.js:5:6:5:6 | 2 | -| assignment.js:6:1:6:6 | a %= 2 | 0 | assignment.js:6:1:6:1 | a | -| assignment.js:6:1:6:6 | a %= 2 | 1 | assignment.js:6:6:6:6 | 2 | -| assignment.js:7:1:7:7 | a <<= 8 | 0 | assignment.js:7:1:7:1 | a | -| assignment.js:7:1:7:7 | a <<= 8 | 1 | assignment.js:7:7:7:7 | 8 | -| assignment.js:8:1:8:7 | a >>= 7 | 0 | assignment.js:8:1:8:1 | a | -| assignment.js:8:1:8:7 | a >>= 7 | 1 | assignment.js:8:7:8:7 | 7 | -| assignment.js:9:1:9:8 | a >>>= 2 | 0 | assignment.js:9:1:9:1 | a | -| assignment.js:9:1:9:8 | a >>>= 2 | 1 | assignment.js:9:8:9:8 | 2 | -| assignment.js:10:1:10:6 | a \|= 2 | 0 | assignment.js:10:1:10:1 | a | -| assignment.js:10:1:10:6 | a \|= 2 | 1 | assignment.js:10:6:10:6 | 2 | -| assignment.js:11:1:11:6 | a ^= 1 | 0 | assignment.js:11:1:11:1 | a | -| assignment.js:11:1:11:6 | a ^= 1 | 1 | assignment.js:11:6:11:6 | 1 | -| assignment.js:12:1:12:6 | a &= 3 | 0 | assignment.js:12:1:12:1 | a | -| assignment.js:12:1:12:6 | a &= 3 | 1 | assignment.js:12:6:12:6 | 3 | -| binary.js:1:1:1:6 | 1 << 2 | 0 | binary.js:1:1:1:1 | 1 | -| binary.js:1:1:1:6 | 1 << 2 | 1 | binary.js:1:6:1:6 | 2 | -| binary.js:2:1:2:6 | 2 >> 1 | 0 | binary.js:2:1:2:1 | 2 | -| binary.js:2:1:2:6 | 2 >> 1 | 1 | binary.js:2:6:2:6 | 1 | -| binary.js:3:1:3:7 | 2 >>> 1 | 0 | binary.js:3:1:3:1 | 2 | -| binary.js:3:1:3:7 | 2 >>> 1 | 1 | binary.js:3:7:3:7 | 1 | -| binary.js:4:1:4:7 | 23 + 19 | 0 | binary.js:4:1:4:2 | 23 | -| binary.js:4:1:4:7 | 23 + 19 | 1 | binary.js:4:6:4:7 | 19 | -| binary.js:5:1:5:7 | 42 - 19 | 0 | binary.js:5:1:5:2 | 42 | -| binary.js:5:1:5:7 | 42 - 19 | 1 | binary.js:5:6:5:7 | 19 | -| binary.js:6:1:6:5 | 2 * 3 | 0 | binary.js:6:1:6:1 | 2 | -| binary.js:6:1:6:5 | 2 * 3 | 1 | binary.js:6:5:6:5 | 3 | -| binary.js:7:1:7:5 | 8 / 5 | 0 | binary.js:7:1:7:1 | 8 | -| binary.js:7:1:7:5 | 8 / 5 | 1 | binary.js:7:5:7:5 | 5 | -| binary.js:8:1:8:5 | 2 % 1 | 0 | binary.js:8:1:8:1 | 2 | -| binary.js:8:1:8:5 | 2 % 1 | 1 | binary.js:8:5:8:5 | 1 | -| binary.js:9:1:9:5 | 2 \| 3 | 0 | binary.js:9:1:9:1 | 2 | -| binary.js:9:1:9:5 | 2 \| 3 | 1 | binary.js:9:5:9:5 | 3 | -| binary.js:10:1:10:5 | 2 ^ 3 | 0 | binary.js:10:1:10:1 | 2 | -| binary.js:10:1:10:5 | 2 ^ 3 | 1 | binary.js:10:5:10:5 | 3 | -| binary.js:11:1:11:5 | 2 & 3 | 0 | binary.js:11:1:11:1 | 2 | -| binary.js:11:1:11:5 | 2 & 3 | 1 | binary.js:11:5:11:5 | 3 | -| binary.js:12:1:12:21 | 'protot ... Object | 0 | binary.js:12:1:12:11 | 'prototype' | -| binary.js:12:1:12:21 | 'protot ... Object | 1 | binary.js:12:16:12:21 | Object | -| binary.js:13:1:13:19 | [] instanceof Array | 0 | binary.js:13:1:13:2 | [] | -| binary.js:13:1:13:19 | [] instanceof Array | 1 | binary.js:13:15:13:19 | Array | -| binary.js:14:1:14:6 | 1 && 2 | 0 | binary.js:14:1:14:1 | 1 | -| binary.js:14:1:14:6 | 1 && 2 | 1 | binary.js:14:6:14:6 | 2 | -| binary.js:15:1:15:6 | 1 \|\| 2 | 0 | binary.js:15:1:15:1 | 1 | -| binary.js:15:1:15:6 | 1 \|\| 2 | 1 | binary.js:15:6:15:6 | 2 | -| comparison.js:1:1:1:6 | 1 == 1 | 0 | comparison.js:1:1:1:1 | 1 | -| comparison.js:1:1:1:6 | 1 == 1 | 1 | comparison.js:1:6:1:6 | 1 | -| comparison.js:2:1:2:6 | 1 != 2 | 0 | comparison.js:2:1:2:1 | 1 | -| comparison.js:2:1:2:6 | 1 != 2 | 1 | comparison.js:2:6:2:6 | 2 | -| comparison.js:3:1:3:7 | 1 === 1 | 0 | comparison.js:3:1:3:1 | 1 | -| comparison.js:3:1:3:7 | 1 === 1 | 1 | comparison.js:3:7:3:7 | 1 | -| comparison.js:4:1:4:7 | 1 !== 2 | 0 | comparison.js:4:1:4:1 | 1 | -| comparison.js:4:1:4:7 | 1 !== 2 | 1 | comparison.js:4:7:4:7 | 2 | -| comparison.js:5:1:5:5 | 1 < 2 | 0 | comparison.js:5:1:5:1 | 1 | -| comparison.js:5:1:5:5 | 1 < 2 | 1 | comparison.js:5:5:5:5 | 2 | -| comparison.js:6:1:6:6 | 1 <= 2 | 0 | comparison.js:6:1:6:1 | 1 | -| comparison.js:6:1:6:6 | 1 <= 2 | 1 | comparison.js:6:6:6:6 | 2 | -| comparison.js:7:1:7:5 | 2 > 1 | 0 | comparison.js:7:1:7:1 | 2 | -| comparison.js:7:1:7:5 | 2 > 1 | 1 | comparison.js:7:5:7:5 | 1 | -| comparison.js:8:1:8:6 | 2 >= 1 | 0 | comparison.js:8:1:8:1 | 2 | -| comparison.js:8:1:8:6 | 2 >= 1 | 1 | comparison.js:8:6:8:6 | 1 | -| es2015.js:1:1:1:18 | ["a", "ab", "abc"] | 0 | es2015.js:1:2:1:4 | "a" | -| es2015.js:1:1:1:18 | ["a", "ab", "abc"] | 1 | es2015.js:1:7:1:10 | "ab" | -| es2015.js:1:1:1:18 | ["a", "ab", "abc"] | 2 | es2015.js:1:13:1:17 | "abc" | -| es2015.js:1:1:1:22 | ["a", " ... c"].map | 0 | es2015.js:1:1:1:18 | ["a", "ab", "abc"] | -| es2015.js:1:1:1:22 | ["a", " ... c"].map | 1 | es2015.js:1:20:1:22 | map | -| es2015.js:1:1:1:37 | ["a", " ... length) | 0 | es2015.js:1:24:1:36 | s => s.length | -| es2015.js:1:1:1:37 | ["a", " ... length) | -1 | es2015.js:1:1:1:22 | ["a", " ... c"].map | -| es2015.js:1:24:1:36 | s => s.length | 0 | es2015.js:1:24:1:24 | s | -| es2015.js:1:24:1:36 | s => s.length | -2 | es2015.js:1:29:1:36 | s.length | -| es2015.js:1:29:1:36 | s.length | 0 | es2015.js:1:29:1:29 | s | -| es2015.js:1:29:1:36 | s.length | 1 | es2015.js:1:31:1:36 | length | -| es2015.js:2:1:2:30 | setInte ... , 1000) | 0 | es2015.js:2:13:2:23 | () => ++cnt | -| es2015.js:2:1:2:30 | setInte ... , 1000) | 1 | es2015.js:2:26:2:29 | 1000 | -| es2015.js:2:1:2:30 | setInte ... , 1000) | -1 | es2015.js:2:1:2:11 | setInterval | -| es2015.js:2:13:2:23 | () => ++cnt | -2 | es2015.js:2:19:2:23 | ++cnt | -| es2015.js:2:19:2:23 | ++cnt | 0 | es2015.js:2:21:2:23 | cnt | -| es2015.js:3:1:3:47 | setTime ... 60000) | 0 | es2015.js:3:12:3:39 | () => { ... p!"); } | -| es2015.js:3:1:3:47 | setTime ... 60000) | 1 | es2015.js:3:42:3:46 | 60000 | -| es2015.js:3:1:3:47 | setTime ... 60000) | -1 | es2015.js:3:1:3:10 | setTimeout | -| es2015.js:3:20:3:36 | alert("Wake up!") | 0 | es2015.js:3:26:3:35 | "Wake up!" | -| es2015.js:3:20:3:36 | alert("Wake up!") | -1 | es2015.js:3:20:3:24 | alert | -| es2015.js:5:1:5:10 | [a, ...as] | 0 | es2015.js:5:2:5:2 | a | -| es2015.js:5:1:5:10 | [a, ...as] | 1 | es2015.js:5:5:5:9 | ...as | -| es2015.js:5:5:5:9 | ...as | 0 | es2015.js:5:8:5:9 | as | -| es2015.js:6:1:6:18 | new Array(...elts) | 0 | es2015.js:6:11:6:17 | ...elts | -| es2015.js:6:1:6:18 | new Array(...elts) | -1 | es2015.js:6:5:6:9 | Array | -| es2015.js:6:11:6:17 | ...elts | 0 | es2015.js:6:14:6:17 | elts | -| es2015.js:8:12:8:17 | [x, y] | 0 | es2015.js:8:13:8:13 | x | -| es2015.js:8:12:8:17 | [x, y] | 1 | es2015.js:8:16:8:16 | y | -| es2015.js:9:6:9:15 | [a, [, c]] | 0 | es2015.js:9:7:9:7 | a | -| es2015.js:9:6:9:15 | [a, [, c]] | 1 | es2015.js:9:10:9:14 | [, c] | -| es2015.js:9:6:9:19 | [a, [, c]] = x | 0 | es2015.js:9:6:9:15 | [a, [, c]] | -| es2015.js:9:6:9:19 | [a, [, c]] = x | 1 | es2015.js:9:19:9:19 | x | -| es2015.js:9:10:9:14 | [, c] | 1 | es2015.js:9:13:9:13 | c | -| es2015.js:11:9:11:14 | [a, c] | 0 | es2015.js:11:10:11:10 | a | -| es2015.js:11:9:11:14 | [a, c] | 1 | es2015.js:11:13:11:13 | c | -| es2015.js:13:3:13:13 | console.log | 0 | es2015.js:13:3:13:9 | console | -| es2015.js:13:3:13:13 | console.log | 1 | es2015.js:13:11:13:13 | log | -| es2015.js:13:3:13:16 | console.log(d) | 0 | es2015.js:13:15:13:15 | d | -| es2015.js:13:3:13:16 | console.log(d) | -1 | es2015.js:13:3:13:13 | console.log | -| es2015.js:18:6:18:19 | { [x]: w } = z | 0 | es2015.js:18:6:18:15 | { [x]: w } | -| es2015.js:18:6:18:19 | { [x]: w } = z | 1 | es2015.js:18:19:18:19 | z | -| es2015.js:23:8:23:10 | n-- | 0 | es2015.js:23:8:23:8 | n | -| es2015.js:23:8:23:12 | n-->0 | 0 | es2015.js:23:8:23:10 | n-- | -| es2015.js:23:8:23:12 | n-->0 | 1 | es2015.js:23:12:23:12 | 0 | -| es2015.js:24:3:24:9 | yield n | 0 | es2015.js:24:9:24:9 | n | -| es2015.js:25:2:25:14 | yield* foo(1) | 0 | es2015.js:25:9:25:14 | foo(1) | -| es2015.js:25:9:25:14 | foo(1) | 0 | es2015.js:25:13:25:13 | 1 | -| es2015.js:25:9:25:14 | foo(1) | -1 | es2015.js:25:9:25:11 | foo | -| es2015.js:28:19:28:22 | x+19 | 0 | es2015.js:28:19:28:19 | x | -| es2015.js:28:19:28:22 | x+19 | 1 | es2015.js:28:21:28:22 | 19 | -| functions.js:4:3:6:4 | (functi ... f;\\n\\t\\t}) | 0 | functions.js:4:4:6:3 | functio ... _f;\\n\\t\\t} | -| functions.js:4:3:8:4 | (functi ... in\\n\\t\\t}) | 0 | functions.js:6:6:8:3 | {\\n\\t\\t\\tx: ... ain\\n\\t\\t} | -| functions.js:4:3:8:4 | (functi ... in\\n\\t\\t}) | -1 | functions.js:4:3:6:4 | (functi ... f;\\n\\t\\t}) | -| legacyletexpr.js:1:1:1:11 | console.log | 0 | legacyletexpr.js:1:1:1:7 | console | -| legacyletexpr.js:1:1:1:11 | console.log | 1 | legacyletexpr.js:1:9:1:11 | log | -| legacyletexpr.js:1:1:1:39 | console ... x + y) | 0 | legacyletexpr.js:1:13:1:38 | let (x ... ) x + y | -| legacyletexpr.js:1:1:1:39 | console ... x + y) | -1 | legacyletexpr.js:1:1:1:11 | console.log | -| legacyletexpr.js:1:13:1:38 | let (x ... ) x + y | 0 | legacyletexpr.js:1:18:1:23 | x = 23 | -| legacyletexpr.js:1:13:1:38 | let (x ... ) x + y | 1 | legacyletexpr.js:1:26:1:31 | y = 19 | -| legacyletexpr.js:1:13:1:38 | let (x ... ) x + y | -1 | legacyletexpr.js:1:34:1:38 | x + y | -| legacyletexpr.js:1:18:1:23 | x = 23 | 0 | legacyletexpr.js:1:18:1:18 | x | -| legacyletexpr.js:1:18:1:23 | x = 23 | 1 | legacyletexpr.js:1:22:1:23 | 23 | -| legacyletexpr.js:1:26:1:31 | y = 19 | 0 | legacyletexpr.js:1:26:1:26 | y | -| legacyletexpr.js:1:26:1:31 | y = 19 | 1 | legacyletexpr.js:1:30:1:31 | 19 | -| legacyletexpr.js:1:34:1:38 | x + y | 0 | legacyletexpr.js:1:34:1:34 | x | -| legacyletexpr.js:1:34:1:38 | x + y | 1 | legacyletexpr.js:1:38:1:38 | y | -| mozextensions.js:1:1:1:9 | array.map | 0 | mozextensions.js:1:1:1:5 | array | -| mozextensions.js:1:1:1:9 | array.map | 1 | mozextensions.js:1:7:1:9 | map | -| mozextensions.js:1:1:1:26 | array.m ... x) x+1) | 0 | mozextensions.js:1:11:1:25 | function(x) x+1 | -| mozextensions.js:1:1:1:26 | array.m ... x) x+1) | -1 | mozextensions.js:1:1:1:9 | array.map | -| mozextensions.js:1:11:1:25 | function(x) x+1 | 0 | mozextensions.js:1:20:1:20 | x | -| mozextensions.js:1:11:1:25 | function(x) x+1 | -2 | mozextensions.js:1:23:1:25 | x+1 | -| mozextensions.js:1:23:1:25 | x+1 | 0 | mozextensions.js:1:23:1:23 | x | -| mozextensions.js:1:23:1:25 | x+1 | 1 | mozextensions.js:1:25:1:25 | 1 | -| others.js:1:1:1:6 | 23, 42 | 0 | others.js:1:1:1:2 | 23 | -| others.js:1:1:1:6 | 23, 42 | 1 | others.js:1:5:1:6 | 42 | -| others.js:2:1:2:10 | 23, 42, 56 | 0 | others.js:2:1:2:2 | 23 | -| others.js:2:1:2:10 | 23, 42, 56 | 1 | others.js:2:5:2:6 | 42 | -| others.js:2:1:2:10 | 23, 42, 56 | 2 | others.js:2:9:2:10 | 56 | -| others.js:3:1:3:12 | true ? 0 : 1 | 0 | others.js:3:1:3:4 | true | -| others.js:3:1:3:12 | true ? 0 : 1 | 1 | others.js:3:8:3:8 | 0 | -| others.js:3:1:3:12 | true ? 0 : 1 | 2 | others.js:3:12:3:12 | 1 | -| others.js:4:10:4:10 | p | 0 | others.js:4:10:4:10 | p | -| primaries.js:15:1:15:4 | (23) | 0 | primaries.js:15:2:15:3 | 23 | -| primaries.js:16:1:16:17 | [23, 42, , "hi" ] | 0 | primaries.js:16:2:16:3 | 23 | -| primaries.js:16:1:16:17 | [23, 42, , "hi" ] | 1 | primaries.js:16:6:16:7 | 42 | -| primaries.js:16:1:16:17 | [23, 42, , "hi" ] | 3 | primaries.js:16:12:16:15 | "hi" | -| primaries.js:17:1:21:16 | ({ x: 2 ... v) {}}) | 0 | primaries.js:17:2:21:15 | { x: 23 ... (v) {}} | -| primaries.js:21:9:21:14 | (v) {} | 0 | primaries.js:21:10:21:10 | v | -| primaries.js:22:1:22:9 | new Array | -1 | primaries.js:22:5:22:9 | Array | -| primaries.js:23:1:23:12 | new Object() | -1 | primaries.js:23:5:23:10 | Object | -| primaries.js:24:1:24:16 | new String("hi") | 0 | primaries.js:24:12:24:15 | "hi" | -| primaries.js:24:1:24:16 | new String("hi") | -1 | primaries.js:24:5:24:10 | String | -| primaries.js:25:1:25:10 | String("") | 0 | primaries.js:25:8:25:9 | "" | -| primaries.js:25:1:25:10 | String("") | -1 | primaries.js:25:1:25:6 | String | -| primaries.js:26:1:26:13 | Object.create | 0 | primaries.js:26:1:26:6 | Object | -| primaries.js:26:1:26:13 | Object.create | 1 | primaries.js:26:8:26:13 | create | -| primaries.js:26:1:26:17 | Object.create({}) | 0 | primaries.js:26:15:26:16 | {} | -| primaries.js:26:1:26:17 | Object.create({}) | -1 | primaries.js:26:1:26:13 | Object.create | -| primaries.js:27:1:27:29 | String[ ... erse()] | 0 | primaries.js:27:1:27:6 | String | -| primaries.js:27:1:27:29 | String[ ... erse()] | 1 | primaries.js:27:8:27:28 | 'epytot ... verse() | -| primaries.js:27:8:27:26 | 'epytotorp'.reverse | 0 | primaries.js:27:8:27:18 | 'epytotorp' | -| primaries.js:27:8:27:26 | 'epytotorp'.reverse | 1 | primaries.js:27:20:27:26 | reverse | -| primaries.js:27:8:27:28 | 'epytot ... verse() | -1 | primaries.js:27:8:27:26 | 'epytotorp'.reverse | -| primaries.js:28:1:28:6 | ((42)) | 0 | primaries.js:28:2:28:5 | (42) | -| primaries.js:28:2:28:5 | (42) | 0 | primaries.js:28:3:28:4 | 42 | -| surrogates.js:1:5:1:16 | a = "\\ud800" | 0 | surrogates.js:1:5:1:5 | a | -| surrogates.js:1:5:1:16 | a = "\\ud800" | 1 | surrogates.js:1:9:1:16 | "\\ud800" | -| surrogates.js:2:1:2:13 | /\\uD800/.test | 0 | surrogates.js:2:1:2:8 | /\\uD800/ | -| surrogates.js:2:1:2:13 | /\\uD800/.test | 1 | surrogates.js:2:10:2:13 | test | -| surrogates.js:2:1:2:16 | /\\uD800/.test(a) | 0 | surrogates.js:2:15:2:15 | a | -| surrogates.js:2:1:2:16 | /\\uD800/.test(a) | -1 | surrogates.js:2:1:2:13 | /\\uD800/.test | -| unary.js:1:1:1:3 | -23 | 0 | unary.js:1:2:1:3 | 23 | -| unary.js:2:1:2:3 | +42 | 0 | unary.js:2:2:2:3 | 42 | -| unary.js:3:1:3:5 | !true | 0 | unary.js:3:2:3:5 | true | -| unary.js:4:1:4:2 | ~2 | 0 | unary.js:4:2:4:2 | 2 | -| unary.js:5:1:5:13 | typeof Object | 0 | unary.js:5:8:5:13 | Object | -| unary.js:6:1:6:7 | void(0) | 0 | unary.js:6:5:6:7 | (0) | -| unary.js:6:5:6:7 | (0) | 0 | unary.js:6:6:6:6 | 0 | -| unary.js:7:1:7:23 | delete ... ototype | 0 | unary.js:7:8:7:23 | Object.prototype | -| unary.js:7:8:7:23 | Object.prototype | 0 | unary.js:7:8:7:13 | Object | -| unary.js:7:8:7:23 | Object.prototype | 1 | unary.js:7:15:7:23 | prototype | -| update.js:1:1:1:3 | ++a | 0 | update.js:1:3:1:3 | a | -| update.js:2:1:2:3 | a++ | 0 | update.js:2:1:2:1 | a | -| update.js:3:1:3:3 | --b | 0 | update.js:3:3:3:3 | b | -| update.js:4:1:4:3 | b-- | 0 | update.js:4:1:4:1 | b | diff --git a/javascript/ql/test/library-tests/Expr/getChild.ql b/javascript/ql/test/library-tests/Expr/getChild.ql deleted file mode 100644 index 6d525386c70b..000000000000 --- a/javascript/ql/test/library-tests/Expr/getChild.ql +++ /dev/null @@ -1,5 +0,0 @@ -import javascript - -from Expr e, int i, Expr child -where child = e.getChild(i) -select e, i, child diff --git a/javascript/ql/test/library-tests/Expr/getChild.qll b/javascript/ql/test/library-tests/Expr/getChild.qll new file mode 100644 index 000000000000..e76a1f72e7cf --- /dev/null +++ b/javascript/ql/test/library-tests/Expr/getChild.qll @@ -0,0 +1,3 @@ +import javascript + +query predicate test_getChild(Expr e, int i, Expr child) { child = e.getChild(i) } diff --git a/javascript/ql/test/library-tests/Expr/getContainer.expected b/javascript/ql/test/library-tests/Expr/getContainer.expected deleted file mode 100644 index 6f7a0921fbdd..000000000000 --- a/javascript/ql/test/library-tests/Expr/getContainer.expected +++ /dev/null @@ -1,331 +0,0 @@ -| assignment.js:1:1:1:1 | a | assignment.js:1:1:12:7 | | -| assignment.js:1:1:1:6 | a = 23 | assignment.js:1:1:12:7 | | -| assignment.js:1:5:1:6 | 23 | assignment.js:1:1:12:7 | | -| assignment.js:2:1:2:1 | a | assignment.js:1:1:12:7 | | -| assignment.js:2:1:2:7 | a += 19 | assignment.js:1:1:12:7 | | -| assignment.js:2:6:2:7 | 19 | assignment.js:1:1:12:7 | | -| assignment.js:3:1:3:1 | a | assignment.js:1:1:12:7 | | -| assignment.js:3:1:3:6 | a -= 9 | assignment.js:1:1:12:7 | | -| assignment.js:3:6:3:6 | 9 | assignment.js:1:1:12:7 | | -| assignment.js:4:1:4:1 | a | assignment.js:1:1:12:7 | | -| assignment.js:4:1:4:6 | a *= b | assignment.js:1:1:12:7 | | -| assignment.js:4:6:4:6 | b | assignment.js:1:1:12:7 | | -| assignment.js:5:1:5:1 | a | assignment.js:1:1:12:7 | | -| assignment.js:5:1:5:6 | a /= 2 | assignment.js:1:1:12:7 | | -| assignment.js:5:6:5:6 | 2 | assignment.js:1:1:12:7 | | -| assignment.js:6:1:6:1 | a | assignment.js:1:1:12:7 | | -| assignment.js:6:1:6:6 | a %= 2 | assignment.js:1:1:12:7 | | -| assignment.js:6:6:6:6 | 2 | assignment.js:1:1:12:7 | | -| assignment.js:7:1:7:1 | a | assignment.js:1:1:12:7 | | -| assignment.js:7:1:7:7 | a <<= 8 | assignment.js:1:1:12:7 | | -| assignment.js:7:7:7:7 | 8 | assignment.js:1:1:12:7 | | -| assignment.js:8:1:8:1 | a | assignment.js:1:1:12:7 | | -| assignment.js:8:1:8:7 | a >>= 7 | assignment.js:1:1:12:7 | | -| assignment.js:8:7:8:7 | 7 | assignment.js:1:1:12:7 | | -| assignment.js:9:1:9:1 | a | assignment.js:1:1:12:7 | | -| assignment.js:9:1:9:8 | a >>>= 2 | assignment.js:1:1:12:7 | | -| assignment.js:9:8:9:8 | 2 | assignment.js:1:1:12:7 | | -| assignment.js:10:1:10:1 | a | assignment.js:1:1:12:7 | | -| assignment.js:10:1:10:6 | a \|= 2 | assignment.js:1:1:12:7 | | -| assignment.js:10:6:10:6 | 2 | assignment.js:1:1:12:7 | | -| assignment.js:11:1:11:1 | a | assignment.js:1:1:12:7 | | -| assignment.js:11:1:11:6 | a ^= 1 | assignment.js:1:1:12:7 | | -| assignment.js:11:6:11:6 | 1 | assignment.js:1:1:12:7 | | -| assignment.js:12:1:12:1 | a | assignment.js:1:1:12:7 | | -| assignment.js:12:1:12:6 | a &= 3 | assignment.js:1:1:12:7 | | -| assignment.js:12:6:12:6 | 3 | assignment.js:1:1:12:7 | | -| binary.js:1:1:1:1 | 1 | binary.js:1:1:16:0 | | -| binary.js:1:1:1:6 | 1 << 2 | binary.js:1:1:16:0 | | -| binary.js:1:6:1:6 | 2 | binary.js:1:1:16:0 | | -| binary.js:2:1:2:1 | 2 | binary.js:1:1:16:0 | | -| binary.js:2:1:2:6 | 2 >> 1 | binary.js:1:1:16:0 | | -| binary.js:2:6:2:6 | 1 | binary.js:1:1:16:0 | | -| binary.js:3:1:3:1 | 2 | binary.js:1:1:16:0 | | -| binary.js:3:1:3:7 | 2 >>> 1 | binary.js:1:1:16:0 | | -| binary.js:3:7:3:7 | 1 | binary.js:1:1:16:0 | | -| binary.js:4:1:4:2 | 23 | binary.js:1:1:16:0 | | -| binary.js:4:1:4:7 | 23 + 19 | binary.js:1:1:16:0 | | -| binary.js:4:6:4:7 | 19 | binary.js:1:1:16:0 | | -| binary.js:5:1:5:2 | 42 | binary.js:1:1:16:0 | | -| binary.js:5:1:5:7 | 42 - 19 | binary.js:1:1:16:0 | | -| binary.js:5:6:5:7 | 19 | binary.js:1:1:16:0 | | -| binary.js:6:1:6:1 | 2 | binary.js:1:1:16:0 | | -| binary.js:6:1:6:5 | 2 * 3 | binary.js:1:1:16:0 | | -| binary.js:6:5:6:5 | 3 | binary.js:1:1:16:0 | | -| binary.js:7:1:7:1 | 8 | binary.js:1:1:16:0 | | -| binary.js:7:1:7:5 | 8 / 5 | binary.js:1:1:16:0 | | -| binary.js:7:5:7:5 | 5 | binary.js:1:1:16:0 | | -| binary.js:8:1:8:1 | 2 | binary.js:1:1:16:0 | | -| binary.js:8:1:8:5 | 2 % 1 | binary.js:1:1:16:0 | | -| binary.js:8:5:8:5 | 1 | binary.js:1:1:16:0 | | -| binary.js:9:1:9:1 | 2 | binary.js:1:1:16:0 | | -| binary.js:9:1:9:5 | 2 \| 3 | binary.js:1:1:16:0 | | -| binary.js:9:5:9:5 | 3 | binary.js:1:1:16:0 | | -| binary.js:10:1:10:1 | 2 | binary.js:1:1:16:0 | | -| binary.js:10:1:10:5 | 2 ^ 3 | binary.js:1:1:16:0 | | -| binary.js:10:5:10:5 | 3 | binary.js:1:1:16:0 | | -| binary.js:11:1:11:1 | 2 | binary.js:1:1:16:0 | | -| binary.js:11:1:11:5 | 2 & 3 | binary.js:1:1:16:0 | | -| binary.js:11:5:11:5 | 3 | binary.js:1:1:16:0 | | -| binary.js:12:1:12:11 | 'prototype' | binary.js:1:1:16:0 | | -| binary.js:12:1:12:21 | 'protot ... Object | binary.js:1:1:16:0 | | -| binary.js:12:16:12:21 | Object | binary.js:1:1:16:0 | | -| binary.js:13:1:13:2 | [] | binary.js:1:1:16:0 | | -| binary.js:13:1:13:19 | [] instanceof Array | binary.js:1:1:16:0 | | -| binary.js:13:15:13:19 | Array | binary.js:1:1:16:0 | | -| binary.js:14:1:14:1 | 1 | binary.js:1:1:16:0 | | -| binary.js:14:1:14:6 | 1 && 2 | binary.js:1:1:16:0 | | -| binary.js:14:6:14:6 | 2 | binary.js:1:1:16:0 | | -| binary.js:15:1:15:1 | 1 | binary.js:1:1:16:0 | | -| binary.js:15:1:15:6 | 1 \|\| 2 | binary.js:1:1:16:0 | | -| binary.js:15:6:15:6 | 2 | binary.js:1:1:16:0 | | -| comparison.js:1:1:1:1 | 1 | comparison.js:1:1:9:0 | | -| comparison.js:1:1:1:6 | 1 == 1 | comparison.js:1:1:9:0 | | -| comparison.js:1:6:1:6 | 1 | comparison.js:1:1:9:0 | | -| comparison.js:2:1:2:1 | 1 | comparison.js:1:1:9:0 | | -| comparison.js:2:1:2:6 | 1 != 2 | comparison.js:1:1:9:0 | | -| comparison.js:2:6:2:6 | 2 | comparison.js:1:1:9:0 | | -| comparison.js:3:1:3:1 | 1 | comparison.js:1:1:9:0 | | -| comparison.js:3:1:3:7 | 1 === 1 | comparison.js:1:1:9:0 | | -| comparison.js:3:7:3:7 | 1 | comparison.js:1:1:9:0 | | -| comparison.js:4:1:4:1 | 1 | comparison.js:1:1:9:0 | | -| comparison.js:4:1:4:7 | 1 !== 2 | comparison.js:1:1:9:0 | | -| comparison.js:4:7:4:7 | 2 | comparison.js:1:1:9:0 | | -| comparison.js:5:1:5:1 | 1 | comparison.js:1:1:9:0 | | -| comparison.js:5:1:5:5 | 1 < 2 | comparison.js:1:1:9:0 | | -| comparison.js:5:5:5:5 | 2 | comparison.js:1:1:9:0 | | -| comparison.js:6:1:6:1 | 1 | comparison.js:1:1:9:0 | | -| comparison.js:6:1:6:6 | 1 <= 2 | comparison.js:1:1:9:0 | | -| comparison.js:6:6:6:6 | 2 | comparison.js:1:1:9:0 | | -| comparison.js:7:1:7:1 | 2 | comparison.js:1:1:9:0 | | -| comparison.js:7:1:7:5 | 2 > 1 | comparison.js:1:1:9:0 | | -| comparison.js:7:5:7:5 | 1 | comparison.js:1:1:9:0 | | -| comparison.js:8:1:8:1 | 2 | comparison.js:1:1:9:0 | | -| comparison.js:8:1:8:6 | 2 >= 1 | comparison.js:1:1:9:0 | | -| comparison.js:8:6:8:6 | 1 | comparison.js:1:1:9:0 | | -| es2015.js:1:1:1:18 | ["a", "ab", "abc"] | es2015.js:1:1:29:0 | | -| es2015.js:1:1:1:22 | ["a", " ... c"].map | es2015.js:1:1:29:0 | | -| es2015.js:1:1:1:37 | ["a", " ... length) | es2015.js:1:1:29:0 | | -| es2015.js:1:2:1:4 | "a" | es2015.js:1:1:29:0 | | -| es2015.js:1:7:1:10 | "ab" | es2015.js:1:1:29:0 | | -| es2015.js:1:13:1:17 | "abc" | es2015.js:1:1:29:0 | | -| es2015.js:1:20:1:22 | map | es2015.js:1:1:29:0 | | -| es2015.js:1:24:1:24 | s | es2015.js:1:24:1:36 | s => s.length | -| es2015.js:1:24:1:36 | s => s.length | es2015.js:1:1:29:0 | | -| es2015.js:1:29:1:29 | s | es2015.js:1:24:1:36 | s => s.length | -| es2015.js:1:29:1:36 | s.length | es2015.js:1:24:1:36 | s => s.length | -| es2015.js:1:31:1:36 | length | es2015.js:1:24:1:36 | s => s.length | -| es2015.js:2:1:2:11 | setInterval | es2015.js:1:1:29:0 | | -| es2015.js:2:1:2:30 | setInte ... , 1000) | es2015.js:1:1:29:0 | | -| es2015.js:2:13:2:23 | () => ++cnt | es2015.js:1:1:29:0 | | -| es2015.js:2:19:2:23 | ++cnt | es2015.js:2:13:2:23 | () => ++cnt | -| es2015.js:2:21:2:23 | cnt | es2015.js:2:13:2:23 | () => ++cnt | -| es2015.js:2:26:2:29 | 1000 | es2015.js:1:1:29:0 | | -| es2015.js:3:1:3:10 | setTimeout | es2015.js:1:1:29:0 | | -| es2015.js:3:1:3:47 | setTime ... 60000) | es2015.js:1:1:29:0 | | -| es2015.js:3:12:3:39 | () => { ... p!"); } | es2015.js:1:1:29:0 | | -| es2015.js:3:20:3:24 | alert | es2015.js:3:12:3:39 | () => { ... p!"); } | -| es2015.js:3:20:3:36 | alert("Wake up!") | es2015.js:3:12:3:39 | () => { ... p!"); } | -| es2015.js:3:26:3:35 | "Wake up!" | es2015.js:3:12:3:39 | () => { ... p!"); } | -| es2015.js:3:42:3:46 | 60000 | es2015.js:1:1:29:0 | | -| es2015.js:5:1:5:10 | [a, ...as] | es2015.js:1:1:29:0 | | -| es2015.js:5:2:5:2 | a | es2015.js:1:1:29:0 | | -| es2015.js:5:5:5:9 | ...as | es2015.js:1:1:29:0 | | -| es2015.js:5:8:5:9 | as | es2015.js:1:1:29:0 | | -| es2015.js:6:1:6:18 | new Array(...elts) | es2015.js:1:1:29:0 | | -| es2015.js:6:5:6:9 | Array | es2015.js:1:1:29:0 | | -| es2015.js:6:11:6:17 | ...elts | es2015.js:1:1:29:0 | | -| es2015.js:6:14:6:17 | elts | es2015.js:1:1:29:0 | | -| es2015.js:8:10:8:10 | f | es2015.js:8:1:15:1 | functio ... );\\n\\t}\\n} | -| es2015.js:8:12:8:17 | [x, y] | es2015.js:8:1:15:1 | functio ... );\\n\\t}\\n} | -| es2015.js:8:13:8:13 | x | es2015.js:8:1:15:1 | functio ... );\\n\\t}\\n} | -| es2015.js:8:16:8:16 | y | es2015.js:8:1:15:1 | functio ... );\\n\\t}\\n} | -| es2015.js:9:6:9:15 | [a, [, c]] | es2015.js:8:1:15:1 | functio ... );\\n\\t}\\n} | -| es2015.js:9:6:9:19 | [a, [, c]] = x | es2015.js:8:1:15:1 | functio ... );\\n\\t}\\n} | -| es2015.js:9:7:9:7 | a | es2015.js:8:1:15:1 | functio ... );\\n\\t}\\n} | -| es2015.js:9:10:9:14 | [, c] | es2015.js:8:1:15:1 | functio ... );\\n\\t}\\n} | -| es2015.js:9:13:9:13 | c | es2015.js:8:1:15:1 | functio ... );\\n\\t}\\n} | -| es2015.js:9:19:9:19 | x | es2015.js:8:1:15:1 | functio ... );\\n\\t}\\n} | -| es2015.js:11:9:11:14 | [a, c] | es2015.js:8:1:15:1 | functio ... );\\n\\t}\\n} | -| es2015.js:11:10:11:10 | a | es2015.js:8:1:15:1 | functio ... );\\n\\t}\\n} | -| es2015.js:11:13:11:13 | c | es2015.js:8:1:15:1 | functio ... );\\n\\t}\\n} | -| es2015.js:12:11:12:11 | d | es2015.js:8:1:15:1 | functio ... );\\n\\t}\\n} | -| es2015.js:13:3:13:9 | console | es2015.js:8:1:15:1 | functio ... );\\n\\t}\\n} | -| es2015.js:13:3:13:13 | console.log | es2015.js:8:1:15:1 | functio ... );\\n\\t}\\n} | -| es2015.js:13:3:13:16 | console.log(d) | es2015.js:8:1:15:1 | functio ... );\\n\\t}\\n} | -| es2015.js:13:11:13:13 | log | es2015.js:8:1:15:1 | functio ... );\\n\\t}\\n} | -| es2015.js:13:15:13:15 | d | es2015.js:8:1:15:1 | functio ... );\\n\\t}\\n} | -| es2015.js:17:10:17:10 | g | es2015.js:17:1:20:1 | functio ... rn w;\\n} | -| es2015.js:17:12:17:22 | { x, y: z } | es2015.js:17:1:20:1 | functio ... rn w;\\n} | -| es2015.js:17:14:17:14 | x | es2015.js:17:1:20:1 | functio ... rn w;\\n} | -| es2015.js:17:14:17:14 | x | es2015.js:17:1:20:1 | functio ... rn w;\\n} | -| es2015.js:17:17:17:17 | y | es2015.js:17:1:20:1 | functio ... rn w;\\n} | -| es2015.js:17:20:17:20 | z | es2015.js:17:1:20:1 | functio ... rn w;\\n} | -| es2015.js:18:6:18:15 | { [x]: w } | es2015.js:17:1:20:1 | functio ... rn w;\\n} | -| es2015.js:18:6:18:19 | { [x]: w } = z | es2015.js:17:1:20:1 | functio ... rn w;\\n} | -| es2015.js:18:9:18:9 | x | es2015.js:17:1:20:1 | functio ... rn w;\\n} | -| es2015.js:18:13:18:13 | w | es2015.js:17:1:20:1 | functio ... rn w;\\n} | -| es2015.js:18:19:18:19 | z | es2015.js:17:1:20:1 | functio ... rn w;\\n} | -| es2015.js:19:9:19:9 | w | es2015.js:17:1:20:1 | functio ... rn w;\\n} | -| es2015.js:22:11:22:13 | foo | es2015.js:22:1:26:1 | functio ... o(1);\\n} | -| es2015.js:22:15:22:15 | n | es2015.js:22:1:26:1 | functio ... o(1);\\n} | -| es2015.js:23:8:23:8 | n | es2015.js:22:1:26:1 | functio ... o(1);\\n} | -| es2015.js:23:8:23:10 | n-- | es2015.js:22:1:26:1 | functio ... o(1);\\n} | -| es2015.js:23:8:23:12 | n-->0 | es2015.js:22:1:26:1 | functio ... o(1);\\n} | -| es2015.js:23:12:23:12 | 0 | es2015.js:22:1:26:1 | functio ... o(1);\\n} | -| es2015.js:24:3:24:9 | yield n | es2015.js:22:1:26:1 | functio ... o(1);\\n} | -| es2015.js:24:9:24:9 | n | es2015.js:22:1:26:1 | functio ... o(1);\\n} | -| es2015.js:25:2:25:14 | yield* foo(1) | es2015.js:22:1:26:1 | functio ... o(1);\\n} | -| es2015.js:25:9:25:11 | foo | es2015.js:22:1:26:1 | functio ... o(1);\\n} | -| es2015.js:25:9:25:14 | foo(1) | es2015.js:22:1:26:1 | functio ... o(1);\\n} | -| es2015.js:25:13:25:13 | 1 | es2015.js:22:1:26:1 | functio ... o(1);\\n} | -| es2015.js:28:10:28:12 | bar | es2015.js:28:1:28:26 | functio ... +19) {} | -| es2015.js:28:14:28:14 | x | es2015.js:28:1:28:26 | functio ... +19) {} | -| es2015.js:28:17:28:17 | y | es2015.js:28:1:28:26 | functio ... +19) {} | -| es2015.js:28:19:28:19 | x | es2015.js:28:1:28:26 | functio ... +19) {} | -| es2015.js:28:19:28:22 | x+19 | es2015.js:28:1:28:26 | functio ... +19) {} | -| es2015.js:28:21:28:22 | 19 | es2015.js:28:1:28:26 | functio ... +19) {} | -| functions.js:1:10:1:10 | f | functions.js:1:1:9:1 | functio ... \\t\\t});\\n} | -| functions.js:2:2:2:5 | in_f | functions.js:1:1:9:1 | functio ... \\t\\t});\\n} | -| functions.js:3:9:3:17 | also_in_f | functions.js:1:1:9:1 | functio ... \\t\\t});\\n} | -| functions.js:4:3:6:4 | (functi ... f;\\n\\t\\t}) | functions.js:1:1:9:1 | functio ... \\t\\t});\\n} | -| functions.js:4:3:8:4 | (functi ... in\\n\\t\\t}) | functions.js:1:1:9:1 | functio ... \\t\\t});\\n} | -| functions.js:4:4:6:3 | functio ... _f;\\n\\t\\t} | functions.js:1:1:9:1 | functio ... \\t\\t});\\n} | -| functions.js:5:4:5:11 | not_in_f | functions.js:4:4:6:3 | functio ... _f;\\n\\t\\t} | -| functions.js:6:6:8:3 | {\\n\\t\\t\\tx: ... ain\\n\\t\\t} | functions.js:1:1:9:1 | functio ... \\t\\t});\\n} | -| functions.js:7:4:7:4 | x | functions.js:1:1:9:1 | functio ... \\t\\t});\\n} | -| functions.js:7:7:7:16 | in_f_again | functions.js:1:1:9:1 | functio ... \\t\\t});\\n} | -| functions.js:10:1:10:6 | global | functions.js:1:1:10:7 | | -| legacyletexpr.js:1:1:1:7 | console | legacyletexpr.js:1:1:3:42 | | -| legacyletexpr.js:1:1:1:11 | console.log | legacyletexpr.js:1:1:3:42 | | -| legacyletexpr.js:1:1:1:39 | console ... x + y) | legacyletexpr.js:1:1:3:42 | | -| legacyletexpr.js:1:9:1:11 | log | legacyletexpr.js:1:1:3:42 | | -| legacyletexpr.js:1:13:1:38 | let (x ... ) x + y | legacyletexpr.js:1:1:3:42 | | -| legacyletexpr.js:1:18:1:18 | x | legacyletexpr.js:1:1:3:42 | | -| legacyletexpr.js:1:18:1:23 | x = 23 | legacyletexpr.js:1:1:3:42 | | -| legacyletexpr.js:1:22:1:23 | 23 | legacyletexpr.js:1:1:3:42 | | -| legacyletexpr.js:1:26:1:26 | y | legacyletexpr.js:1:1:3:42 | | -| legacyletexpr.js:1:26:1:31 | y = 19 | legacyletexpr.js:1:1:3:42 | | -| legacyletexpr.js:1:30:1:31 | 19 | legacyletexpr.js:1:1:3:42 | | -| legacyletexpr.js:1:34:1:34 | x | legacyletexpr.js:1:1:3:42 | | -| legacyletexpr.js:1:34:1:38 | x + y | legacyletexpr.js:1:1:3:42 | | -| legacyletexpr.js:1:38:1:38 | y | legacyletexpr.js:1:1:3:42 | | -| mozextensions.js:1:1:1:5 | array | mozextensions.js:1:1:3:42 | | -| mozextensions.js:1:1:1:9 | array.map | mozextensions.js:1:1:3:42 | | -| mozextensions.js:1:1:1:26 | array.m ... x) x+1) | mozextensions.js:1:1:3:42 | | -| mozextensions.js:1:7:1:9 | map | mozextensions.js:1:1:3:42 | | -| mozextensions.js:1:11:1:25 | function(x) x+1 | mozextensions.js:1:1:3:42 | | -| mozextensions.js:1:20:1:20 | x | mozextensions.js:1:11:1:25 | function(x) x+1 | -| mozextensions.js:1:23:1:23 | x | mozextensions.js:1:11:1:25 | function(x) x+1 | -| mozextensions.js:1:23:1:25 | x+1 | mozextensions.js:1:11:1:25 | function(x) x+1 | -| mozextensions.js:1:25:1:25 | 1 | mozextensions.js:1:11:1:25 | function(x) x+1 | -| others.js:1:1:1:2 | 23 | others.js:1:1:5:2 | | -| others.js:1:1:1:6 | 23, 42 | others.js:1:1:5:2 | | -| others.js:1:5:1:6 | 42 | others.js:1:1:5:2 | | -| others.js:2:1:2:2 | 23 | others.js:1:1:5:2 | | -| others.js:2:1:2:10 | 23, 42, 56 | others.js:1:1:5:2 | | -| others.js:2:5:2:6 | 42 | others.js:1:1:5:2 | | -| others.js:2:9:2:10 | 56 | others.js:1:1:5:2 | | -| others.js:3:1:3:4 | true | others.js:1:1:5:2 | | -| others.js:3:1:3:12 | true ? 0 : 1 | others.js:1:1:5:2 | | -| others.js:3:8:3:8 | 0 | others.js:1:1:5:2 | | -| others.js:3:12:3:12 | 1 | others.js:1:1:5:2 | | -| others.js:4:10:4:10 | p | others.js:1:1:5:2 | | -| others.js:4:10:4:10 | p | others.js:1:1:5:2 | | -| others.js:4:15:4:15 | o | others.js:1:1:5:2 | | -| primaries.js:1:1:1:4 | null | primaries.js:1:1:32:17 | | -| primaries.js:2:1:2:4 | true | primaries.js:1:1:32:17 | | -| primaries.js:3:1:3:5 | false | primaries.js:1:1:32:17 | | -| primaries.js:4:1:4:2 | 23 | primaries.js:1:1:32:17 | | -| primaries.js:5:1:5:3 | 2.3 | primaries.js:1:1:32:17 | | -| primaries.js:6:1:6:3 | .42 | primaries.js:1:1:32:17 | | -| primaries.js:7:1:7:6 | 7.6e23 | primaries.js:1:1:32:17 | | -| primaries.js:8:1:8:5 | 1E-42 | primaries.js:1:1:32:17 | | -| primaries.js:9:1:9:10 | 0xdeadbeef | primaries.js:1:1:32:17 | | -| primaries.js:10:1:10:7 | "Hello" | primaries.js:1:1:32:17 | | -| primaries.js:11:1:11:7 | 'world' | primaries.js:1:1:32:17 | | -| primaries.js:12:1:12:13 | "'what?'\\x0a" | primaries.js:1:1:32:17 | | -| primaries.js:13:1:13:10 | '"why?"\\n' | primaries.js:1:1:32:17 | | -| primaries.js:14:1:14:15 | /^(need?le)+/gi | primaries.js:1:1:32:17 | | -| primaries.js:15:1:15:4 | (23) | primaries.js:1:1:32:17 | | -| primaries.js:15:2:15:3 | 23 | primaries.js:1:1:32:17 | | -| primaries.js:16:1:16:17 | [23, 42, , "hi" ] | primaries.js:1:1:32:17 | | -| primaries.js:16:2:16:3 | 23 | primaries.js:1:1:32:17 | | -| primaries.js:16:6:16:7 | 42 | primaries.js:1:1:32:17 | | -| primaries.js:16:12:16:15 | "hi" | primaries.js:1:1:32:17 | | -| primaries.js:17:1:21:16 | ({ x: 2 ... v) {}}) | primaries.js:1:1:32:17 | | -| primaries.js:17:2:21:15 | { x: 23 ... (v) {}} | primaries.js:1:1:32:17 | | -| primaries.js:17:4:17:4 | x | primaries.js:1:1:32:17 | | -| primaries.js:17:7:17:8 | 23 | primaries.js:1:1:32:17 | | -| primaries.js:18:4:18:4 | y | primaries.js:1:1:32:17 | | -| primaries.js:18:7:18:10 | this | primaries.js:1:1:32:17 | | -| primaries.js:19:8:19:8 | o | primaries.js:1:1:32:17 | | -| primaries.js:19:9:19:13 | () {} | primaries.js:1:1:32:17 | | -| primaries.js:20:8:20:8 | p | primaries.js:1:1:32:17 | | -| primaries.js:20:9:20:13 | () {} | primaries.js:1:1:32:17 | | -| primaries.js:21:8:21:8 | p | primaries.js:1:1:32:17 | | -| primaries.js:21:9:21:14 | (v) {} | primaries.js:1:1:32:17 | | -| primaries.js:21:10:21:10 | v | primaries.js:21:9:21:14 | (v) {} | -| primaries.js:22:1:22:9 | new Array | primaries.js:1:1:32:17 | | -| primaries.js:22:5:22:9 | Array | primaries.js:1:1:32:17 | | -| primaries.js:23:1:23:12 | new Object() | primaries.js:1:1:32:17 | | -| primaries.js:23:5:23:10 | Object | primaries.js:1:1:32:17 | | -| primaries.js:24:1:24:16 | new String("hi") | primaries.js:1:1:32:17 | | -| primaries.js:24:5:24:10 | String | primaries.js:1:1:32:17 | | -| primaries.js:24:12:24:15 | "hi" | primaries.js:1:1:32:17 | | -| primaries.js:25:1:25:6 | String | primaries.js:1:1:32:17 | | -| primaries.js:25:1:25:10 | String("") | primaries.js:1:1:32:17 | | -| primaries.js:25:8:25:9 | "" | primaries.js:1:1:32:17 | | -| primaries.js:26:1:26:6 | Object | primaries.js:1:1:32:17 | | -| primaries.js:26:1:26:13 | Object.create | primaries.js:1:1:32:17 | | -| primaries.js:26:1:26:17 | Object.create({}) | primaries.js:1:1:32:17 | | -| primaries.js:26:8:26:13 | create | primaries.js:1:1:32:17 | | -| primaries.js:26:15:26:16 | {} | primaries.js:1:1:32:17 | | -| primaries.js:27:1:27:6 | String | primaries.js:1:1:32:17 | | -| primaries.js:27:1:27:29 | String[ ... erse()] | primaries.js:1:1:32:17 | | -| primaries.js:27:8:27:18 | 'epytotorp' | primaries.js:1:1:32:17 | | -| primaries.js:27:8:27:26 | 'epytotorp'.reverse | primaries.js:1:1:32:17 | | -| primaries.js:27:8:27:28 | 'epytot ... verse() | primaries.js:1:1:32:17 | | -| primaries.js:27:20:27:26 | reverse | primaries.js:1:1:32:17 | | -| primaries.js:28:1:28:6 | ((42)) | primaries.js:1:1:32:17 | | -| primaries.js:28:2:28:5 | (42) | primaries.js:1:1:32:17 | | -| primaries.js:28:3:28:4 | 42 | primaries.js:1:1:32:17 | | -| primaries.js:29:1:29:13 | /\\2147483648/ | primaries.js:1:1:32:17 | | -| primaries.js:30:1:30:26 | /a{2147 ... 83649}/ | primaries.js:1:1:32:17 | | -| primaries.js:31:1:31:16 | /a{-2147483648}/ | primaries.js:1:1:32:17 | | -| primaries.js:32:1:32:16 | /a{-2147483649}/ | primaries.js:1:1:32:17 | | -| surrogates.js:1:5:1:5 | a | surrogates.js:1:1:4:15 | | -| surrogates.js:1:5:1:16 | a = "\\ud800" | surrogates.js:1:1:4:15 | | -| surrogates.js:1:9:1:16 | "\\ud800" | surrogates.js:1:1:4:15 | | -| surrogates.js:2:1:2:8 | /\\uD800/ | surrogates.js:1:1:4:15 | | -| surrogates.js:2:1:2:13 | /\\uD800/.test | surrogates.js:1:1:4:15 | | -| surrogates.js:2:1:2:16 | /\\uD800/.test(a) | surrogates.js:1:1:4:15 | | -| surrogates.js:2:10:2:13 | test | surrogates.js:1:1:4:15 | | -| surrogates.js:2:15:2:15 | a | surrogates.js:1:1:4:15 | | -| surrogates.js:3:1:3:14 | "\\uD834\\uDF06" | surrogates.js:1:1:4:15 | | -| surrogates.js:4:1:4:14 | '\\udc00\\ud800' | surrogates.js:1:1:4:15 | | -| unary.js:1:1:1:3 | -23 | unary.js:1:1:7:24 | | -| unary.js:1:2:1:3 | 23 | unary.js:1:1:7:24 | | -| unary.js:2:1:2:3 | +42 | unary.js:1:1:7:24 | | -| unary.js:2:2:2:3 | 42 | unary.js:1:1:7:24 | | -| unary.js:3:1:3:5 | !true | unary.js:1:1:7:24 | | -| unary.js:3:2:3:5 | true | unary.js:1:1:7:24 | | -| unary.js:4:1:4:2 | ~2 | unary.js:1:1:7:24 | | -| unary.js:4:2:4:2 | 2 | unary.js:1:1:7:24 | | -| unary.js:5:1:5:13 | typeof Object | unary.js:1:1:7:24 | | -| unary.js:5:8:5:13 | Object | unary.js:1:1:7:24 | | -| unary.js:6:1:6:7 | void(0) | unary.js:1:1:7:24 | | -| unary.js:6:5:6:7 | (0) | unary.js:1:1:7:24 | | -| unary.js:6:6:6:6 | 0 | unary.js:1:1:7:24 | | -| unary.js:7:1:7:23 | delete ... ototype | unary.js:1:1:7:24 | | -| unary.js:7:8:7:13 | Object | unary.js:1:1:7:24 | | -| unary.js:7:8:7:23 | Object.prototype | unary.js:1:1:7:24 | | -| unary.js:7:15:7:23 | prototype | unary.js:1:1:7:24 | | -| update.js:1:1:1:3 | ++a | update.js:1:1:5:0 | | -| update.js:1:3:1:3 | a | update.js:1:1:5:0 | | -| update.js:2:1:2:1 | a | update.js:1:1:5:0 | | -| update.js:2:1:2:3 | a++ | update.js:1:1:5:0 | | -| update.js:3:1:3:3 | --b | update.js:1:1:5:0 | | -| update.js:3:3:3:3 | b | update.js:1:1:5:0 | | -| update.js:4:1:4:1 | b | update.js:1:1:5:0 | | -| update.js:4:1:4:3 | b-- | update.js:1:1:5:0 | | diff --git a/javascript/ql/test/library-tests/Expr/getContainer.ql b/javascript/ql/test/library-tests/Expr/getContainer.ql deleted file mode 100644 index 33e4653ac5a2..000000000000 --- a/javascript/ql/test/library-tests/Expr/getContainer.ql +++ /dev/null @@ -1,4 +0,0 @@ -import javascript - -from Expr e -select e, e.getContainer() diff --git a/javascript/ql/test/library-tests/Expr/getContainer.qll b/javascript/ql/test/library-tests/Expr/getContainer.qll new file mode 100644 index 000000000000..28a1d7613bd3 --- /dev/null +++ b/javascript/ql/test/library-tests/Expr/getContainer.qll @@ -0,0 +1,3 @@ +import javascript + +query predicate test_getContainer(Expr e, StmtContainer res) { res = e.getContainer() } diff --git a/javascript/ql/test/library-tests/Expr/getEnclosingFunction.expected b/javascript/ql/test/library-tests/Expr/getEnclosingFunction.expected deleted file mode 100644 index 3fd0c6d96a1b..000000000000 --- a/javascript/ql/test/library-tests/Expr/getEnclosingFunction.expected +++ /dev/null @@ -1,73 +0,0 @@ -| es2015.js:1:24:1:24 | s | es2015.js:1:24:1:36 | s => s.length | -| es2015.js:1:29:1:29 | s | es2015.js:1:24:1:36 | s => s.length | -| es2015.js:1:29:1:36 | s.length | es2015.js:1:24:1:36 | s => s.length | -| es2015.js:1:31:1:36 | length | es2015.js:1:24:1:36 | s => s.length | -| es2015.js:2:19:2:23 | ++cnt | es2015.js:2:13:2:23 | () => ++cnt | -| es2015.js:2:21:2:23 | cnt | es2015.js:2:13:2:23 | () => ++cnt | -| es2015.js:3:20:3:24 | alert | es2015.js:3:12:3:39 | () => { ... p!"); } | -| es2015.js:3:20:3:36 | alert("Wake up!") | es2015.js:3:12:3:39 | () => { ... p!"); } | -| es2015.js:3:26:3:35 | "Wake up!" | es2015.js:3:12:3:39 | () => { ... p!"); } | -| es2015.js:8:10:8:10 | f | es2015.js:8:1:15:1 | functio ... );\\n\\t}\\n} | -| es2015.js:8:12:8:17 | [x, y] | es2015.js:8:1:15:1 | functio ... );\\n\\t}\\n} | -| es2015.js:8:13:8:13 | x | es2015.js:8:1:15:1 | functio ... );\\n\\t}\\n} | -| es2015.js:8:16:8:16 | y | es2015.js:8:1:15:1 | functio ... );\\n\\t}\\n} | -| es2015.js:9:6:9:15 | [a, [, c]] | es2015.js:8:1:15:1 | functio ... );\\n\\t}\\n} | -| es2015.js:9:6:9:19 | [a, [, c]] = x | es2015.js:8:1:15:1 | functio ... );\\n\\t}\\n} | -| es2015.js:9:7:9:7 | a | es2015.js:8:1:15:1 | functio ... );\\n\\t}\\n} | -| es2015.js:9:10:9:14 | [, c] | es2015.js:8:1:15:1 | functio ... );\\n\\t}\\n} | -| es2015.js:9:13:9:13 | c | es2015.js:8:1:15:1 | functio ... );\\n\\t}\\n} | -| es2015.js:9:19:9:19 | x | es2015.js:8:1:15:1 | functio ... );\\n\\t}\\n} | -| es2015.js:11:9:11:14 | [a, c] | es2015.js:8:1:15:1 | functio ... );\\n\\t}\\n} | -| es2015.js:11:10:11:10 | a | es2015.js:8:1:15:1 | functio ... );\\n\\t}\\n} | -| es2015.js:11:13:11:13 | c | es2015.js:8:1:15:1 | functio ... );\\n\\t}\\n} | -| es2015.js:12:11:12:11 | d | es2015.js:8:1:15:1 | functio ... );\\n\\t}\\n} | -| es2015.js:13:3:13:9 | console | es2015.js:8:1:15:1 | functio ... );\\n\\t}\\n} | -| es2015.js:13:3:13:13 | console.log | es2015.js:8:1:15:1 | functio ... );\\n\\t}\\n} | -| es2015.js:13:3:13:16 | console.log(d) | es2015.js:8:1:15:1 | functio ... );\\n\\t}\\n} | -| es2015.js:13:11:13:13 | log | es2015.js:8:1:15:1 | functio ... );\\n\\t}\\n} | -| es2015.js:13:15:13:15 | d | es2015.js:8:1:15:1 | functio ... );\\n\\t}\\n} | -| es2015.js:17:10:17:10 | g | es2015.js:17:1:20:1 | functio ... rn w;\\n} | -| es2015.js:17:12:17:22 | { x, y: z } | es2015.js:17:1:20:1 | functio ... rn w;\\n} | -| es2015.js:17:14:17:14 | x | es2015.js:17:1:20:1 | functio ... rn w;\\n} | -| es2015.js:17:14:17:14 | x | es2015.js:17:1:20:1 | functio ... rn w;\\n} | -| es2015.js:17:17:17:17 | y | es2015.js:17:1:20:1 | functio ... rn w;\\n} | -| es2015.js:17:20:17:20 | z | es2015.js:17:1:20:1 | functio ... rn w;\\n} | -| es2015.js:18:6:18:15 | { [x]: w } | es2015.js:17:1:20:1 | functio ... rn w;\\n} | -| es2015.js:18:6:18:19 | { [x]: w } = z | es2015.js:17:1:20:1 | functio ... rn w;\\n} | -| es2015.js:18:9:18:9 | x | es2015.js:17:1:20:1 | functio ... rn w;\\n} | -| es2015.js:18:13:18:13 | w | es2015.js:17:1:20:1 | functio ... rn w;\\n} | -| es2015.js:18:19:18:19 | z | es2015.js:17:1:20:1 | functio ... rn w;\\n} | -| es2015.js:19:9:19:9 | w | es2015.js:17:1:20:1 | functio ... rn w;\\n} | -| es2015.js:22:11:22:13 | foo | es2015.js:22:1:26:1 | functio ... o(1);\\n} | -| es2015.js:22:15:22:15 | n | es2015.js:22:1:26:1 | functio ... o(1);\\n} | -| es2015.js:23:8:23:8 | n | es2015.js:22:1:26:1 | functio ... o(1);\\n} | -| es2015.js:23:8:23:10 | n-- | es2015.js:22:1:26:1 | functio ... o(1);\\n} | -| es2015.js:23:8:23:12 | n-->0 | es2015.js:22:1:26:1 | functio ... o(1);\\n} | -| es2015.js:23:12:23:12 | 0 | es2015.js:22:1:26:1 | functio ... o(1);\\n} | -| es2015.js:24:3:24:9 | yield n | es2015.js:22:1:26:1 | functio ... o(1);\\n} | -| es2015.js:24:9:24:9 | n | es2015.js:22:1:26:1 | functio ... o(1);\\n} | -| es2015.js:25:2:25:14 | yield* foo(1) | es2015.js:22:1:26:1 | functio ... o(1);\\n} | -| es2015.js:25:9:25:11 | foo | es2015.js:22:1:26:1 | functio ... o(1);\\n} | -| es2015.js:25:9:25:14 | foo(1) | es2015.js:22:1:26:1 | functio ... o(1);\\n} | -| es2015.js:25:13:25:13 | 1 | es2015.js:22:1:26:1 | functio ... o(1);\\n} | -| es2015.js:28:10:28:12 | bar | es2015.js:28:1:28:26 | functio ... +19) {} | -| es2015.js:28:14:28:14 | x | es2015.js:28:1:28:26 | functio ... +19) {} | -| es2015.js:28:17:28:17 | y | es2015.js:28:1:28:26 | functio ... +19) {} | -| es2015.js:28:19:28:19 | x | es2015.js:28:1:28:26 | functio ... +19) {} | -| es2015.js:28:19:28:22 | x+19 | es2015.js:28:1:28:26 | functio ... +19) {} | -| es2015.js:28:21:28:22 | 19 | es2015.js:28:1:28:26 | functio ... +19) {} | -| functions.js:1:10:1:10 | f | functions.js:1:1:9:1 | functio ... \\t\\t});\\n} | -| functions.js:2:2:2:5 | in_f | functions.js:1:1:9:1 | functio ... \\t\\t});\\n} | -| functions.js:3:9:3:17 | also_in_f | functions.js:1:1:9:1 | functio ... \\t\\t});\\n} | -| functions.js:4:3:6:4 | (functi ... f;\\n\\t\\t}) | functions.js:1:1:9:1 | functio ... \\t\\t});\\n} | -| functions.js:4:3:8:4 | (functi ... in\\n\\t\\t}) | functions.js:1:1:9:1 | functio ... \\t\\t});\\n} | -| functions.js:4:4:6:3 | functio ... _f;\\n\\t\\t} | functions.js:1:1:9:1 | functio ... \\t\\t});\\n} | -| functions.js:5:4:5:11 | not_in_f | functions.js:4:4:6:3 | functio ... _f;\\n\\t\\t} | -| functions.js:6:6:8:3 | {\\n\\t\\t\\tx: ... ain\\n\\t\\t} | functions.js:1:1:9:1 | functio ... \\t\\t});\\n} | -| functions.js:7:4:7:4 | x | functions.js:1:1:9:1 | functio ... \\t\\t});\\n} | -| functions.js:7:7:7:16 | in_f_again | functions.js:1:1:9:1 | functio ... \\t\\t});\\n} | -| mozextensions.js:1:20:1:20 | x | mozextensions.js:1:11:1:25 | function(x) x+1 | -| mozextensions.js:1:23:1:23 | x | mozextensions.js:1:11:1:25 | function(x) x+1 | -| mozextensions.js:1:23:1:25 | x+1 | mozextensions.js:1:11:1:25 | function(x) x+1 | -| mozextensions.js:1:25:1:25 | 1 | mozextensions.js:1:11:1:25 | function(x) x+1 | -| primaries.js:21:10:21:10 | v | primaries.js:21:9:21:14 | (v) {} | diff --git a/javascript/ql/test/library-tests/Expr/getEnclosingFunction.ql b/javascript/ql/test/library-tests/Expr/getEnclosingFunction.ql deleted file mode 100644 index 29fd967cd4ff..000000000000 --- a/javascript/ql/test/library-tests/Expr/getEnclosingFunction.ql +++ /dev/null @@ -1,4 +0,0 @@ -import javascript - -from Expr e -select e, e.getEnclosingFunction() diff --git a/javascript/ql/test/library-tests/Expr/getEnclosingFunction.qll b/javascript/ql/test/library-tests/Expr/getEnclosingFunction.qll new file mode 100644 index 000000000000..09a54e7a8965 --- /dev/null +++ b/javascript/ql/test/library-tests/Expr/getEnclosingFunction.qll @@ -0,0 +1,3 @@ +import javascript + +query predicate test_getEnclosingFunction(Expr e, Function res) { res = e.getEnclosingFunction() } diff --git a/javascript/ql/test/library-tests/Expr/getEnclosingStmt.expected b/javascript/ql/test/library-tests/Expr/getEnclosingStmt.expected deleted file mode 100644 index af674cef90ea..000000000000 --- a/javascript/ql/test/library-tests/Expr/getEnclosingStmt.expected +++ /dev/null @@ -1,301 +0,0 @@ -| assignment.js:1:1:1:1 | a | assignment.js:1:1:1:7 | a = 23; | -| assignment.js:1:1:1:6 | a = 23 | assignment.js:1:1:1:7 | a = 23; | -| assignment.js:1:5:1:6 | 23 | assignment.js:1:1:1:7 | a = 23; | -| assignment.js:2:1:2:1 | a | assignment.js:2:1:2:8 | a += 19; | -| assignment.js:2:1:2:7 | a += 19 | assignment.js:2:1:2:8 | a += 19; | -| assignment.js:2:6:2:7 | 19 | assignment.js:2:1:2:8 | a += 19; | -| assignment.js:3:1:3:1 | a | assignment.js:3:1:3:7 | a -= 9; | -| assignment.js:3:1:3:6 | a -= 9 | assignment.js:3:1:3:7 | a -= 9; | -| assignment.js:3:6:3:6 | 9 | assignment.js:3:1:3:7 | a -= 9; | -| assignment.js:4:1:4:1 | a | assignment.js:4:1:4:7 | a *= b; | -| assignment.js:4:1:4:6 | a *= b | assignment.js:4:1:4:7 | a *= b; | -| assignment.js:4:6:4:6 | b | assignment.js:4:1:4:7 | a *= b; | -| assignment.js:5:1:5:1 | a | assignment.js:5:1:5:7 | a /= 2; | -| assignment.js:5:1:5:6 | a /= 2 | assignment.js:5:1:5:7 | a /= 2; | -| assignment.js:5:6:5:6 | 2 | assignment.js:5:1:5:7 | a /= 2; | -| assignment.js:6:1:6:1 | a | assignment.js:6:1:6:7 | a %= 2; | -| assignment.js:6:1:6:6 | a %= 2 | assignment.js:6:1:6:7 | a %= 2; | -| assignment.js:6:6:6:6 | 2 | assignment.js:6:1:6:7 | a %= 2; | -| assignment.js:7:1:7:1 | a | assignment.js:7:1:7:8 | a <<= 8; | -| assignment.js:7:1:7:7 | a <<= 8 | assignment.js:7:1:7:8 | a <<= 8; | -| assignment.js:7:7:7:7 | 8 | assignment.js:7:1:7:8 | a <<= 8; | -| assignment.js:8:1:8:1 | a | assignment.js:8:1:8:8 | a >>= 7; | -| assignment.js:8:1:8:7 | a >>= 7 | assignment.js:8:1:8:8 | a >>= 7; | -| assignment.js:8:7:8:7 | 7 | assignment.js:8:1:8:8 | a >>= 7; | -| assignment.js:9:1:9:1 | a | assignment.js:9:1:9:9 | a >>>= 2; | -| assignment.js:9:1:9:8 | a >>>= 2 | assignment.js:9:1:9:9 | a >>>= 2; | -| assignment.js:9:8:9:8 | 2 | assignment.js:9:1:9:9 | a >>>= 2; | -| assignment.js:10:1:10:1 | a | assignment.js:10:1:10:7 | a \|= 2; | -| assignment.js:10:1:10:6 | a \|= 2 | assignment.js:10:1:10:7 | a \|= 2; | -| assignment.js:10:6:10:6 | 2 | assignment.js:10:1:10:7 | a \|= 2; | -| assignment.js:11:1:11:1 | a | assignment.js:11:1:11:7 | a ^= 1; | -| assignment.js:11:1:11:6 | a ^= 1 | assignment.js:11:1:11:7 | a ^= 1; | -| assignment.js:11:6:11:6 | 1 | assignment.js:11:1:11:7 | a ^= 1; | -| assignment.js:12:1:12:1 | a | assignment.js:12:1:12:7 | a &= 3; | -| assignment.js:12:1:12:6 | a &= 3 | assignment.js:12:1:12:7 | a &= 3; | -| assignment.js:12:6:12:6 | 3 | assignment.js:12:1:12:7 | a &= 3; | -| binary.js:1:1:1:1 | 1 | binary.js:1:1:1:7 | 1 << 2; | -| binary.js:1:1:1:6 | 1 << 2 | binary.js:1:1:1:7 | 1 << 2; | -| binary.js:1:6:1:6 | 2 | binary.js:1:1:1:7 | 1 << 2; | -| binary.js:2:1:2:1 | 2 | binary.js:2:1:2:7 | 2 >> 1; | -| binary.js:2:1:2:6 | 2 >> 1 | binary.js:2:1:2:7 | 2 >> 1; | -| binary.js:2:6:2:6 | 1 | binary.js:2:1:2:7 | 2 >> 1; | -| binary.js:3:1:3:1 | 2 | binary.js:3:1:3:8 | 2 >>> 1; | -| binary.js:3:1:3:7 | 2 >>> 1 | binary.js:3:1:3:8 | 2 >>> 1; | -| binary.js:3:7:3:7 | 1 | binary.js:3:1:3:8 | 2 >>> 1; | -| binary.js:4:1:4:2 | 23 | binary.js:4:1:4:8 | 23 + 19; | -| binary.js:4:1:4:7 | 23 + 19 | binary.js:4:1:4:8 | 23 + 19; | -| binary.js:4:6:4:7 | 19 | binary.js:4:1:4:8 | 23 + 19; | -| binary.js:5:1:5:2 | 42 | binary.js:5:1:5:8 | 42 - 19; | -| binary.js:5:1:5:7 | 42 - 19 | binary.js:5:1:5:8 | 42 - 19; | -| binary.js:5:6:5:7 | 19 | binary.js:5:1:5:8 | 42 - 19; | -| binary.js:6:1:6:1 | 2 | binary.js:6:1:6:6 | 2 * 3; | -| binary.js:6:1:6:5 | 2 * 3 | binary.js:6:1:6:6 | 2 * 3; | -| binary.js:6:5:6:5 | 3 | binary.js:6:1:6:6 | 2 * 3; | -| binary.js:7:1:7:1 | 8 | binary.js:7:1:7:6 | 8 / 5; | -| binary.js:7:1:7:5 | 8 / 5 | binary.js:7:1:7:6 | 8 / 5; | -| binary.js:7:5:7:5 | 5 | binary.js:7:1:7:6 | 8 / 5; | -| binary.js:8:1:8:1 | 2 | binary.js:8:1:8:6 | 2 % 1; | -| binary.js:8:1:8:5 | 2 % 1 | binary.js:8:1:8:6 | 2 % 1; | -| binary.js:8:5:8:5 | 1 | binary.js:8:1:8:6 | 2 % 1; | -| binary.js:9:1:9:1 | 2 | binary.js:9:1:9:6 | 2 \| 3; | -| binary.js:9:1:9:5 | 2 \| 3 | binary.js:9:1:9:6 | 2 \| 3; | -| binary.js:9:5:9:5 | 3 | binary.js:9:1:9:6 | 2 \| 3; | -| binary.js:10:1:10:1 | 2 | binary.js:10:1:10:6 | 2 ^ 3; | -| binary.js:10:1:10:5 | 2 ^ 3 | binary.js:10:1:10:6 | 2 ^ 3; | -| binary.js:10:5:10:5 | 3 | binary.js:10:1:10:6 | 2 ^ 3; | -| binary.js:11:1:11:1 | 2 | binary.js:11:1:11:6 | 2 & 3; | -| binary.js:11:1:11:5 | 2 & 3 | binary.js:11:1:11:6 | 2 & 3; | -| binary.js:11:5:11:5 | 3 | binary.js:11:1:11:6 | 2 & 3; | -| binary.js:12:1:12:11 | 'prototype' | binary.js:12:1:12:22 | 'protot ... Object; | -| binary.js:12:1:12:21 | 'protot ... Object | binary.js:12:1:12:22 | 'protot ... Object; | -| binary.js:12:16:12:21 | Object | binary.js:12:1:12:22 | 'protot ... Object; | -| binary.js:13:1:13:2 | [] | binary.js:13:1:13:20 | [] instanceof Array; | -| binary.js:13:1:13:19 | [] instanceof Array | binary.js:13:1:13:20 | [] instanceof Array; | -| binary.js:13:15:13:19 | Array | binary.js:13:1:13:20 | [] instanceof Array; | -| binary.js:14:1:14:1 | 1 | binary.js:14:1:14:7 | 1 && 2; | -| binary.js:14:1:14:6 | 1 && 2 | binary.js:14:1:14:7 | 1 && 2; | -| binary.js:14:6:14:6 | 2 | binary.js:14:1:14:7 | 1 && 2; | -| binary.js:15:1:15:1 | 1 | binary.js:15:1:15:7 | 1 \|\| 2; | -| binary.js:15:1:15:6 | 1 \|\| 2 | binary.js:15:1:15:7 | 1 \|\| 2; | -| binary.js:15:6:15:6 | 2 | binary.js:15:1:15:7 | 1 \|\| 2; | -| comparison.js:1:1:1:1 | 1 | comparison.js:1:1:1:7 | 1 == 1; | -| comparison.js:1:1:1:6 | 1 == 1 | comparison.js:1:1:1:7 | 1 == 1; | -| comparison.js:1:6:1:6 | 1 | comparison.js:1:1:1:7 | 1 == 1; | -| comparison.js:2:1:2:1 | 1 | comparison.js:2:1:2:7 | 1 != 2; | -| comparison.js:2:1:2:6 | 1 != 2 | comparison.js:2:1:2:7 | 1 != 2; | -| comparison.js:2:6:2:6 | 2 | comparison.js:2:1:2:7 | 1 != 2; | -| comparison.js:3:1:3:1 | 1 | comparison.js:3:1:3:8 | 1 === 1; | -| comparison.js:3:1:3:7 | 1 === 1 | comparison.js:3:1:3:8 | 1 === 1; | -| comparison.js:3:7:3:7 | 1 | comparison.js:3:1:3:8 | 1 === 1; | -| comparison.js:4:1:4:1 | 1 | comparison.js:4:1:4:8 | 1 !== 2; | -| comparison.js:4:1:4:7 | 1 !== 2 | comparison.js:4:1:4:8 | 1 !== 2; | -| comparison.js:4:7:4:7 | 2 | comparison.js:4:1:4:8 | 1 !== 2; | -| comparison.js:5:1:5:1 | 1 | comparison.js:5:1:5:6 | 1 < 2; | -| comparison.js:5:1:5:5 | 1 < 2 | comparison.js:5:1:5:6 | 1 < 2; | -| comparison.js:5:5:5:5 | 2 | comparison.js:5:1:5:6 | 1 < 2; | -| comparison.js:6:1:6:1 | 1 | comparison.js:6:1:6:7 | 1 <= 2; | -| comparison.js:6:1:6:6 | 1 <= 2 | comparison.js:6:1:6:7 | 1 <= 2; | -| comparison.js:6:6:6:6 | 2 | comparison.js:6:1:6:7 | 1 <= 2; | -| comparison.js:7:1:7:1 | 2 | comparison.js:7:1:7:6 | 2 > 1; | -| comparison.js:7:1:7:5 | 2 > 1 | comparison.js:7:1:7:6 | 2 > 1; | -| comparison.js:7:5:7:5 | 1 | comparison.js:7:1:7:6 | 2 > 1; | -| comparison.js:8:1:8:1 | 2 | comparison.js:8:1:8:7 | 2 >= 1; | -| comparison.js:8:1:8:6 | 2 >= 1 | comparison.js:8:1:8:7 | 2 >= 1; | -| comparison.js:8:6:8:6 | 1 | comparison.js:8:1:8:7 | 2 >= 1; | -| es2015.js:1:1:1:18 | ["a", "ab", "abc"] | es2015.js:1:1:1:38 | ["a", " ... ength); | -| es2015.js:1:1:1:22 | ["a", " ... c"].map | es2015.js:1:1:1:38 | ["a", " ... ength); | -| es2015.js:1:1:1:37 | ["a", " ... length) | es2015.js:1:1:1:38 | ["a", " ... ength); | -| es2015.js:1:2:1:4 | "a" | es2015.js:1:1:1:38 | ["a", " ... ength); | -| es2015.js:1:7:1:10 | "ab" | es2015.js:1:1:1:38 | ["a", " ... ength); | -| es2015.js:1:13:1:17 | "abc" | es2015.js:1:1:1:38 | ["a", " ... ength); | -| es2015.js:1:20:1:22 | map | es2015.js:1:1:1:38 | ["a", " ... ength); | -| es2015.js:1:24:1:36 | s => s.length | es2015.js:1:1:1:38 | ["a", " ... ength); | -| es2015.js:2:1:2:11 | setInterval | es2015.js:2:1:2:31 | setInte ... 1000); | -| es2015.js:2:1:2:30 | setInte ... , 1000) | es2015.js:2:1:2:31 | setInte ... 1000); | -| es2015.js:2:13:2:23 | () => ++cnt | es2015.js:2:1:2:31 | setInte ... 1000); | -| es2015.js:2:26:2:29 | 1000 | es2015.js:2:1:2:31 | setInte ... 1000); | -| es2015.js:3:1:3:10 | setTimeout | es2015.js:3:1:3:48 | setTime ... 60000); | -| es2015.js:3:1:3:47 | setTime ... 60000) | es2015.js:3:1:3:48 | setTime ... 60000); | -| es2015.js:3:12:3:39 | () => { ... p!"); } | es2015.js:3:1:3:48 | setTime ... 60000); | -| es2015.js:3:20:3:24 | alert | es2015.js:3:20:3:37 | alert("Wake up!"); | -| es2015.js:3:20:3:36 | alert("Wake up!") | es2015.js:3:20:3:37 | alert("Wake up!"); | -| es2015.js:3:26:3:35 | "Wake up!" | es2015.js:3:20:3:37 | alert("Wake up!"); | -| es2015.js:3:42:3:46 | 60000 | es2015.js:3:1:3:48 | setTime ... 60000); | -| es2015.js:5:1:5:10 | [a, ...as] | es2015.js:5:1:5:11 | [a, ...as]; | -| es2015.js:5:2:5:2 | a | es2015.js:5:1:5:11 | [a, ...as]; | -| es2015.js:5:5:5:9 | ...as | es2015.js:5:1:5:11 | [a, ...as]; | -| es2015.js:5:8:5:9 | as | es2015.js:5:1:5:11 | [a, ...as]; | -| es2015.js:6:1:6:18 | new Array(...elts) | es2015.js:6:1:6:19 | new Array(...elts); | -| es2015.js:6:5:6:9 | Array | es2015.js:6:1:6:19 | new Array(...elts); | -| es2015.js:6:11:6:17 | ...elts | es2015.js:6:1:6:19 | new Array(...elts); | -| es2015.js:6:14:6:17 | elts | es2015.js:6:1:6:19 | new Array(...elts); | -| es2015.js:9:6:9:15 | [a, [, c]] | es2015.js:9:2:9:20 | var [a, [, c]] = x; | -| es2015.js:9:6:9:19 | [a, [, c]] = x | es2015.js:9:2:9:20 | var [a, [, c]] = x; | -| es2015.js:9:7:9:7 | a | es2015.js:9:2:9:20 | var [a, [, c]] = x; | -| es2015.js:9:10:9:14 | [, c] | es2015.js:9:2:9:20 | var [a, [, c]] = x; | -| es2015.js:9:13:9:13 | c | es2015.js:9:2:9:20 | var [a, [, c]] = x; | -| es2015.js:9:19:9:19 | x | es2015.js:9:2:9:20 | var [a, [, c]] = x; | -| es2015.js:11:9:11:14 | [a, c] | es2015.js:11:3:11:15 | throw [a, c]; | -| es2015.js:11:10:11:10 | a | es2015.js:11:3:11:15 | throw [a, c]; | -| es2015.js:11:13:11:13 | c | es2015.js:11:3:11:15 | throw [a, c]; | -| es2015.js:12:11:12:11 | d | es2015.js:12:4:14:2 | catch ( ... (d);\\n\\t} | -| es2015.js:13:3:13:9 | console | es2015.js:13:3:13:17 | console.log(d); | -| es2015.js:13:3:13:13 | console.log | es2015.js:13:3:13:17 | console.log(d); | -| es2015.js:13:3:13:16 | console.log(d) | es2015.js:13:3:13:17 | console.log(d); | -| es2015.js:13:11:13:13 | log | es2015.js:13:3:13:17 | console.log(d); | -| es2015.js:13:15:13:15 | d | es2015.js:13:3:13:17 | console.log(d); | -| es2015.js:18:6:18:15 | { [x]: w } | es2015.js:18:2:18:20 | var { [x]: w } = z; | -| es2015.js:18:6:18:19 | { [x]: w } = z | es2015.js:18:2:18:20 | var { [x]: w } = z; | -| es2015.js:18:9:18:9 | x | es2015.js:18:2:18:20 | var { [x]: w } = z; | -| es2015.js:18:13:18:13 | w | es2015.js:18:2:18:20 | var { [x]: w } = z; | -| es2015.js:18:19:18:19 | z | es2015.js:18:2:18:20 | var { [x]: w } = z; | -| es2015.js:19:9:19:9 | w | es2015.js:19:2:19:10 | return w; | -| es2015.js:23:8:23:8 | n | es2015.js:23:2:24:10 | while(n ... ield n; | -| es2015.js:23:8:23:10 | n-- | es2015.js:23:2:24:10 | while(n ... ield n; | -| es2015.js:23:8:23:12 | n-->0 | es2015.js:23:2:24:10 | while(n ... ield n; | -| es2015.js:23:12:23:12 | 0 | es2015.js:23:2:24:10 | while(n ... ield n; | -| es2015.js:24:3:24:9 | yield n | es2015.js:24:3:24:10 | yield n; | -| es2015.js:24:9:24:9 | n | es2015.js:24:3:24:10 | yield n; | -| es2015.js:25:2:25:14 | yield* foo(1) | es2015.js:25:2:25:15 | yield* foo(1); | -| es2015.js:25:9:25:11 | foo | es2015.js:25:2:25:15 | yield* foo(1); | -| es2015.js:25:9:25:14 | foo(1) | es2015.js:25:2:25:15 | yield* foo(1); | -| es2015.js:25:13:25:13 | 1 | es2015.js:25:2:25:15 | yield* foo(1); | -| functions.js:2:2:2:5 | in_f | functions.js:2:2:2:6 | in_f; | -| functions.js:3:9:3:17 | also_in_f | functions.js:3:2:8:5 | while ( ... n\\n\\t\\t}); | -| functions.js:4:3:6:4 | (functi ... f;\\n\\t\\t}) | functions.js:4:3:8:5 | (functi ... n\\n\\t\\t}); | -| functions.js:4:3:8:4 | (functi ... in\\n\\t\\t}) | functions.js:4:3:8:5 | (functi ... n\\n\\t\\t}); | -| functions.js:4:4:6:3 | functio ... _f;\\n\\t\\t} | functions.js:4:3:8:5 | (functi ... n\\n\\t\\t}); | -| functions.js:5:4:5:11 | not_in_f | functions.js:5:4:5:12 | not_in_f; | -| functions.js:6:6:8:3 | {\\n\\t\\t\\tx: ... ain\\n\\t\\t} | functions.js:4:3:8:5 | (functi ... n\\n\\t\\t}); | -| functions.js:7:4:7:4 | x | functions.js:4:3:8:5 | (functi ... n\\n\\t\\t}); | -| functions.js:7:7:7:16 | in_f_again | functions.js:4:3:8:5 | (functi ... n\\n\\t\\t}); | -| functions.js:10:1:10:6 | global | functions.js:10:1:10:7 | global; | -| legacyletexpr.js:1:1:1:7 | console | legacyletexpr.js:1:1:1:40 | console ... x + y); | -| legacyletexpr.js:1:1:1:11 | console.log | legacyletexpr.js:1:1:1:40 | console ... x + y); | -| legacyletexpr.js:1:1:1:39 | console ... x + y) | legacyletexpr.js:1:1:1:40 | console ... x + y); | -| legacyletexpr.js:1:9:1:11 | log | legacyletexpr.js:1:1:1:40 | console ... x + y); | -| legacyletexpr.js:1:13:1:38 | let (x ... ) x + y | legacyletexpr.js:1:1:1:40 | console ... x + y); | -| legacyletexpr.js:1:18:1:18 | x | legacyletexpr.js:1:1:1:40 | console ... x + y); | -| legacyletexpr.js:1:18:1:23 | x = 23 | legacyletexpr.js:1:1:1:40 | console ... x + y); | -| legacyletexpr.js:1:22:1:23 | 23 | legacyletexpr.js:1:1:1:40 | console ... x + y); | -| legacyletexpr.js:1:26:1:26 | y | legacyletexpr.js:1:1:1:40 | console ... x + y); | -| legacyletexpr.js:1:26:1:31 | y = 19 | legacyletexpr.js:1:1:1:40 | console ... x + y); | -| legacyletexpr.js:1:30:1:31 | 19 | legacyletexpr.js:1:1:1:40 | console ... x + y); | -| legacyletexpr.js:1:34:1:34 | x | legacyletexpr.js:1:1:1:40 | console ... x + y); | -| legacyletexpr.js:1:34:1:38 | x + y | legacyletexpr.js:1:1:1:40 | console ... x + y); | -| legacyletexpr.js:1:38:1:38 | y | legacyletexpr.js:1:1:1:40 | console ... x + y); | -| mozextensions.js:1:1:1:5 | array | mozextensions.js:1:1:1:27 | array.m ... ) x+1); | -| mozextensions.js:1:1:1:9 | array.map | mozextensions.js:1:1:1:27 | array.m ... ) x+1); | -| mozextensions.js:1:1:1:26 | array.m ... x) x+1) | mozextensions.js:1:1:1:27 | array.m ... ) x+1); | -| mozextensions.js:1:7:1:9 | map | mozextensions.js:1:1:1:27 | array.m ... ) x+1); | -| mozextensions.js:1:11:1:25 | function(x) x+1 | mozextensions.js:1:1:1:27 | array.m ... ) x+1); | -| others.js:1:1:1:2 | 23 | others.js:1:1:1:7 | 23, 42; | -| others.js:1:1:1:6 | 23, 42 | others.js:1:1:1:7 | 23, 42; | -| others.js:1:5:1:6 | 42 | others.js:1:1:1:7 | 23, 42; | -| others.js:2:1:2:2 | 23 | others.js:2:1:2:11 | 23, 42, 56; | -| others.js:2:1:2:10 | 23, 42, 56 | others.js:2:1:2:11 | 23, 42, 56; | -| others.js:2:5:2:6 | 42 | others.js:2:1:2:11 | 23, 42, 56; | -| others.js:2:9:2:10 | 56 | others.js:2:1:2:11 | 23, 42, 56; | -| others.js:3:1:3:4 | true | others.js:3:1:3:13 | true ? 0 : 1; | -| others.js:3:1:3:12 | true ? 0 : 1 | others.js:3:1:3:13 | true ? 0 : 1; | -| others.js:3:8:3:8 | 0 | others.js:3:1:3:13 | true ? 0 : 1; | -| others.js:3:12:3:12 | 1 | others.js:3:1:3:13 | true ? 0 : 1; | -| others.js:4:10:4:10 | p | others.js:4:6:4:10 | var p | -| others.js:4:10:4:10 | p | others.js:4:6:4:10 | var p | -| others.js:4:15:4:15 | o | others.js:4:1:5:2 | for (var p in o)\\n\\t; | -| primaries.js:1:1:1:4 | null | primaries.js:1:1:1:5 | null; | -| primaries.js:2:1:2:4 | true | primaries.js:2:1:2:5 | true; | -| primaries.js:3:1:3:5 | false | primaries.js:3:1:3:6 | false; | -| primaries.js:4:1:4:2 | 23 | primaries.js:4:1:4:3 | 23; | -| primaries.js:5:1:5:3 | 2.3 | primaries.js:5:1:5:4 | 2.3; | -| primaries.js:6:1:6:3 | .42 | primaries.js:6:1:6:4 | .42; | -| primaries.js:7:1:7:6 | 7.6e23 | primaries.js:7:1:7:7 | 7.6e23; | -| primaries.js:8:1:8:5 | 1E-42 | primaries.js:8:1:8:6 | 1E-42; | -| primaries.js:9:1:9:10 | 0xdeadbeef | primaries.js:9:1:9:11 | 0xdeadbeef; | -| primaries.js:10:1:10:7 | "Hello" | primaries.js:10:1:10:8 | "Hello"; | -| primaries.js:11:1:11:7 | 'world' | primaries.js:11:1:11:8 | 'world'; | -| primaries.js:12:1:12:13 | "'what?'\\x0a" | primaries.js:12:1:12:14 | "'what?'\\x0a"; | -| primaries.js:13:1:13:10 | '"why?"\\n' | primaries.js:13:1:13:11 | '"why?"\\n'; | -| primaries.js:14:1:14:15 | /^(need?le)+/gi | primaries.js:14:1:14:16 | /^(need?le)+/gi; | -| primaries.js:15:1:15:4 | (23) | primaries.js:15:1:15:5 | (23); | -| primaries.js:15:2:15:3 | 23 | primaries.js:15:1:15:5 | (23); | -| primaries.js:16:1:16:17 | [23, 42, , "hi" ] | primaries.js:16:1:16:18 | [23, 42, , "hi" ]; | -| primaries.js:16:2:16:3 | 23 | primaries.js:16:1:16:18 | [23, 42, , "hi" ]; | -| primaries.js:16:6:16:7 | 42 | primaries.js:16:1:16:18 | [23, 42, , "hi" ]; | -| primaries.js:16:12:16:15 | "hi" | primaries.js:16:1:16:18 | [23, 42, , "hi" ]; | -| primaries.js:17:1:21:16 | ({ x: 2 ... v) {}}) | primaries.js:17:1:21:17 | ({ x: 2 ... ) {}}); | -| primaries.js:17:2:21:15 | { x: 23 ... (v) {}} | primaries.js:17:1:21:17 | ({ x: 2 ... ) {}}); | -| primaries.js:17:4:17:4 | x | primaries.js:17:1:21:17 | ({ x: 2 ... ) {}}); | -| primaries.js:17:7:17:8 | 23 | primaries.js:17:1:21:17 | ({ x: 2 ... ) {}}); | -| primaries.js:18:4:18:4 | y | primaries.js:17:1:21:17 | ({ x: 2 ... ) {}}); | -| primaries.js:18:7:18:10 | this | primaries.js:17:1:21:17 | ({ x: 2 ... ) {}}); | -| primaries.js:19:8:19:8 | o | primaries.js:17:1:21:17 | ({ x: 2 ... ) {}}); | -| primaries.js:19:9:19:13 | () {} | primaries.js:17:1:21:17 | ({ x: 2 ... ) {}}); | -| primaries.js:20:8:20:8 | p | primaries.js:17:1:21:17 | ({ x: 2 ... ) {}}); | -| primaries.js:20:9:20:13 | () {} | primaries.js:17:1:21:17 | ({ x: 2 ... ) {}}); | -| primaries.js:21:8:21:8 | p | primaries.js:17:1:21:17 | ({ x: 2 ... ) {}}); | -| primaries.js:21:9:21:14 | (v) {} | primaries.js:17:1:21:17 | ({ x: 2 ... ) {}}); | -| primaries.js:22:1:22:9 | new Array | primaries.js:22:1:22:10 | new Array; | -| primaries.js:22:5:22:9 | Array | primaries.js:22:1:22:10 | new Array; | -| primaries.js:23:1:23:12 | new Object() | primaries.js:23:1:23:13 | new Object(); | -| primaries.js:23:5:23:10 | Object | primaries.js:23:1:23:13 | new Object(); | -| primaries.js:24:1:24:16 | new String("hi") | primaries.js:24:1:24:17 | new String("hi"); | -| primaries.js:24:5:24:10 | String | primaries.js:24:1:24:17 | new String("hi"); | -| primaries.js:24:12:24:15 | "hi" | primaries.js:24:1:24:17 | new String("hi"); | -| primaries.js:25:1:25:6 | String | primaries.js:25:1:25:11 | String(""); | -| primaries.js:25:1:25:10 | String("") | primaries.js:25:1:25:11 | String(""); | -| primaries.js:25:8:25:9 | "" | primaries.js:25:1:25:11 | String(""); | -| primaries.js:26:1:26:6 | Object | primaries.js:26:1:26:18 | Object.create({}); | -| primaries.js:26:1:26:13 | Object.create | primaries.js:26:1:26:18 | Object.create({}); | -| primaries.js:26:1:26:17 | Object.create({}) | primaries.js:26:1:26:18 | Object.create({}); | -| primaries.js:26:8:26:13 | create | primaries.js:26:1:26:18 | Object.create({}); | -| primaries.js:26:15:26:16 | {} | primaries.js:26:1:26:18 | Object.create({}); | -| primaries.js:27:1:27:6 | String | primaries.js:27:1:27:30 | String[ ... rse()]; | -| primaries.js:27:1:27:29 | String[ ... erse()] | primaries.js:27:1:27:30 | String[ ... rse()]; | -| primaries.js:27:8:27:18 | 'epytotorp' | primaries.js:27:1:27:30 | String[ ... rse()]; | -| primaries.js:27:8:27:26 | 'epytotorp'.reverse | primaries.js:27:1:27:30 | String[ ... rse()]; | -| primaries.js:27:8:27:28 | 'epytot ... verse() | primaries.js:27:1:27:30 | String[ ... rse()]; | -| primaries.js:27:20:27:26 | reverse | primaries.js:27:1:27:30 | String[ ... rse()]; | -| primaries.js:28:1:28:6 | ((42)) | primaries.js:28:1:28:7 | ((42)); | -| primaries.js:28:2:28:5 | (42) | primaries.js:28:1:28:7 | ((42)); | -| primaries.js:28:3:28:4 | 42 | primaries.js:28:1:28:7 | ((42)); | -| primaries.js:29:1:29:13 | /\\2147483648/ | primaries.js:29:1:29:14 | /\\2147483648/; | -| primaries.js:30:1:30:26 | /a{2147 ... 83649}/ | primaries.js:30:1:30:27 | /a{2147 ... 3649}/; | -| primaries.js:31:1:31:16 | /a{-2147483648}/ | primaries.js:31:1:31:17 | /a{-2147483648}/; | -| primaries.js:32:1:32:16 | /a{-2147483649}/ | primaries.js:32:1:32:17 | /a{-2147483649}/; | -| surrogates.js:1:5:1:5 | a | surrogates.js:1:1:1:17 | var a = "\\ud800"; | -| surrogates.js:1:5:1:16 | a = "\\ud800" | surrogates.js:1:1:1:17 | var a = "\\ud800"; | -| surrogates.js:1:9:1:16 | "\\ud800" | surrogates.js:1:1:1:17 | var a = "\\ud800"; | -| surrogates.js:2:1:2:8 | /\\uD800/ | surrogates.js:2:1:2:17 | /\\uD800/.test(a); | -| surrogates.js:2:1:2:13 | /\\uD800/.test | surrogates.js:2:1:2:17 | /\\uD800/.test(a); | -| surrogates.js:2:1:2:16 | /\\uD800/.test(a) | surrogates.js:2:1:2:17 | /\\uD800/.test(a); | -| surrogates.js:2:10:2:13 | test | surrogates.js:2:1:2:17 | /\\uD800/.test(a); | -| surrogates.js:2:15:2:15 | a | surrogates.js:2:1:2:17 | /\\uD800/.test(a); | -| surrogates.js:3:1:3:14 | "\\uD834\\uDF06" | surrogates.js:3:1:3:15 | "\\uD834\\uDF06"; | -| surrogates.js:4:1:4:14 | '\\udc00\\ud800' | surrogates.js:4:1:4:15 | '\\udc00\\ud800'; | -| unary.js:1:1:1:3 | -23 | unary.js:1:1:1:4 | -23; | -| unary.js:1:2:1:3 | 23 | unary.js:1:1:1:4 | -23; | -| unary.js:2:1:2:3 | +42 | unary.js:2:1:2:4 | +42; | -| unary.js:2:2:2:3 | 42 | unary.js:2:1:2:4 | +42; | -| unary.js:3:1:3:5 | !true | unary.js:3:1:3:6 | !true; | -| unary.js:3:2:3:5 | true | unary.js:3:1:3:6 | !true; | -| unary.js:4:1:4:2 | ~2 | unary.js:4:1:4:3 | ~2; | -| unary.js:4:2:4:2 | 2 | unary.js:4:1:4:3 | ~2; | -| unary.js:5:1:5:13 | typeof Object | unary.js:5:1:5:14 | typeof Object; | -| unary.js:5:8:5:13 | Object | unary.js:5:1:5:14 | typeof Object; | -| unary.js:6:1:6:7 | void(0) | unary.js:6:1:6:8 | void(0); | -| unary.js:6:5:6:7 | (0) | unary.js:6:1:6:8 | void(0); | -| unary.js:6:6:6:6 | 0 | unary.js:6:1:6:8 | void(0); | -| unary.js:7:1:7:23 | delete ... ototype | unary.js:7:1:7:24 | delete ... totype; | -| unary.js:7:8:7:13 | Object | unary.js:7:1:7:24 | delete ... totype; | -| unary.js:7:8:7:23 | Object.prototype | unary.js:7:1:7:24 | delete ... totype; | -| unary.js:7:15:7:23 | prototype | unary.js:7:1:7:24 | delete ... totype; | -| update.js:1:1:1:3 | ++a | update.js:1:1:1:4 | ++a; | -| update.js:1:3:1:3 | a | update.js:1:1:1:4 | ++a; | -| update.js:2:1:2:1 | a | update.js:2:1:2:4 | a++; | -| update.js:2:1:2:3 | a++ | update.js:2:1:2:4 | a++; | -| update.js:3:1:3:3 | --b | update.js:3:1:3:4 | --b; | -| update.js:3:3:3:3 | b | update.js:3:1:3:4 | --b; | -| update.js:4:1:4:1 | b | update.js:4:1:4:4 | b--; | -| update.js:4:1:4:3 | b-- | update.js:4:1:4:4 | b--; | diff --git a/javascript/ql/test/library-tests/Expr/getEnclosingStmt.ql b/javascript/ql/test/library-tests/Expr/getEnclosingStmt.ql deleted file mode 100644 index 0ef6983c2099..000000000000 --- a/javascript/ql/test/library-tests/Expr/getEnclosingStmt.ql +++ /dev/null @@ -1,4 +0,0 @@ -import javascript - -from Expr e -select e, e.getEnclosingStmt() diff --git a/javascript/ql/test/library-tests/Expr/getEnclosingStmt.qll b/javascript/ql/test/library-tests/Expr/getEnclosingStmt.qll new file mode 100644 index 000000000000..47cd2031df71 --- /dev/null +++ b/javascript/ql/test/library-tests/Expr/getEnclosingStmt.qll @@ -0,0 +1,3 @@ +import javascript + +query predicate test_getEnclosingStmt(Expr e, Stmt res) { res = e.getEnclosingStmt() } diff --git a/javascript/ql/test/library-tests/Expr/getParent.expected b/javascript/ql/test/library-tests/Expr/getParent.expected deleted file mode 100644 index 47f935e49208..000000000000 --- a/javascript/ql/test/library-tests/Expr/getParent.expected +++ /dev/null @@ -1,331 +0,0 @@ -| assignment.js:1:1:1:1 | a | assignment.js:1:1:1:6 | a = 23 | -| assignment.js:1:1:1:6 | a = 23 | assignment.js:1:1:1:7 | a = 23; | -| assignment.js:1:5:1:6 | 23 | assignment.js:1:1:1:6 | a = 23 | -| assignment.js:2:1:2:1 | a | assignment.js:2:1:2:7 | a += 19 | -| assignment.js:2:1:2:7 | a += 19 | assignment.js:2:1:2:8 | a += 19; | -| assignment.js:2:6:2:7 | 19 | assignment.js:2:1:2:7 | a += 19 | -| assignment.js:3:1:3:1 | a | assignment.js:3:1:3:6 | a -= 9 | -| assignment.js:3:1:3:6 | a -= 9 | assignment.js:3:1:3:7 | a -= 9; | -| assignment.js:3:6:3:6 | 9 | assignment.js:3:1:3:6 | a -= 9 | -| assignment.js:4:1:4:1 | a | assignment.js:4:1:4:6 | a *= b | -| assignment.js:4:1:4:6 | a *= b | assignment.js:4:1:4:7 | a *= b; | -| assignment.js:4:6:4:6 | b | assignment.js:4:1:4:6 | a *= b | -| assignment.js:5:1:5:1 | a | assignment.js:5:1:5:6 | a /= 2 | -| assignment.js:5:1:5:6 | a /= 2 | assignment.js:5:1:5:7 | a /= 2; | -| assignment.js:5:6:5:6 | 2 | assignment.js:5:1:5:6 | a /= 2 | -| assignment.js:6:1:6:1 | a | assignment.js:6:1:6:6 | a %= 2 | -| assignment.js:6:1:6:6 | a %= 2 | assignment.js:6:1:6:7 | a %= 2; | -| assignment.js:6:6:6:6 | 2 | assignment.js:6:1:6:6 | a %= 2 | -| assignment.js:7:1:7:1 | a | assignment.js:7:1:7:7 | a <<= 8 | -| assignment.js:7:1:7:7 | a <<= 8 | assignment.js:7:1:7:8 | a <<= 8; | -| assignment.js:7:7:7:7 | 8 | assignment.js:7:1:7:7 | a <<= 8 | -| assignment.js:8:1:8:1 | a | assignment.js:8:1:8:7 | a >>= 7 | -| assignment.js:8:1:8:7 | a >>= 7 | assignment.js:8:1:8:8 | a >>= 7; | -| assignment.js:8:7:8:7 | 7 | assignment.js:8:1:8:7 | a >>= 7 | -| assignment.js:9:1:9:1 | a | assignment.js:9:1:9:8 | a >>>= 2 | -| assignment.js:9:1:9:8 | a >>>= 2 | assignment.js:9:1:9:9 | a >>>= 2; | -| assignment.js:9:8:9:8 | 2 | assignment.js:9:1:9:8 | a >>>= 2 | -| assignment.js:10:1:10:1 | a | assignment.js:10:1:10:6 | a \|= 2 | -| assignment.js:10:1:10:6 | a \|= 2 | assignment.js:10:1:10:7 | a \|= 2; | -| assignment.js:10:6:10:6 | 2 | assignment.js:10:1:10:6 | a \|= 2 | -| assignment.js:11:1:11:1 | a | assignment.js:11:1:11:6 | a ^= 1 | -| assignment.js:11:1:11:6 | a ^= 1 | assignment.js:11:1:11:7 | a ^= 1; | -| assignment.js:11:6:11:6 | 1 | assignment.js:11:1:11:6 | a ^= 1 | -| assignment.js:12:1:12:1 | a | assignment.js:12:1:12:6 | a &= 3 | -| assignment.js:12:1:12:6 | a &= 3 | assignment.js:12:1:12:7 | a &= 3; | -| assignment.js:12:6:12:6 | 3 | assignment.js:12:1:12:6 | a &= 3 | -| binary.js:1:1:1:1 | 1 | binary.js:1:1:1:6 | 1 << 2 | -| binary.js:1:1:1:6 | 1 << 2 | binary.js:1:1:1:7 | 1 << 2; | -| binary.js:1:6:1:6 | 2 | binary.js:1:1:1:6 | 1 << 2 | -| binary.js:2:1:2:1 | 2 | binary.js:2:1:2:6 | 2 >> 1 | -| binary.js:2:1:2:6 | 2 >> 1 | binary.js:2:1:2:7 | 2 >> 1; | -| binary.js:2:6:2:6 | 1 | binary.js:2:1:2:6 | 2 >> 1 | -| binary.js:3:1:3:1 | 2 | binary.js:3:1:3:7 | 2 >>> 1 | -| binary.js:3:1:3:7 | 2 >>> 1 | binary.js:3:1:3:8 | 2 >>> 1; | -| binary.js:3:7:3:7 | 1 | binary.js:3:1:3:7 | 2 >>> 1 | -| binary.js:4:1:4:2 | 23 | binary.js:4:1:4:7 | 23 + 19 | -| binary.js:4:1:4:7 | 23 + 19 | binary.js:4:1:4:8 | 23 + 19; | -| binary.js:4:6:4:7 | 19 | binary.js:4:1:4:7 | 23 + 19 | -| binary.js:5:1:5:2 | 42 | binary.js:5:1:5:7 | 42 - 19 | -| binary.js:5:1:5:7 | 42 - 19 | binary.js:5:1:5:8 | 42 - 19; | -| binary.js:5:6:5:7 | 19 | binary.js:5:1:5:7 | 42 - 19 | -| binary.js:6:1:6:1 | 2 | binary.js:6:1:6:5 | 2 * 3 | -| binary.js:6:1:6:5 | 2 * 3 | binary.js:6:1:6:6 | 2 * 3; | -| binary.js:6:5:6:5 | 3 | binary.js:6:1:6:5 | 2 * 3 | -| binary.js:7:1:7:1 | 8 | binary.js:7:1:7:5 | 8 / 5 | -| binary.js:7:1:7:5 | 8 / 5 | binary.js:7:1:7:6 | 8 / 5; | -| binary.js:7:5:7:5 | 5 | binary.js:7:1:7:5 | 8 / 5 | -| binary.js:8:1:8:1 | 2 | binary.js:8:1:8:5 | 2 % 1 | -| binary.js:8:1:8:5 | 2 % 1 | binary.js:8:1:8:6 | 2 % 1; | -| binary.js:8:5:8:5 | 1 | binary.js:8:1:8:5 | 2 % 1 | -| binary.js:9:1:9:1 | 2 | binary.js:9:1:9:5 | 2 \| 3 | -| binary.js:9:1:9:5 | 2 \| 3 | binary.js:9:1:9:6 | 2 \| 3; | -| binary.js:9:5:9:5 | 3 | binary.js:9:1:9:5 | 2 \| 3 | -| binary.js:10:1:10:1 | 2 | binary.js:10:1:10:5 | 2 ^ 3 | -| binary.js:10:1:10:5 | 2 ^ 3 | binary.js:10:1:10:6 | 2 ^ 3; | -| binary.js:10:5:10:5 | 3 | binary.js:10:1:10:5 | 2 ^ 3 | -| binary.js:11:1:11:1 | 2 | binary.js:11:1:11:5 | 2 & 3 | -| binary.js:11:1:11:5 | 2 & 3 | binary.js:11:1:11:6 | 2 & 3; | -| binary.js:11:5:11:5 | 3 | binary.js:11:1:11:5 | 2 & 3 | -| binary.js:12:1:12:11 | 'prototype' | binary.js:12:1:12:21 | 'protot ... Object | -| binary.js:12:1:12:21 | 'protot ... Object | binary.js:12:1:12:22 | 'protot ... Object; | -| binary.js:12:16:12:21 | Object | binary.js:12:1:12:21 | 'protot ... Object | -| binary.js:13:1:13:2 | [] | binary.js:13:1:13:19 | [] instanceof Array | -| binary.js:13:1:13:19 | [] instanceof Array | binary.js:13:1:13:20 | [] instanceof Array; | -| binary.js:13:15:13:19 | Array | binary.js:13:1:13:19 | [] instanceof Array | -| binary.js:14:1:14:1 | 1 | binary.js:14:1:14:6 | 1 && 2 | -| binary.js:14:1:14:6 | 1 && 2 | binary.js:14:1:14:7 | 1 && 2; | -| binary.js:14:6:14:6 | 2 | binary.js:14:1:14:6 | 1 && 2 | -| binary.js:15:1:15:1 | 1 | binary.js:15:1:15:6 | 1 \|\| 2 | -| binary.js:15:1:15:6 | 1 \|\| 2 | binary.js:15:1:15:7 | 1 \|\| 2; | -| binary.js:15:6:15:6 | 2 | binary.js:15:1:15:6 | 1 \|\| 2 | -| comparison.js:1:1:1:1 | 1 | comparison.js:1:1:1:6 | 1 == 1 | -| comparison.js:1:1:1:6 | 1 == 1 | comparison.js:1:1:1:7 | 1 == 1; | -| comparison.js:1:6:1:6 | 1 | comparison.js:1:1:1:6 | 1 == 1 | -| comparison.js:2:1:2:1 | 1 | comparison.js:2:1:2:6 | 1 != 2 | -| comparison.js:2:1:2:6 | 1 != 2 | comparison.js:2:1:2:7 | 1 != 2; | -| comparison.js:2:6:2:6 | 2 | comparison.js:2:1:2:6 | 1 != 2 | -| comparison.js:3:1:3:1 | 1 | comparison.js:3:1:3:7 | 1 === 1 | -| comparison.js:3:1:3:7 | 1 === 1 | comparison.js:3:1:3:8 | 1 === 1; | -| comparison.js:3:7:3:7 | 1 | comparison.js:3:1:3:7 | 1 === 1 | -| comparison.js:4:1:4:1 | 1 | comparison.js:4:1:4:7 | 1 !== 2 | -| comparison.js:4:1:4:7 | 1 !== 2 | comparison.js:4:1:4:8 | 1 !== 2; | -| comparison.js:4:7:4:7 | 2 | comparison.js:4:1:4:7 | 1 !== 2 | -| comparison.js:5:1:5:1 | 1 | comparison.js:5:1:5:5 | 1 < 2 | -| comparison.js:5:1:5:5 | 1 < 2 | comparison.js:5:1:5:6 | 1 < 2; | -| comparison.js:5:5:5:5 | 2 | comparison.js:5:1:5:5 | 1 < 2 | -| comparison.js:6:1:6:1 | 1 | comparison.js:6:1:6:6 | 1 <= 2 | -| comparison.js:6:1:6:6 | 1 <= 2 | comparison.js:6:1:6:7 | 1 <= 2; | -| comparison.js:6:6:6:6 | 2 | comparison.js:6:1:6:6 | 1 <= 2 | -| comparison.js:7:1:7:1 | 2 | comparison.js:7:1:7:5 | 2 > 1 | -| comparison.js:7:1:7:5 | 2 > 1 | comparison.js:7:1:7:6 | 2 > 1; | -| comparison.js:7:5:7:5 | 1 | comparison.js:7:1:7:5 | 2 > 1 | -| comparison.js:8:1:8:1 | 2 | comparison.js:8:1:8:6 | 2 >= 1 | -| comparison.js:8:1:8:6 | 2 >= 1 | comparison.js:8:1:8:7 | 2 >= 1; | -| comparison.js:8:6:8:6 | 1 | comparison.js:8:1:8:6 | 2 >= 1 | -| es2015.js:1:1:1:18 | ["a", "ab", "abc"] | es2015.js:1:1:1:22 | ["a", " ... c"].map | -| es2015.js:1:1:1:22 | ["a", " ... c"].map | es2015.js:1:1:1:37 | ["a", " ... length) | -| es2015.js:1:1:1:37 | ["a", " ... length) | es2015.js:1:1:1:38 | ["a", " ... ength); | -| es2015.js:1:2:1:4 | "a" | es2015.js:1:1:1:18 | ["a", "ab", "abc"] | -| es2015.js:1:7:1:10 | "ab" | es2015.js:1:1:1:18 | ["a", "ab", "abc"] | -| es2015.js:1:13:1:17 | "abc" | es2015.js:1:1:1:18 | ["a", "ab", "abc"] | -| es2015.js:1:20:1:22 | map | es2015.js:1:1:1:22 | ["a", " ... c"].map | -| es2015.js:1:24:1:24 | s | es2015.js:1:24:1:36 | s => s.length | -| es2015.js:1:24:1:36 | s => s.length | es2015.js:1:1:1:37 | ["a", " ... length) | -| es2015.js:1:29:1:29 | s | es2015.js:1:29:1:36 | s.length | -| es2015.js:1:29:1:36 | s.length | es2015.js:1:24:1:36 | s => s.length | -| es2015.js:1:31:1:36 | length | es2015.js:1:29:1:36 | s.length | -| es2015.js:2:1:2:11 | setInterval | es2015.js:2:1:2:30 | setInte ... , 1000) | -| es2015.js:2:1:2:30 | setInte ... , 1000) | es2015.js:2:1:2:31 | setInte ... 1000); | -| es2015.js:2:13:2:23 | () => ++cnt | es2015.js:2:1:2:30 | setInte ... , 1000) | -| es2015.js:2:19:2:23 | ++cnt | es2015.js:2:13:2:23 | () => ++cnt | -| es2015.js:2:21:2:23 | cnt | es2015.js:2:19:2:23 | ++cnt | -| es2015.js:2:26:2:29 | 1000 | es2015.js:2:1:2:30 | setInte ... , 1000) | -| es2015.js:3:1:3:10 | setTimeout | es2015.js:3:1:3:47 | setTime ... 60000) | -| es2015.js:3:1:3:47 | setTime ... 60000) | es2015.js:3:1:3:48 | setTime ... 60000); | -| es2015.js:3:12:3:39 | () => { ... p!"); } | es2015.js:3:1:3:47 | setTime ... 60000) | -| es2015.js:3:20:3:24 | alert | es2015.js:3:20:3:36 | alert("Wake up!") | -| es2015.js:3:20:3:36 | alert("Wake up!") | es2015.js:3:20:3:37 | alert("Wake up!"); | -| es2015.js:3:26:3:35 | "Wake up!" | es2015.js:3:20:3:36 | alert("Wake up!") | -| es2015.js:3:42:3:46 | 60000 | es2015.js:3:1:3:47 | setTime ... 60000) | -| es2015.js:5:1:5:10 | [a, ...as] | es2015.js:5:1:5:11 | [a, ...as]; | -| es2015.js:5:2:5:2 | a | es2015.js:5:1:5:10 | [a, ...as] | -| es2015.js:5:5:5:9 | ...as | es2015.js:5:1:5:10 | [a, ...as] | -| es2015.js:5:8:5:9 | as | es2015.js:5:5:5:9 | ...as | -| es2015.js:6:1:6:18 | new Array(...elts) | es2015.js:6:1:6:19 | new Array(...elts); | -| es2015.js:6:5:6:9 | Array | es2015.js:6:1:6:18 | new Array(...elts) | -| es2015.js:6:11:6:17 | ...elts | es2015.js:6:1:6:18 | new Array(...elts) | -| es2015.js:6:14:6:17 | elts | es2015.js:6:11:6:17 | ...elts | -| es2015.js:8:10:8:10 | f | es2015.js:8:1:15:1 | functio ... );\\n\\t}\\n} | -| es2015.js:8:12:8:17 | [x, y] | es2015.js:8:1:15:1 | functio ... );\\n\\t}\\n} | -| es2015.js:8:13:8:13 | x | es2015.js:8:12:8:17 | [x, y] | -| es2015.js:8:16:8:16 | y | es2015.js:8:12:8:17 | [x, y] | -| es2015.js:9:6:9:15 | [a, [, c]] | es2015.js:9:6:9:19 | [a, [, c]] = x | -| es2015.js:9:6:9:19 | [a, [, c]] = x | es2015.js:9:2:9:20 | var [a, [, c]] = x; | -| es2015.js:9:7:9:7 | a | es2015.js:9:6:9:15 | [a, [, c]] | -| es2015.js:9:10:9:14 | [, c] | es2015.js:9:6:9:15 | [a, [, c]] | -| es2015.js:9:13:9:13 | c | es2015.js:9:10:9:14 | [, c] | -| es2015.js:9:19:9:19 | x | es2015.js:9:6:9:19 | [a, [, c]] = x | -| es2015.js:11:9:11:14 | [a, c] | es2015.js:11:3:11:15 | throw [a, c]; | -| es2015.js:11:10:11:10 | a | es2015.js:11:9:11:14 | [a, c] | -| es2015.js:11:13:11:13 | c | es2015.js:11:9:11:14 | [a, c] | -| es2015.js:12:11:12:11 | d | es2015.js:12:4:14:2 | catch ( ... (d);\\n\\t} | -| es2015.js:13:3:13:9 | console | es2015.js:13:3:13:13 | console.log | -| es2015.js:13:3:13:13 | console.log | es2015.js:13:3:13:16 | console.log(d) | -| es2015.js:13:3:13:16 | console.log(d) | es2015.js:13:3:13:17 | console.log(d); | -| es2015.js:13:11:13:13 | log | es2015.js:13:3:13:13 | console.log | -| es2015.js:13:15:13:15 | d | es2015.js:13:3:13:16 | console.log(d) | -| es2015.js:17:10:17:10 | g | es2015.js:17:1:20:1 | functio ... rn w;\\n} | -| es2015.js:17:12:17:22 | { x, y: z } | es2015.js:17:1:20:1 | functio ... rn w;\\n} | -| es2015.js:17:14:17:14 | x | es2015.js:17:14:17:14 | x | -| es2015.js:17:14:17:14 | x | es2015.js:17:14:17:14 | x | -| es2015.js:17:17:17:17 | y | es2015.js:17:17:17:20 | y: z | -| es2015.js:17:20:17:20 | z | es2015.js:17:17:17:20 | y: z | -| es2015.js:18:6:18:15 | { [x]: w } | es2015.js:18:6:18:19 | { [x]: w } = z | -| es2015.js:18:6:18:19 | { [x]: w } = z | es2015.js:18:2:18:20 | var { [x]: w } = z; | -| es2015.js:18:9:18:9 | x | es2015.js:18:8:18:13 | [x]: w | -| es2015.js:18:13:18:13 | w | es2015.js:18:8:18:13 | [x]: w | -| es2015.js:18:19:18:19 | z | es2015.js:18:6:18:19 | { [x]: w } = z | -| es2015.js:19:9:19:9 | w | es2015.js:19:2:19:10 | return w; | -| es2015.js:22:11:22:13 | foo | es2015.js:22:1:26:1 | functio ... o(1);\\n} | -| es2015.js:22:15:22:15 | n | es2015.js:22:1:26:1 | functio ... o(1);\\n} | -| es2015.js:23:8:23:8 | n | es2015.js:23:8:23:10 | n-- | -| es2015.js:23:8:23:10 | n-- | es2015.js:23:8:23:12 | n-->0 | -| es2015.js:23:8:23:12 | n-->0 | es2015.js:23:2:24:10 | while(n ... ield n; | -| es2015.js:23:12:23:12 | 0 | es2015.js:23:8:23:12 | n-->0 | -| es2015.js:24:3:24:9 | yield n | es2015.js:24:3:24:10 | yield n; | -| es2015.js:24:9:24:9 | n | es2015.js:24:3:24:9 | yield n | -| es2015.js:25:2:25:14 | yield* foo(1) | es2015.js:25:2:25:15 | yield* foo(1); | -| es2015.js:25:9:25:11 | foo | es2015.js:25:9:25:14 | foo(1) | -| es2015.js:25:9:25:14 | foo(1) | es2015.js:25:2:25:14 | yield* foo(1) | -| es2015.js:25:13:25:13 | 1 | es2015.js:25:9:25:14 | foo(1) | -| es2015.js:28:10:28:12 | bar | es2015.js:28:1:28:26 | functio ... +19) {} | -| es2015.js:28:14:28:14 | x | es2015.js:28:1:28:26 | functio ... +19) {} | -| es2015.js:28:17:28:17 | y | es2015.js:28:1:28:26 | functio ... +19) {} | -| es2015.js:28:19:28:19 | x | es2015.js:28:19:28:22 | x+19 | -| es2015.js:28:19:28:22 | x+19 | es2015.js:28:1:28:26 | functio ... +19) {} | -| es2015.js:28:21:28:22 | 19 | es2015.js:28:19:28:22 | x+19 | -| functions.js:1:10:1:10 | f | functions.js:1:1:9:1 | functio ... \\t\\t});\\n} | -| functions.js:2:2:2:5 | in_f | functions.js:2:2:2:6 | in_f; | -| functions.js:3:9:3:17 | also_in_f | functions.js:3:2:8:5 | while ( ... n\\n\\t\\t}); | -| functions.js:4:3:6:4 | (functi ... f;\\n\\t\\t}) | functions.js:4:3:8:4 | (functi ... in\\n\\t\\t}) | -| functions.js:4:3:8:4 | (functi ... in\\n\\t\\t}) | functions.js:4:3:8:5 | (functi ... n\\n\\t\\t}); | -| functions.js:4:4:6:3 | functio ... _f;\\n\\t\\t} | functions.js:4:3:6:4 | (functi ... f;\\n\\t\\t}) | -| functions.js:5:4:5:11 | not_in_f | functions.js:5:4:5:12 | not_in_f; | -| functions.js:6:6:8:3 | {\\n\\t\\t\\tx: ... ain\\n\\t\\t} | functions.js:4:3:8:4 | (functi ... in\\n\\t\\t}) | -| functions.js:7:4:7:4 | x | functions.js:7:4:7:16 | x: in_f_again | -| functions.js:7:7:7:16 | in_f_again | functions.js:7:4:7:16 | x: in_f_again | -| functions.js:10:1:10:6 | global | functions.js:10:1:10:7 | global; | -| legacyletexpr.js:1:1:1:7 | console | legacyletexpr.js:1:1:1:11 | console.log | -| legacyletexpr.js:1:1:1:11 | console.log | legacyletexpr.js:1:1:1:39 | console ... x + y) | -| legacyletexpr.js:1:1:1:39 | console ... x + y) | legacyletexpr.js:1:1:1:40 | console ... x + y); | -| legacyletexpr.js:1:9:1:11 | log | legacyletexpr.js:1:1:1:11 | console.log | -| legacyletexpr.js:1:13:1:38 | let (x ... ) x + y | legacyletexpr.js:1:1:1:39 | console ... x + y) | -| legacyletexpr.js:1:18:1:18 | x | legacyletexpr.js:1:18:1:23 | x = 23 | -| legacyletexpr.js:1:18:1:23 | x = 23 | legacyletexpr.js:1:13:1:38 | let (x ... ) x + y | -| legacyletexpr.js:1:22:1:23 | 23 | legacyletexpr.js:1:18:1:23 | x = 23 | -| legacyletexpr.js:1:26:1:26 | y | legacyletexpr.js:1:26:1:31 | y = 19 | -| legacyletexpr.js:1:26:1:31 | y = 19 | legacyletexpr.js:1:13:1:38 | let (x ... ) x + y | -| legacyletexpr.js:1:30:1:31 | 19 | legacyletexpr.js:1:26:1:31 | y = 19 | -| legacyletexpr.js:1:34:1:34 | x | legacyletexpr.js:1:34:1:38 | x + y | -| legacyletexpr.js:1:34:1:38 | x + y | legacyletexpr.js:1:13:1:38 | let (x ... ) x + y | -| legacyletexpr.js:1:38:1:38 | y | legacyletexpr.js:1:34:1:38 | x + y | -| mozextensions.js:1:1:1:5 | array | mozextensions.js:1:1:1:9 | array.map | -| mozextensions.js:1:1:1:9 | array.map | mozextensions.js:1:1:1:26 | array.m ... x) x+1) | -| mozextensions.js:1:1:1:26 | array.m ... x) x+1) | mozextensions.js:1:1:1:27 | array.m ... ) x+1); | -| mozextensions.js:1:7:1:9 | map | mozextensions.js:1:1:1:9 | array.map | -| mozextensions.js:1:11:1:25 | function(x) x+1 | mozextensions.js:1:1:1:26 | array.m ... x) x+1) | -| mozextensions.js:1:20:1:20 | x | mozextensions.js:1:11:1:25 | function(x) x+1 | -| mozextensions.js:1:23:1:23 | x | mozextensions.js:1:23:1:25 | x+1 | -| mozextensions.js:1:23:1:25 | x+1 | mozextensions.js:1:11:1:25 | function(x) x+1 | -| mozextensions.js:1:25:1:25 | 1 | mozextensions.js:1:23:1:25 | x+1 | -| others.js:1:1:1:2 | 23 | others.js:1:1:1:6 | 23, 42 | -| others.js:1:1:1:6 | 23, 42 | others.js:1:1:1:7 | 23, 42; | -| others.js:1:5:1:6 | 42 | others.js:1:1:1:6 | 23, 42 | -| others.js:2:1:2:2 | 23 | others.js:2:1:2:10 | 23, 42, 56 | -| others.js:2:1:2:10 | 23, 42, 56 | others.js:2:1:2:11 | 23, 42, 56; | -| others.js:2:5:2:6 | 42 | others.js:2:1:2:10 | 23, 42, 56 | -| others.js:2:9:2:10 | 56 | others.js:2:1:2:10 | 23, 42, 56 | -| others.js:3:1:3:4 | true | others.js:3:1:3:12 | true ? 0 : 1 | -| others.js:3:1:3:12 | true ? 0 : 1 | others.js:3:1:3:13 | true ? 0 : 1; | -| others.js:3:8:3:8 | 0 | others.js:3:1:3:12 | true ? 0 : 1 | -| others.js:3:12:3:12 | 1 | others.js:3:1:3:12 | true ? 0 : 1 | -| others.js:4:10:4:10 | p | others.js:4:6:4:10 | var p | -| others.js:4:10:4:10 | p | others.js:4:10:4:10 | p | -| others.js:4:15:4:15 | o | others.js:4:1:5:2 | for (var p in o)\\n\\t; | -| primaries.js:1:1:1:4 | null | primaries.js:1:1:1:5 | null; | -| primaries.js:2:1:2:4 | true | primaries.js:2:1:2:5 | true; | -| primaries.js:3:1:3:5 | false | primaries.js:3:1:3:6 | false; | -| primaries.js:4:1:4:2 | 23 | primaries.js:4:1:4:3 | 23; | -| primaries.js:5:1:5:3 | 2.3 | primaries.js:5:1:5:4 | 2.3; | -| primaries.js:6:1:6:3 | .42 | primaries.js:6:1:6:4 | .42; | -| primaries.js:7:1:7:6 | 7.6e23 | primaries.js:7:1:7:7 | 7.6e23; | -| primaries.js:8:1:8:5 | 1E-42 | primaries.js:8:1:8:6 | 1E-42; | -| primaries.js:9:1:9:10 | 0xdeadbeef | primaries.js:9:1:9:11 | 0xdeadbeef; | -| primaries.js:10:1:10:7 | "Hello" | primaries.js:10:1:10:8 | "Hello"; | -| primaries.js:11:1:11:7 | 'world' | primaries.js:11:1:11:8 | 'world'; | -| primaries.js:12:1:12:13 | "'what?'\\x0a" | primaries.js:12:1:12:14 | "'what?'\\x0a"; | -| primaries.js:13:1:13:10 | '"why?"\\n' | primaries.js:13:1:13:11 | '"why?"\\n'; | -| primaries.js:14:1:14:15 | /^(need?le)+/gi | primaries.js:14:1:14:16 | /^(need?le)+/gi; | -| primaries.js:15:1:15:4 | (23) | primaries.js:15:1:15:5 | (23); | -| primaries.js:15:2:15:3 | 23 | primaries.js:15:1:15:4 | (23) | -| primaries.js:16:1:16:17 | [23, 42, , "hi" ] | primaries.js:16:1:16:18 | [23, 42, , "hi" ]; | -| primaries.js:16:2:16:3 | 23 | primaries.js:16:1:16:17 | [23, 42, , "hi" ] | -| primaries.js:16:6:16:7 | 42 | primaries.js:16:1:16:17 | [23, 42, , "hi" ] | -| primaries.js:16:12:16:15 | "hi" | primaries.js:16:1:16:17 | [23, 42, , "hi" ] | -| primaries.js:17:1:21:16 | ({ x: 2 ... v) {}}) | primaries.js:17:1:21:17 | ({ x: 2 ... ) {}}); | -| primaries.js:17:2:21:15 | { x: 23 ... (v) {}} | primaries.js:17:1:21:16 | ({ x: 2 ... v) {}}) | -| primaries.js:17:4:17:4 | x | primaries.js:17:4:17:8 | x: 23 | -| primaries.js:17:7:17:8 | 23 | primaries.js:17:4:17:8 | x: 23 | -| primaries.js:18:4:18:4 | y | primaries.js:18:4:18:10 | y: this | -| primaries.js:18:7:18:10 | this | primaries.js:18:4:18:10 | y: this | -| primaries.js:19:8:19:8 | o | primaries.js:19:4:19:13 | get o() {} | -| primaries.js:19:9:19:13 | () {} | primaries.js:19:4:19:13 | get o() {} | -| primaries.js:20:8:20:8 | p | primaries.js:20:4:20:13 | get p() {} | -| primaries.js:20:9:20:13 | () {} | primaries.js:20:4:20:13 | get p() {} | -| primaries.js:21:8:21:8 | p | primaries.js:21:4:21:14 | set p(v) {} | -| primaries.js:21:9:21:14 | (v) {} | primaries.js:21:4:21:14 | set p(v) {} | -| primaries.js:21:10:21:10 | v | primaries.js:21:9:21:14 | (v) {} | -| primaries.js:22:1:22:9 | new Array | primaries.js:22:1:22:10 | new Array; | -| primaries.js:22:5:22:9 | Array | primaries.js:22:1:22:9 | new Array | -| primaries.js:23:1:23:12 | new Object() | primaries.js:23:1:23:13 | new Object(); | -| primaries.js:23:5:23:10 | Object | primaries.js:23:1:23:12 | new Object() | -| primaries.js:24:1:24:16 | new String("hi") | primaries.js:24:1:24:17 | new String("hi"); | -| primaries.js:24:5:24:10 | String | primaries.js:24:1:24:16 | new String("hi") | -| primaries.js:24:12:24:15 | "hi" | primaries.js:24:1:24:16 | new String("hi") | -| primaries.js:25:1:25:6 | String | primaries.js:25:1:25:10 | String("") | -| primaries.js:25:1:25:10 | String("") | primaries.js:25:1:25:11 | String(""); | -| primaries.js:25:8:25:9 | "" | primaries.js:25:1:25:10 | String("") | -| primaries.js:26:1:26:6 | Object | primaries.js:26:1:26:13 | Object.create | -| primaries.js:26:1:26:13 | Object.create | primaries.js:26:1:26:17 | Object.create({}) | -| primaries.js:26:1:26:17 | Object.create({}) | primaries.js:26:1:26:18 | Object.create({}); | -| primaries.js:26:8:26:13 | create | primaries.js:26:1:26:13 | Object.create | -| primaries.js:26:15:26:16 | {} | primaries.js:26:1:26:17 | Object.create({}) | -| primaries.js:27:1:27:6 | String | primaries.js:27:1:27:29 | String[ ... erse()] | -| primaries.js:27:1:27:29 | String[ ... erse()] | primaries.js:27:1:27:30 | String[ ... rse()]; | -| primaries.js:27:8:27:18 | 'epytotorp' | primaries.js:27:8:27:26 | 'epytotorp'.reverse | -| primaries.js:27:8:27:26 | 'epytotorp'.reverse | primaries.js:27:8:27:28 | 'epytot ... verse() | -| primaries.js:27:8:27:28 | 'epytot ... verse() | primaries.js:27:1:27:29 | String[ ... erse()] | -| primaries.js:27:20:27:26 | reverse | primaries.js:27:8:27:26 | 'epytotorp'.reverse | -| primaries.js:28:1:28:6 | ((42)) | primaries.js:28:1:28:7 | ((42)); | -| primaries.js:28:2:28:5 | (42) | primaries.js:28:1:28:6 | ((42)) | -| primaries.js:28:3:28:4 | 42 | primaries.js:28:2:28:5 | (42) | -| primaries.js:29:1:29:13 | /\\2147483648/ | primaries.js:29:1:29:14 | /\\2147483648/; | -| primaries.js:30:1:30:26 | /a{2147 ... 83649}/ | primaries.js:30:1:30:27 | /a{2147 ... 3649}/; | -| primaries.js:31:1:31:16 | /a{-2147483648}/ | primaries.js:31:1:31:17 | /a{-2147483648}/; | -| primaries.js:32:1:32:16 | /a{-2147483649}/ | primaries.js:32:1:32:17 | /a{-2147483649}/; | -| surrogates.js:1:5:1:5 | a | surrogates.js:1:5:1:16 | a = "\\ud800" | -| surrogates.js:1:5:1:16 | a = "\\ud800" | surrogates.js:1:1:1:17 | var a = "\\ud800"; | -| surrogates.js:1:9:1:16 | "\\ud800" | surrogates.js:1:5:1:16 | a = "\\ud800" | -| surrogates.js:2:1:2:8 | /\\uD800/ | surrogates.js:2:1:2:13 | /\\uD800/.test | -| surrogates.js:2:1:2:13 | /\\uD800/.test | surrogates.js:2:1:2:16 | /\\uD800/.test(a) | -| surrogates.js:2:1:2:16 | /\\uD800/.test(a) | surrogates.js:2:1:2:17 | /\\uD800/.test(a); | -| surrogates.js:2:10:2:13 | test | surrogates.js:2:1:2:13 | /\\uD800/.test | -| surrogates.js:2:15:2:15 | a | surrogates.js:2:1:2:16 | /\\uD800/.test(a) | -| surrogates.js:3:1:3:14 | "\\uD834\\uDF06" | surrogates.js:3:1:3:15 | "\\uD834\\uDF06"; | -| surrogates.js:4:1:4:14 | '\\udc00\\ud800' | surrogates.js:4:1:4:15 | '\\udc00\\ud800'; | -| unary.js:1:1:1:3 | -23 | unary.js:1:1:1:4 | -23; | -| unary.js:1:2:1:3 | 23 | unary.js:1:1:1:3 | -23 | -| unary.js:2:1:2:3 | +42 | unary.js:2:1:2:4 | +42; | -| unary.js:2:2:2:3 | 42 | unary.js:2:1:2:3 | +42 | -| unary.js:3:1:3:5 | !true | unary.js:3:1:3:6 | !true; | -| unary.js:3:2:3:5 | true | unary.js:3:1:3:5 | !true | -| unary.js:4:1:4:2 | ~2 | unary.js:4:1:4:3 | ~2; | -| unary.js:4:2:4:2 | 2 | unary.js:4:1:4:2 | ~2 | -| unary.js:5:1:5:13 | typeof Object | unary.js:5:1:5:14 | typeof Object; | -| unary.js:5:8:5:13 | Object | unary.js:5:1:5:13 | typeof Object | -| unary.js:6:1:6:7 | void(0) | unary.js:6:1:6:8 | void(0); | -| unary.js:6:5:6:7 | (0) | unary.js:6:1:6:7 | void(0) | -| unary.js:6:6:6:6 | 0 | unary.js:6:5:6:7 | (0) | -| unary.js:7:1:7:23 | delete ... ototype | unary.js:7:1:7:24 | delete ... totype; | -| unary.js:7:8:7:13 | Object | unary.js:7:8:7:23 | Object.prototype | -| unary.js:7:8:7:23 | Object.prototype | unary.js:7:1:7:23 | delete ... ototype | -| unary.js:7:15:7:23 | prototype | unary.js:7:8:7:23 | Object.prototype | -| update.js:1:1:1:3 | ++a | update.js:1:1:1:4 | ++a; | -| update.js:1:3:1:3 | a | update.js:1:1:1:3 | ++a | -| update.js:2:1:2:1 | a | update.js:2:1:2:3 | a++ | -| update.js:2:1:2:3 | a++ | update.js:2:1:2:4 | a++; | -| update.js:3:1:3:3 | --b | update.js:3:1:3:4 | --b; | -| update.js:3:3:3:3 | b | update.js:3:1:3:3 | --b | -| update.js:4:1:4:1 | b | update.js:4:1:4:3 | b-- | -| update.js:4:1:4:3 | b-- | update.js:4:1:4:4 | b--; | diff --git a/javascript/ql/test/library-tests/Expr/getParent.ql b/javascript/ql/test/library-tests/Expr/getParent.ql deleted file mode 100644 index 2c24245cd098..000000000000 --- a/javascript/ql/test/library-tests/Expr/getParent.ql +++ /dev/null @@ -1,4 +0,0 @@ -import javascript - -from Expr e -select e, e.getParent() diff --git a/javascript/ql/test/library-tests/Expr/getParent.qll b/javascript/ql/test/library-tests/Expr/getParent.qll new file mode 100644 index 000000000000..c37c9db39179 --- /dev/null +++ b/javascript/ql/test/library-tests/Expr/getParent.qll @@ -0,0 +1,3 @@ +import javascript + +query predicate test_getParent(Expr e, ASTNode res) { res = e.getParent() } diff --git a/javascript/ql/test/library-tests/Expr/getTopLevel.expected b/javascript/ql/test/library-tests/Expr/getTopLevel.expected deleted file mode 100644 index 1fd2fc19e1a1..000000000000 --- a/javascript/ql/test/library-tests/Expr/getTopLevel.expected +++ /dev/null @@ -1,331 +0,0 @@ -| assignment.js:1:1:1:1 | a | assignment.js:1:1:12:7 | | -| assignment.js:1:1:1:6 | a = 23 | assignment.js:1:1:12:7 | | -| assignment.js:1:5:1:6 | 23 | assignment.js:1:1:12:7 | | -| assignment.js:2:1:2:1 | a | assignment.js:1:1:12:7 | | -| assignment.js:2:1:2:7 | a += 19 | assignment.js:1:1:12:7 | | -| assignment.js:2:6:2:7 | 19 | assignment.js:1:1:12:7 | | -| assignment.js:3:1:3:1 | a | assignment.js:1:1:12:7 | | -| assignment.js:3:1:3:6 | a -= 9 | assignment.js:1:1:12:7 | | -| assignment.js:3:6:3:6 | 9 | assignment.js:1:1:12:7 | | -| assignment.js:4:1:4:1 | a | assignment.js:1:1:12:7 | | -| assignment.js:4:1:4:6 | a *= b | assignment.js:1:1:12:7 | | -| assignment.js:4:6:4:6 | b | assignment.js:1:1:12:7 | | -| assignment.js:5:1:5:1 | a | assignment.js:1:1:12:7 | | -| assignment.js:5:1:5:6 | a /= 2 | assignment.js:1:1:12:7 | | -| assignment.js:5:6:5:6 | 2 | assignment.js:1:1:12:7 | | -| assignment.js:6:1:6:1 | a | assignment.js:1:1:12:7 | | -| assignment.js:6:1:6:6 | a %= 2 | assignment.js:1:1:12:7 | | -| assignment.js:6:6:6:6 | 2 | assignment.js:1:1:12:7 | | -| assignment.js:7:1:7:1 | a | assignment.js:1:1:12:7 | | -| assignment.js:7:1:7:7 | a <<= 8 | assignment.js:1:1:12:7 | | -| assignment.js:7:7:7:7 | 8 | assignment.js:1:1:12:7 | | -| assignment.js:8:1:8:1 | a | assignment.js:1:1:12:7 | | -| assignment.js:8:1:8:7 | a >>= 7 | assignment.js:1:1:12:7 | | -| assignment.js:8:7:8:7 | 7 | assignment.js:1:1:12:7 | | -| assignment.js:9:1:9:1 | a | assignment.js:1:1:12:7 | | -| assignment.js:9:1:9:8 | a >>>= 2 | assignment.js:1:1:12:7 | | -| assignment.js:9:8:9:8 | 2 | assignment.js:1:1:12:7 | | -| assignment.js:10:1:10:1 | a | assignment.js:1:1:12:7 | | -| assignment.js:10:1:10:6 | a \|= 2 | assignment.js:1:1:12:7 | | -| assignment.js:10:6:10:6 | 2 | assignment.js:1:1:12:7 | | -| assignment.js:11:1:11:1 | a | assignment.js:1:1:12:7 | | -| assignment.js:11:1:11:6 | a ^= 1 | assignment.js:1:1:12:7 | | -| assignment.js:11:6:11:6 | 1 | assignment.js:1:1:12:7 | | -| assignment.js:12:1:12:1 | a | assignment.js:1:1:12:7 | | -| assignment.js:12:1:12:6 | a &= 3 | assignment.js:1:1:12:7 | | -| assignment.js:12:6:12:6 | 3 | assignment.js:1:1:12:7 | | -| binary.js:1:1:1:1 | 1 | binary.js:1:1:16:0 | | -| binary.js:1:1:1:6 | 1 << 2 | binary.js:1:1:16:0 | | -| binary.js:1:6:1:6 | 2 | binary.js:1:1:16:0 | | -| binary.js:2:1:2:1 | 2 | binary.js:1:1:16:0 | | -| binary.js:2:1:2:6 | 2 >> 1 | binary.js:1:1:16:0 | | -| binary.js:2:6:2:6 | 1 | binary.js:1:1:16:0 | | -| binary.js:3:1:3:1 | 2 | binary.js:1:1:16:0 | | -| binary.js:3:1:3:7 | 2 >>> 1 | binary.js:1:1:16:0 | | -| binary.js:3:7:3:7 | 1 | binary.js:1:1:16:0 | | -| binary.js:4:1:4:2 | 23 | binary.js:1:1:16:0 | | -| binary.js:4:1:4:7 | 23 + 19 | binary.js:1:1:16:0 | | -| binary.js:4:6:4:7 | 19 | binary.js:1:1:16:0 | | -| binary.js:5:1:5:2 | 42 | binary.js:1:1:16:0 | | -| binary.js:5:1:5:7 | 42 - 19 | binary.js:1:1:16:0 | | -| binary.js:5:6:5:7 | 19 | binary.js:1:1:16:0 | | -| binary.js:6:1:6:1 | 2 | binary.js:1:1:16:0 | | -| binary.js:6:1:6:5 | 2 * 3 | binary.js:1:1:16:0 | | -| binary.js:6:5:6:5 | 3 | binary.js:1:1:16:0 | | -| binary.js:7:1:7:1 | 8 | binary.js:1:1:16:0 | | -| binary.js:7:1:7:5 | 8 / 5 | binary.js:1:1:16:0 | | -| binary.js:7:5:7:5 | 5 | binary.js:1:1:16:0 | | -| binary.js:8:1:8:1 | 2 | binary.js:1:1:16:0 | | -| binary.js:8:1:8:5 | 2 % 1 | binary.js:1:1:16:0 | | -| binary.js:8:5:8:5 | 1 | binary.js:1:1:16:0 | | -| binary.js:9:1:9:1 | 2 | binary.js:1:1:16:0 | | -| binary.js:9:1:9:5 | 2 \| 3 | binary.js:1:1:16:0 | | -| binary.js:9:5:9:5 | 3 | binary.js:1:1:16:0 | | -| binary.js:10:1:10:1 | 2 | binary.js:1:1:16:0 | | -| binary.js:10:1:10:5 | 2 ^ 3 | binary.js:1:1:16:0 | | -| binary.js:10:5:10:5 | 3 | binary.js:1:1:16:0 | | -| binary.js:11:1:11:1 | 2 | binary.js:1:1:16:0 | | -| binary.js:11:1:11:5 | 2 & 3 | binary.js:1:1:16:0 | | -| binary.js:11:5:11:5 | 3 | binary.js:1:1:16:0 | | -| binary.js:12:1:12:11 | 'prototype' | binary.js:1:1:16:0 | | -| binary.js:12:1:12:21 | 'protot ... Object | binary.js:1:1:16:0 | | -| binary.js:12:16:12:21 | Object | binary.js:1:1:16:0 | | -| binary.js:13:1:13:2 | [] | binary.js:1:1:16:0 | | -| binary.js:13:1:13:19 | [] instanceof Array | binary.js:1:1:16:0 | | -| binary.js:13:15:13:19 | Array | binary.js:1:1:16:0 | | -| binary.js:14:1:14:1 | 1 | binary.js:1:1:16:0 | | -| binary.js:14:1:14:6 | 1 && 2 | binary.js:1:1:16:0 | | -| binary.js:14:6:14:6 | 2 | binary.js:1:1:16:0 | | -| binary.js:15:1:15:1 | 1 | binary.js:1:1:16:0 | | -| binary.js:15:1:15:6 | 1 \|\| 2 | binary.js:1:1:16:0 | | -| binary.js:15:6:15:6 | 2 | binary.js:1:1:16:0 | | -| comparison.js:1:1:1:1 | 1 | comparison.js:1:1:9:0 | | -| comparison.js:1:1:1:6 | 1 == 1 | comparison.js:1:1:9:0 | | -| comparison.js:1:6:1:6 | 1 | comparison.js:1:1:9:0 | | -| comparison.js:2:1:2:1 | 1 | comparison.js:1:1:9:0 | | -| comparison.js:2:1:2:6 | 1 != 2 | comparison.js:1:1:9:0 | | -| comparison.js:2:6:2:6 | 2 | comparison.js:1:1:9:0 | | -| comparison.js:3:1:3:1 | 1 | comparison.js:1:1:9:0 | | -| comparison.js:3:1:3:7 | 1 === 1 | comparison.js:1:1:9:0 | | -| comparison.js:3:7:3:7 | 1 | comparison.js:1:1:9:0 | | -| comparison.js:4:1:4:1 | 1 | comparison.js:1:1:9:0 | | -| comparison.js:4:1:4:7 | 1 !== 2 | comparison.js:1:1:9:0 | | -| comparison.js:4:7:4:7 | 2 | comparison.js:1:1:9:0 | | -| comparison.js:5:1:5:1 | 1 | comparison.js:1:1:9:0 | | -| comparison.js:5:1:5:5 | 1 < 2 | comparison.js:1:1:9:0 | | -| comparison.js:5:5:5:5 | 2 | comparison.js:1:1:9:0 | | -| comparison.js:6:1:6:1 | 1 | comparison.js:1:1:9:0 | | -| comparison.js:6:1:6:6 | 1 <= 2 | comparison.js:1:1:9:0 | | -| comparison.js:6:6:6:6 | 2 | comparison.js:1:1:9:0 | | -| comparison.js:7:1:7:1 | 2 | comparison.js:1:1:9:0 | | -| comparison.js:7:1:7:5 | 2 > 1 | comparison.js:1:1:9:0 | | -| comparison.js:7:5:7:5 | 1 | comparison.js:1:1:9:0 | | -| comparison.js:8:1:8:1 | 2 | comparison.js:1:1:9:0 | | -| comparison.js:8:1:8:6 | 2 >= 1 | comparison.js:1:1:9:0 | | -| comparison.js:8:6:8:6 | 1 | comparison.js:1:1:9:0 | | -| es2015.js:1:1:1:18 | ["a", "ab", "abc"] | es2015.js:1:1:29:0 | | -| es2015.js:1:1:1:22 | ["a", " ... c"].map | es2015.js:1:1:29:0 | | -| es2015.js:1:1:1:37 | ["a", " ... length) | es2015.js:1:1:29:0 | | -| es2015.js:1:2:1:4 | "a" | es2015.js:1:1:29:0 | | -| es2015.js:1:7:1:10 | "ab" | es2015.js:1:1:29:0 | | -| es2015.js:1:13:1:17 | "abc" | es2015.js:1:1:29:0 | | -| es2015.js:1:20:1:22 | map | es2015.js:1:1:29:0 | | -| es2015.js:1:24:1:24 | s | es2015.js:1:1:29:0 | | -| es2015.js:1:24:1:36 | s => s.length | es2015.js:1:1:29:0 | | -| es2015.js:1:29:1:29 | s | es2015.js:1:1:29:0 | | -| es2015.js:1:29:1:36 | s.length | es2015.js:1:1:29:0 | | -| es2015.js:1:31:1:36 | length | es2015.js:1:1:29:0 | | -| es2015.js:2:1:2:11 | setInterval | es2015.js:1:1:29:0 | | -| es2015.js:2:1:2:30 | setInte ... , 1000) | es2015.js:1:1:29:0 | | -| es2015.js:2:13:2:23 | () => ++cnt | es2015.js:1:1:29:0 | | -| es2015.js:2:19:2:23 | ++cnt | es2015.js:1:1:29:0 | | -| es2015.js:2:21:2:23 | cnt | es2015.js:1:1:29:0 | | -| es2015.js:2:26:2:29 | 1000 | es2015.js:1:1:29:0 | | -| es2015.js:3:1:3:10 | setTimeout | es2015.js:1:1:29:0 | | -| es2015.js:3:1:3:47 | setTime ... 60000) | es2015.js:1:1:29:0 | | -| es2015.js:3:12:3:39 | () => { ... p!"); } | es2015.js:1:1:29:0 | | -| es2015.js:3:20:3:24 | alert | es2015.js:1:1:29:0 | | -| es2015.js:3:20:3:36 | alert("Wake up!") | es2015.js:1:1:29:0 | | -| es2015.js:3:26:3:35 | "Wake up!" | es2015.js:1:1:29:0 | | -| es2015.js:3:42:3:46 | 60000 | es2015.js:1:1:29:0 | | -| es2015.js:5:1:5:10 | [a, ...as] | es2015.js:1:1:29:0 | | -| es2015.js:5:2:5:2 | a | es2015.js:1:1:29:0 | | -| es2015.js:5:5:5:9 | ...as | es2015.js:1:1:29:0 | | -| es2015.js:5:8:5:9 | as | es2015.js:1:1:29:0 | | -| es2015.js:6:1:6:18 | new Array(...elts) | es2015.js:1:1:29:0 | | -| es2015.js:6:5:6:9 | Array | es2015.js:1:1:29:0 | | -| es2015.js:6:11:6:17 | ...elts | es2015.js:1:1:29:0 | | -| es2015.js:6:14:6:17 | elts | es2015.js:1:1:29:0 | | -| es2015.js:8:10:8:10 | f | es2015.js:1:1:29:0 | | -| es2015.js:8:12:8:17 | [x, y] | es2015.js:1:1:29:0 | | -| es2015.js:8:13:8:13 | x | es2015.js:1:1:29:0 | | -| es2015.js:8:16:8:16 | y | es2015.js:1:1:29:0 | | -| es2015.js:9:6:9:15 | [a, [, c]] | es2015.js:1:1:29:0 | | -| es2015.js:9:6:9:19 | [a, [, c]] = x | es2015.js:1:1:29:0 | | -| es2015.js:9:7:9:7 | a | es2015.js:1:1:29:0 | | -| es2015.js:9:10:9:14 | [, c] | es2015.js:1:1:29:0 | | -| es2015.js:9:13:9:13 | c | es2015.js:1:1:29:0 | | -| es2015.js:9:19:9:19 | x | es2015.js:1:1:29:0 | | -| es2015.js:11:9:11:14 | [a, c] | es2015.js:1:1:29:0 | | -| es2015.js:11:10:11:10 | a | es2015.js:1:1:29:0 | | -| es2015.js:11:13:11:13 | c | es2015.js:1:1:29:0 | | -| es2015.js:12:11:12:11 | d | es2015.js:1:1:29:0 | | -| es2015.js:13:3:13:9 | console | es2015.js:1:1:29:0 | | -| es2015.js:13:3:13:13 | console.log | es2015.js:1:1:29:0 | | -| es2015.js:13:3:13:16 | console.log(d) | es2015.js:1:1:29:0 | | -| es2015.js:13:11:13:13 | log | es2015.js:1:1:29:0 | | -| es2015.js:13:15:13:15 | d | es2015.js:1:1:29:0 | | -| es2015.js:17:10:17:10 | g | es2015.js:1:1:29:0 | | -| es2015.js:17:12:17:22 | { x, y: z } | es2015.js:1:1:29:0 | | -| es2015.js:17:14:17:14 | x | es2015.js:1:1:29:0 | | -| es2015.js:17:14:17:14 | x | es2015.js:1:1:29:0 | | -| es2015.js:17:17:17:17 | y | es2015.js:1:1:29:0 | | -| es2015.js:17:20:17:20 | z | es2015.js:1:1:29:0 | | -| es2015.js:18:6:18:15 | { [x]: w } | es2015.js:1:1:29:0 | | -| es2015.js:18:6:18:19 | { [x]: w } = z | es2015.js:1:1:29:0 | | -| es2015.js:18:9:18:9 | x | es2015.js:1:1:29:0 | | -| es2015.js:18:13:18:13 | w | es2015.js:1:1:29:0 | | -| es2015.js:18:19:18:19 | z | es2015.js:1:1:29:0 | | -| es2015.js:19:9:19:9 | w | es2015.js:1:1:29:0 | | -| es2015.js:22:11:22:13 | foo | es2015.js:1:1:29:0 | | -| es2015.js:22:15:22:15 | n | es2015.js:1:1:29:0 | | -| es2015.js:23:8:23:8 | n | es2015.js:1:1:29:0 | | -| es2015.js:23:8:23:10 | n-- | es2015.js:1:1:29:0 | | -| es2015.js:23:8:23:12 | n-->0 | es2015.js:1:1:29:0 | | -| es2015.js:23:12:23:12 | 0 | es2015.js:1:1:29:0 | | -| es2015.js:24:3:24:9 | yield n | es2015.js:1:1:29:0 | | -| es2015.js:24:9:24:9 | n | es2015.js:1:1:29:0 | | -| es2015.js:25:2:25:14 | yield* foo(1) | es2015.js:1:1:29:0 | | -| es2015.js:25:9:25:11 | foo | es2015.js:1:1:29:0 | | -| es2015.js:25:9:25:14 | foo(1) | es2015.js:1:1:29:0 | | -| es2015.js:25:13:25:13 | 1 | es2015.js:1:1:29:0 | | -| es2015.js:28:10:28:12 | bar | es2015.js:1:1:29:0 | | -| es2015.js:28:14:28:14 | x | es2015.js:1:1:29:0 | | -| es2015.js:28:17:28:17 | y | es2015.js:1:1:29:0 | | -| es2015.js:28:19:28:19 | x | es2015.js:1:1:29:0 | | -| es2015.js:28:19:28:22 | x+19 | es2015.js:1:1:29:0 | | -| es2015.js:28:21:28:22 | 19 | es2015.js:1:1:29:0 | | -| functions.js:1:10:1:10 | f | functions.js:1:1:10:7 | | -| functions.js:2:2:2:5 | in_f | functions.js:1:1:10:7 | | -| functions.js:3:9:3:17 | also_in_f | functions.js:1:1:10:7 | | -| functions.js:4:3:6:4 | (functi ... f;\\n\\t\\t}) | functions.js:1:1:10:7 | | -| functions.js:4:3:8:4 | (functi ... in\\n\\t\\t}) | functions.js:1:1:10:7 | | -| functions.js:4:4:6:3 | functio ... _f;\\n\\t\\t} | functions.js:1:1:10:7 | | -| functions.js:5:4:5:11 | not_in_f | functions.js:1:1:10:7 | | -| functions.js:6:6:8:3 | {\\n\\t\\t\\tx: ... ain\\n\\t\\t} | functions.js:1:1:10:7 | | -| functions.js:7:4:7:4 | x | functions.js:1:1:10:7 | | -| functions.js:7:7:7:16 | in_f_again | functions.js:1:1:10:7 | | -| functions.js:10:1:10:6 | global | functions.js:1:1:10:7 | | -| legacyletexpr.js:1:1:1:7 | console | legacyletexpr.js:1:1:3:42 | | -| legacyletexpr.js:1:1:1:11 | console.log | legacyletexpr.js:1:1:3:42 | | -| legacyletexpr.js:1:1:1:39 | console ... x + y) | legacyletexpr.js:1:1:3:42 | | -| legacyletexpr.js:1:9:1:11 | log | legacyletexpr.js:1:1:3:42 | | -| legacyletexpr.js:1:13:1:38 | let (x ... ) x + y | legacyletexpr.js:1:1:3:42 | | -| legacyletexpr.js:1:18:1:18 | x | legacyletexpr.js:1:1:3:42 | | -| legacyletexpr.js:1:18:1:23 | x = 23 | legacyletexpr.js:1:1:3:42 | | -| legacyletexpr.js:1:22:1:23 | 23 | legacyletexpr.js:1:1:3:42 | | -| legacyletexpr.js:1:26:1:26 | y | legacyletexpr.js:1:1:3:42 | | -| legacyletexpr.js:1:26:1:31 | y = 19 | legacyletexpr.js:1:1:3:42 | | -| legacyletexpr.js:1:30:1:31 | 19 | legacyletexpr.js:1:1:3:42 | | -| legacyletexpr.js:1:34:1:34 | x | legacyletexpr.js:1:1:3:42 | | -| legacyletexpr.js:1:34:1:38 | x + y | legacyletexpr.js:1:1:3:42 | | -| legacyletexpr.js:1:38:1:38 | y | legacyletexpr.js:1:1:3:42 | | -| mozextensions.js:1:1:1:5 | array | mozextensions.js:1:1:3:42 | | -| mozextensions.js:1:1:1:9 | array.map | mozextensions.js:1:1:3:42 | | -| mozextensions.js:1:1:1:26 | array.m ... x) x+1) | mozextensions.js:1:1:3:42 | | -| mozextensions.js:1:7:1:9 | map | mozextensions.js:1:1:3:42 | | -| mozextensions.js:1:11:1:25 | function(x) x+1 | mozextensions.js:1:1:3:42 | | -| mozextensions.js:1:20:1:20 | x | mozextensions.js:1:1:3:42 | | -| mozextensions.js:1:23:1:23 | x | mozextensions.js:1:1:3:42 | | -| mozextensions.js:1:23:1:25 | x+1 | mozextensions.js:1:1:3:42 | | -| mozextensions.js:1:25:1:25 | 1 | mozextensions.js:1:1:3:42 | | -| others.js:1:1:1:2 | 23 | others.js:1:1:5:2 | | -| others.js:1:1:1:6 | 23, 42 | others.js:1:1:5:2 | | -| others.js:1:5:1:6 | 42 | others.js:1:1:5:2 | | -| others.js:2:1:2:2 | 23 | others.js:1:1:5:2 | | -| others.js:2:1:2:10 | 23, 42, 56 | others.js:1:1:5:2 | | -| others.js:2:5:2:6 | 42 | others.js:1:1:5:2 | | -| others.js:2:9:2:10 | 56 | others.js:1:1:5:2 | | -| others.js:3:1:3:4 | true | others.js:1:1:5:2 | | -| others.js:3:1:3:12 | true ? 0 : 1 | others.js:1:1:5:2 | | -| others.js:3:8:3:8 | 0 | others.js:1:1:5:2 | | -| others.js:3:12:3:12 | 1 | others.js:1:1:5:2 | | -| others.js:4:10:4:10 | p | others.js:1:1:5:2 | | -| others.js:4:10:4:10 | p | others.js:1:1:5:2 | | -| others.js:4:15:4:15 | o | others.js:1:1:5:2 | | -| primaries.js:1:1:1:4 | null | primaries.js:1:1:32:17 | | -| primaries.js:2:1:2:4 | true | primaries.js:1:1:32:17 | | -| primaries.js:3:1:3:5 | false | primaries.js:1:1:32:17 | | -| primaries.js:4:1:4:2 | 23 | primaries.js:1:1:32:17 | | -| primaries.js:5:1:5:3 | 2.3 | primaries.js:1:1:32:17 | | -| primaries.js:6:1:6:3 | .42 | primaries.js:1:1:32:17 | | -| primaries.js:7:1:7:6 | 7.6e23 | primaries.js:1:1:32:17 | | -| primaries.js:8:1:8:5 | 1E-42 | primaries.js:1:1:32:17 | | -| primaries.js:9:1:9:10 | 0xdeadbeef | primaries.js:1:1:32:17 | | -| primaries.js:10:1:10:7 | "Hello" | primaries.js:1:1:32:17 | | -| primaries.js:11:1:11:7 | 'world' | primaries.js:1:1:32:17 | | -| primaries.js:12:1:12:13 | "'what?'\\x0a" | primaries.js:1:1:32:17 | | -| primaries.js:13:1:13:10 | '"why?"\\n' | primaries.js:1:1:32:17 | | -| primaries.js:14:1:14:15 | /^(need?le)+/gi | primaries.js:1:1:32:17 | | -| primaries.js:15:1:15:4 | (23) | primaries.js:1:1:32:17 | | -| primaries.js:15:2:15:3 | 23 | primaries.js:1:1:32:17 | | -| primaries.js:16:1:16:17 | [23, 42, , "hi" ] | primaries.js:1:1:32:17 | | -| primaries.js:16:2:16:3 | 23 | primaries.js:1:1:32:17 | | -| primaries.js:16:6:16:7 | 42 | primaries.js:1:1:32:17 | | -| primaries.js:16:12:16:15 | "hi" | primaries.js:1:1:32:17 | | -| primaries.js:17:1:21:16 | ({ x: 2 ... v) {}}) | primaries.js:1:1:32:17 | | -| primaries.js:17:2:21:15 | { x: 23 ... (v) {}} | primaries.js:1:1:32:17 | | -| primaries.js:17:4:17:4 | x | primaries.js:1:1:32:17 | | -| primaries.js:17:7:17:8 | 23 | primaries.js:1:1:32:17 | | -| primaries.js:18:4:18:4 | y | primaries.js:1:1:32:17 | | -| primaries.js:18:7:18:10 | this | primaries.js:1:1:32:17 | | -| primaries.js:19:8:19:8 | o | primaries.js:1:1:32:17 | | -| primaries.js:19:9:19:13 | () {} | primaries.js:1:1:32:17 | | -| primaries.js:20:8:20:8 | p | primaries.js:1:1:32:17 | | -| primaries.js:20:9:20:13 | () {} | primaries.js:1:1:32:17 | | -| primaries.js:21:8:21:8 | p | primaries.js:1:1:32:17 | | -| primaries.js:21:9:21:14 | (v) {} | primaries.js:1:1:32:17 | | -| primaries.js:21:10:21:10 | v | primaries.js:1:1:32:17 | | -| primaries.js:22:1:22:9 | new Array | primaries.js:1:1:32:17 | | -| primaries.js:22:5:22:9 | Array | primaries.js:1:1:32:17 | | -| primaries.js:23:1:23:12 | new Object() | primaries.js:1:1:32:17 | | -| primaries.js:23:5:23:10 | Object | primaries.js:1:1:32:17 | | -| primaries.js:24:1:24:16 | new String("hi") | primaries.js:1:1:32:17 | | -| primaries.js:24:5:24:10 | String | primaries.js:1:1:32:17 | | -| primaries.js:24:12:24:15 | "hi" | primaries.js:1:1:32:17 | | -| primaries.js:25:1:25:6 | String | primaries.js:1:1:32:17 | | -| primaries.js:25:1:25:10 | String("") | primaries.js:1:1:32:17 | | -| primaries.js:25:8:25:9 | "" | primaries.js:1:1:32:17 | | -| primaries.js:26:1:26:6 | Object | primaries.js:1:1:32:17 | | -| primaries.js:26:1:26:13 | Object.create | primaries.js:1:1:32:17 | | -| primaries.js:26:1:26:17 | Object.create({}) | primaries.js:1:1:32:17 | | -| primaries.js:26:8:26:13 | create | primaries.js:1:1:32:17 | | -| primaries.js:26:15:26:16 | {} | primaries.js:1:1:32:17 | | -| primaries.js:27:1:27:6 | String | primaries.js:1:1:32:17 | | -| primaries.js:27:1:27:29 | String[ ... erse()] | primaries.js:1:1:32:17 | | -| primaries.js:27:8:27:18 | 'epytotorp' | primaries.js:1:1:32:17 | | -| primaries.js:27:8:27:26 | 'epytotorp'.reverse | primaries.js:1:1:32:17 | | -| primaries.js:27:8:27:28 | 'epytot ... verse() | primaries.js:1:1:32:17 | | -| primaries.js:27:20:27:26 | reverse | primaries.js:1:1:32:17 | | -| primaries.js:28:1:28:6 | ((42)) | primaries.js:1:1:32:17 | | -| primaries.js:28:2:28:5 | (42) | primaries.js:1:1:32:17 | | -| primaries.js:28:3:28:4 | 42 | primaries.js:1:1:32:17 | | -| primaries.js:29:1:29:13 | /\\2147483648/ | primaries.js:1:1:32:17 | | -| primaries.js:30:1:30:26 | /a{2147 ... 83649}/ | primaries.js:1:1:32:17 | | -| primaries.js:31:1:31:16 | /a{-2147483648}/ | primaries.js:1:1:32:17 | | -| primaries.js:32:1:32:16 | /a{-2147483649}/ | primaries.js:1:1:32:17 | | -| surrogates.js:1:5:1:5 | a | surrogates.js:1:1:4:15 | | -| surrogates.js:1:5:1:16 | a = "\\ud800" | surrogates.js:1:1:4:15 | | -| surrogates.js:1:9:1:16 | "\\ud800" | surrogates.js:1:1:4:15 | | -| surrogates.js:2:1:2:8 | /\\uD800/ | surrogates.js:1:1:4:15 | | -| surrogates.js:2:1:2:13 | /\\uD800/.test | surrogates.js:1:1:4:15 | | -| surrogates.js:2:1:2:16 | /\\uD800/.test(a) | surrogates.js:1:1:4:15 | | -| surrogates.js:2:10:2:13 | test | surrogates.js:1:1:4:15 | | -| surrogates.js:2:15:2:15 | a | surrogates.js:1:1:4:15 | | -| surrogates.js:3:1:3:14 | "\\uD834\\uDF06" | surrogates.js:1:1:4:15 | | -| surrogates.js:4:1:4:14 | '\\udc00\\ud800' | surrogates.js:1:1:4:15 | | -| unary.js:1:1:1:3 | -23 | unary.js:1:1:7:24 | | -| unary.js:1:2:1:3 | 23 | unary.js:1:1:7:24 | | -| unary.js:2:1:2:3 | +42 | unary.js:1:1:7:24 | | -| unary.js:2:2:2:3 | 42 | unary.js:1:1:7:24 | | -| unary.js:3:1:3:5 | !true | unary.js:1:1:7:24 | | -| unary.js:3:2:3:5 | true | unary.js:1:1:7:24 | | -| unary.js:4:1:4:2 | ~2 | unary.js:1:1:7:24 | | -| unary.js:4:2:4:2 | 2 | unary.js:1:1:7:24 | | -| unary.js:5:1:5:13 | typeof Object | unary.js:1:1:7:24 | | -| unary.js:5:8:5:13 | Object | unary.js:1:1:7:24 | | -| unary.js:6:1:6:7 | void(0) | unary.js:1:1:7:24 | | -| unary.js:6:5:6:7 | (0) | unary.js:1:1:7:24 | | -| unary.js:6:6:6:6 | 0 | unary.js:1:1:7:24 | | -| unary.js:7:1:7:23 | delete ... ototype | unary.js:1:1:7:24 | | -| unary.js:7:8:7:13 | Object | unary.js:1:1:7:24 | | -| unary.js:7:8:7:23 | Object.prototype | unary.js:1:1:7:24 | | -| unary.js:7:15:7:23 | prototype | unary.js:1:1:7:24 | | -| update.js:1:1:1:3 | ++a | update.js:1:1:5:0 | | -| update.js:1:3:1:3 | a | update.js:1:1:5:0 | | -| update.js:2:1:2:1 | a | update.js:1:1:5:0 | | -| update.js:2:1:2:3 | a++ | update.js:1:1:5:0 | | -| update.js:3:1:3:3 | --b | update.js:1:1:5:0 | | -| update.js:3:3:3:3 | b | update.js:1:1:5:0 | | -| update.js:4:1:4:1 | b | update.js:1:1:5:0 | | -| update.js:4:1:4:3 | b-- | update.js:1:1:5:0 | | diff --git a/javascript/ql/test/library-tests/Expr/getTopLevel.ql b/javascript/ql/test/library-tests/Expr/getTopLevel.ql deleted file mode 100644 index 2a6c923b8871..000000000000 --- a/javascript/ql/test/library-tests/Expr/getTopLevel.ql +++ /dev/null @@ -1,4 +0,0 @@ -import javascript - -from Expr e -select e, e.getTopLevel() diff --git a/javascript/ql/test/library-tests/Expr/getTopLevel.qll b/javascript/ql/test/library-tests/Expr/getTopLevel.qll new file mode 100644 index 000000000000..d4aeba0cf8fe --- /dev/null +++ b/javascript/ql/test/library-tests/Expr/getTopLevel.qll @@ -0,0 +1,3 @@ +import javascript + +query predicate test_getTopLevel(Expr e, TopLevel res) { res = e.getTopLevel() } diff --git a/javascript/ql/test/library-tests/Expr/isPure.expected b/javascript/ql/test/library-tests/Expr/isPure.expected deleted file mode 100644 index 578cf6285c2a..000000000000 --- a/javascript/ql/test/library-tests/Expr/isPure.expected +++ /dev/null @@ -1,284 +0,0 @@ -| assignment.js:1:1:1:1 | a | -| assignment.js:1:5:1:6 | 23 | -| assignment.js:2:1:2:1 | a | -| assignment.js:2:6:2:7 | 19 | -| assignment.js:3:1:3:1 | a | -| assignment.js:3:6:3:6 | 9 | -| assignment.js:4:1:4:1 | a | -| assignment.js:4:6:4:6 | b | -| assignment.js:5:1:5:1 | a | -| assignment.js:5:6:5:6 | 2 | -| assignment.js:6:1:6:1 | a | -| assignment.js:6:6:6:6 | 2 | -| assignment.js:7:1:7:1 | a | -| assignment.js:7:7:7:7 | 8 | -| assignment.js:8:1:8:1 | a | -| assignment.js:8:7:8:7 | 7 | -| assignment.js:9:1:9:1 | a | -| assignment.js:9:8:9:8 | 2 | -| assignment.js:10:1:10:1 | a | -| assignment.js:10:6:10:6 | 2 | -| assignment.js:11:1:11:1 | a | -| assignment.js:11:6:11:6 | 1 | -| assignment.js:12:1:12:1 | a | -| assignment.js:12:6:12:6 | 3 | -| binary.js:1:1:1:1 | 1 | -| binary.js:1:1:1:6 | 1 << 2 | -| binary.js:1:6:1:6 | 2 | -| binary.js:2:1:2:1 | 2 | -| binary.js:2:1:2:6 | 2 >> 1 | -| binary.js:2:6:2:6 | 1 | -| binary.js:3:1:3:1 | 2 | -| binary.js:3:1:3:7 | 2 >>> 1 | -| binary.js:3:7:3:7 | 1 | -| binary.js:4:1:4:2 | 23 | -| binary.js:4:1:4:7 | 23 + 19 | -| binary.js:4:6:4:7 | 19 | -| binary.js:5:1:5:2 | 42 | -| binary.js:5:1:5:7 | 42 - 19 | -| binary.js:5:6:5:7 | 19 | -| binary.js:6:1:6:1 | 2 | -| binary.js:6:1:6:5 | 2 * 3 | -| binary.js:6:5:6:5 | 3 | -| binary.js:7:1:7:1 | 8 | -| binary.js:7:1:7:5 | 8 / 5 | -| binary.js:7:5:7:5 | 5 | -| binary.js:8:1:8:1 | 2 | -| binary.js:8:1:8:5 | 2 % 1 | -| binary.js:8:5:8:5 | 1 | -| binary.js:9:1:9:1 | 2 | -| binary.js:9:1:9:5 | 2 \| 3 | -| binary.js:9:5:9:5 | 3 | -| binary.js:10:1:10:1 | 2 | -| binary.js:10:1:10:5 | 2 ^ 3 | -| binary.js:10:5:10:5 | 3 | -| binary.js:11:1:11:1 | 2 | -| binary.js:11:1:11:5 | 2 & 3 | -| binary.js:11:5:11:5 | 3 | -| binary.js:12:1:12:11 | 'prototype' | -| binary.js:12:1:12:21 | 'protot ... Object | -| binary.js:12:16:12:21 | Object | -| binary.js:13:1:13:2 | [] | -| binary.js:13:1:13:19 | [] instanceof Array | -| binary.js:13:15:13:19 | Array | -| binary.js:14:1:14:1 | 1 | -| binary.js:14:1:14:6 | 1 && 2 | -| binary.js:14:6:14:6 | 2 | -| binary.js:15:1:15:1 | 1 | -| binary.js:15:1:15:6 | 1 \|\| 2 | -| binary.js:15:6:15:6 | 2 | -| comparison.js:1:1:1:1 | 1 | -| comparison.js:1:1:1:6 | 1 == 1 | -| comparison.js:1:6:1:6 | 1 | -| comparison.js:2:1:2:1 | 1 | -| comparison.js:2:1:2:6 | 1 != 2 | -| comparison.js:2:6:2:6 | 2 | -| comparison.js:3:1:3:1 | 1 | -| comparison.js:3:1:3:7 | 1 === 1 | -| comparison.js:3:7:3:7 | 1 | -| comparison.js:4:1:4:1 | 1 | -| comparison.js:4:1:4:7 | 1 !== 2 | -| comparison.js:4:7:4:7 | 2 | -| comparison.js:5:1:5:1 | 1 | -| comparison.js:5:1:5:5 | 1 < 2 | -| comparison.js:5:5:5:5 | 2 | -| comparison.js:6:1:6:1 | 1 | -| comparison.js:6:1:6:6 | 1 <= 2 | -| comparison.js:6:6:6:6 | 2 | -| comparison.js:7:1:7:1 | 2 | -| comparison.js:7:1:7:5 | 2 > 1 | -| comparison.js:7:5:7:5 | 1 | -| comparison.js:8:1:8:1 | 2 | -| comparison.js:8:1:8:6 | 2 >= 1 | -| comparison.js:8:6:8:6 | 1 | -| es2015.js:1:1:1:18 | ["a", "ab", "abc"] | -| es2015.js:1:1:1:22 | ["a", " ... c"].map | -| es2015.js:1:2:1:4 | "a" | -| es2015.js:1:7:1:10 | "ab" | -| es2015.js:1:13:1:17 | "abc" | -| es2015.js:1:20:1:22 | map | -| es2015.js:1:24:1:24 | s | -| es2015.js:1:24:1:36 | s => s.length | -| es2015.js:1:29:1:29 | s | -| es2015.js:1:29:1:36 | s.length | -| es2015.js:1:31:1:36 | length | -| es2015.js:2:1:2:11 | setInterval | -| es2015.js:2:13:2:23 | () => ++cnt | -| es2015.js:2:21:2:23 | cnt | -| es2015.js:2:26:2:29 | 1000 | -| es2015.js:3:1:3:10 | setTimeout | -| es2015.js:3:12:3:39 | () => { ... p!"); } | -| es2015.js:3:20:3:24 | alert | -| es2015.js:3:26:3:35 | "Wake up!" | -| es2015.js:3:42:3:46 | 60000 | -| es2015.js:5:1:5:10 | [a, ...as] | -| es2015.js:5:2:5:2 | a | -| es2015.js:5:5:5:9 | ...as | -| es2015.js:5:8:5:9 | as | -| es2015.js:6:5:6:9 | Array | -| es2015.js:6:11:6:17 | ...elts | -| es2015.js:6:14:6:17 | elts | -| es2015.js:8:10:8:10 | f | -| es2015.js:8:12:8:17 | [x, y] | -| es2015.js:8:13:8:13 | x | -| es2015.js:8:16:8:16 | y | -| es2015.js:9:6:9:15 | [a, [, c]] | -| es2015.js:9:7:9:7 | a | -| es2015.js:9:10:9:14 | [, c] | -| es2015.js:9:13:9:13 | c | -| es2015.js:9:19:9:19 | x | -| es2015.js:11:9:11:14 | [a, c] | -| es2015.js:11:10:11:10 | a | -| es2015.js:11:13:11:13 | c | -| es2015.js:12:11:12:11 | d | -| es2015.js:13:3:13:9 | console | -| es2015.js:13:3:13:13 | console.log | -| es2015.js:13:11:13:13 | log | -| es2015.js:13:15:13:15 | d | -| es2015.js:17:10:17:10 | g | -| es2015.js:17:12:17:22 | { x, y: z } | -| es2015.js:17:14:17:14 | x | -| es2015.js:17:14:17:14 | x | -| es2015.js:17:17:17:17 | y | -| es2015.js:17:20:17:20 | z | -| es2015.js:18:6:18:15 | { [x]: w } | -| es2015.js:18:9:18:9 | x | -| es2015.js:18:13:18:13 | w | -| es2015.js:18:19:18:19 | z | -| es2015.js:19:9:19:9 | w | -| es2015.js:22:11:22:13 | foo | -| es2015.js:22:15:22:15 | n | -| es2015.js:23:8:23:8 | n | -| es2015.js:23:12:23:12 | 0 | -| es2015.js:24:9:24:9 | n | -| es2015.js:25:9:25:11 | foo | -| es2015.js:25:13:25:13 | 1 | -| es2015.js:28:10:28:12 | bar | -| es2015.js:28:14:28:14 | x | -| es2015.js:28:17:28:17 | y | -| es2015.js:28:19:28:19 | x | -| es2015.js:28:19:28:22 | x+19 | -| es2015.js:28:21:28:22 | 19 | -| functions.js:1:10:1:10 | f | -| functions.js:2:2:2:5 | in_f | -| functions.js:3:9:3:17 | also_in_f | -| functions.js:4:3:6:4 | (functi ... f;\\n\\t\\t}) | -| functions.js:4:4:6:3 | functio ... _f;\\n\\t\\t} | -| functions.js:5:4:5:11 | not_in_f | -| functions.js:6:6:8:3 | {\\n\\t\\t\\tx: ... ain\\n\\t\\t} | -| functions.js:7:4:7:4 | x | -| functions.js:7:7:7:16 | in_f_again | -| functions.js:10:1:10:6 | global | -| legacyletexpr.js:1:1:1:7 | console | -| legacyletexpr.js:1:1:1:11 | console.log | -| legacyletexpr.js:1:9:1:11 | log | -| legacyletexpr.js:1:18:1:18 | x | -| legacyletexpr.js:1:22:1:23 | 23 | -| legacyletexpr.js:1:26:1:26 | y | -| legacyletexpr.js:1:30:1:31 | 19 | -| legacyletexpr.js:1:34:1:34 | x | -| legacyletexpr.js:1:34:1:38 | x + y | -| legacyletexpr.js:1:38:1:38 | y | -| mozextensions.js:1:1:1:5 | array | -| mozextensions.js:1:1:1:9 | array.map | -| mozextensions.js:1:7:1:9 | map | -| mozextensions.js:1:11:1:25 | function(x) x+1 | -| mozextensions.js:1:20:1:20 | x | -| mozextensions.js:1:23:1:23 | x | -| mozextensions.js:1:23:1:25 | x+1 | -| mozextensions.js:1:25:1:25 | 1 | -| others.js:1:1:1:2 | 23 | -| others.js:1:1:1:6 | 23, 42 | -| others.js:1:5:1:6 | 42 | -| others.js:2:1:2:2 | 23 | -| others.js:2:1:2:10 | 23, 42, 56 | -| others.js:2:5:2:6 | 42 | -| others.js:2:9:2:10 | 56 | -| others.js:3:1:3:4 | true | -| others.js:3:1:3:12 | true ? 0 : 1 | -| others.js:3:8:3:8 | 0 | -| others.js:3:12:3:12 | 1 | -| others.js:4:10:4:10 | p | -| others.js:4:15:4:15 | o | -| primaries.js:1:1:1:4 | null | -| primaries.js:2:1:2:4 | true | -| primaries.js:3:1:3:5 | false | -| primaries.js:4:1:4:2 | 23 | -| primaries.js:5:1:5:3 | 2.3 | -| primaries.js:6:1:6:3 | .42 | -| primaries.js:7:1:7:6 | 7.6e23 | -| primaries.js:8:1:8:5 | 1E-42 | -| primaries.js:9:1:9:10 | 0xdeadbeef | -| primaries.js:10:1:10:7 | "Hello" | -| primaries.js:11:1:11:7 | 'world' | -| primaries.js:12:1:12:13 | "'what?'\\x0a" | -| primaries.js:13:1:13:10 | '"why?"\\n' | -| primaries.js:14:1:14:15 | /^(need?le)+/gi | -| primaries.js:15:1:15:4 | (23) | -| primaries.js:15:2:15:3 | 23 | -| primaries.js:16:1:16:17 | [23, 42, , "hi" ] | -| primaries.js:16:2:16:3 | 23 | -| primaries.js:16:6:16:7 | 42 | -| primaries.js:16:12:16:15 | "hi" | -| primaries.js:17:1:21:16 | ({ x: 2 ... v) {}}) | -| primaries.js:17:2:21:15 | { x: 23 ... (v) {}} | -| primaries.js:17:4:17:4 | x | -| primaries.js:17:7:17:8 | 23 | -| primaries.js:18:4:18:4 | y | -| primaries.js:18:7:18:10 | this | -| primaries.js:19:8:19:8 | o | -| primaries.js:19:9:19:13 | () {} | -| primaries.js:20:8:20:8 | p | -| primaries.js:20:9:20:13 | () {} | -| primaries.js:21:8:21:8 | p | -| primaries.js:21:9:21:14 | (v) {} | -| primaries.js:21:10:21:10 | v | -| primaries.js:22:5:22:9 | Array | -| primaries.js:23:5:23:10 | Object | -| primaries.js:24:5:24:10 | String | -| primaries.js:24:12:24:15 | "hi" | -| primaries.js:25:1:25:6 | String | -| primaries.js:25:8:25:9 | "" | -| primaries.js:26:1:26:6 | Object | -| primaries.js:26:1:26:13 | Object.create | -| primaries.js:26:8:26:13 | create | -| primaries.js:26:15:26:16 | {} | -| primaries.js:27:1:27:6 | String | -| primaries.js:27:8:27:18 | 'epytotorp' | -| primaries.js:27:8:27:26 | 'epytotorp'.reverse | -| primaries.js:27:20:27:26 | reverse | -| primaries.js:28:1:28:6 | ((42)) | -| primaries.js:28:2:28:5 | (42) | -| primaries.js:28:3:28:4 | 42 | -| primaries.js:29:1:29:13 | /\\2147483648/ | -| primaries.js:30:1:30:26 | /a{2147 ... 83649}/ | -| primaries.js:31:1:31:16 | /a{-2147483648}/ | -| primaries.js:32:1:32:16 | /a{-2147483649}/ | -| surrogates.js:1:5:1:5 | a | -| surrogates.js:1:9:1:16 | "\\ud800" | -| surrogates.js:2:1:2:8 | /\\uD800/ | -| surrogates.js:2:1:2:13 | /\\uD800/.test | -| surrogates.js:2:10:2:13 | test | -| surrogates.js:2:15:2:15 | a | -| surrogates.js:3:1:3:14 | "\\uD834\\uDF06" | -| surrogates.js:4:1:4:14 | '\\udc00\\ud800' | -| unary.js:1:1:1:3 | -23 | -| unary.js:1:2:1:3 | 23 | -| unary.js:2:1:2:3 | +42 | -| unary.js:2:2:2:3 | 42 | -| unary.js:3:1:3:5 | !true | -| unary.js:3:2:3:5 | true | -| unary.js:4:1:4:2 | ~2 | -| unary.js:4:2:4:2 | 2 | -| unary.js:5:1:5:13 | typeof Object | -| unary.js:5:8:5:13 | Object | -| unary.js:6:1:6:7 | void(0) | -| unary.js:6:5:6:7 | (0) | -| unary.js:6:6:6:6 | 0 | -| unary.js:7:8:7:13 | Object | -| unary.js:7:8:7:23 | Object.prototype | -| unary.js:7:15:7:23 | prototype | -| update.js:1:3:1:3 | a | -| update.js:2:1:2:1 | a | -| update.js:3:3:3:3 | b | -| update.js:4:1:4:1 | b | diff --git a/javascript/ql/test/library-tests/Expr/isPure.ql b/javascript/ql/test/library-tests/Expr/isPure.ql deleted file mode 100644 index f516db8f3d6d..000000000000 --- a/javascript/ql/test/library-tests/Expr/isPure.ql +++ /dev/null @@ -1,5 +0,0 @@ -import javascript - -from Expr e -where e.isPure() -select e diff --git a/javascript/ql/test/library-tests/Expr/isPure.qll b/javascript/ql/test/library-tests/Expr/isPure.qll new file mode 100644 index 000000000000..11e55bc6e216 --- /dev/null +++ b/javascript/ql/test/library-tests/Expr/isPure.qll @@ -0,0 +1,3 @@ +import javascript + +query predicate test_isPure(Expr e) { e.isPure() } diff --git a/javascript/ql/test/library-tests/Expr/stripParens.expected b/javascript/ql/test/library-tests/Expr/stripParens.expected deleted file mode 100644 index a18baf967bd8..000000000000 --- a/javascript/ql/test/library-tests/Expr/stripParens.expected +++ /dev/null @@ -1,6 +0,0 @@ -| functions.js:4:3:6:4 | (functi ... f;\\n\\t\\t}) | functions.js:4:4:6:3 | functio ... _f;\\n\\t\\t} | -| primaries.js:15:1:15:4 | (23) | primaries.js:15:2:15:3 | 23 | -| primaries.js:17:1:21:16 | ({ x: 2 ... v) {}}) | primaries.js:17:2:21:15 | { x: 23 ... (v) {}} | -| primaries.js:28:1:28:6 | ((42)) | primaries.js:28:3:28:4 | 42 | -| primaries.js:28:2:28:5 | (42) | primaries.js:28:3:28:4 | 42 | -| unary.js:6:5:6:7 | (0) | unary.js:6:6:6:6 | 0 | diff --git a/javascript/ql/test/library-tests/Expr/stripParens.ql b/javascript/ql/test/library-tests/Expr/stripParens.ql deleted file mode 100644 index 06b7cbfb00c1..000000000000 --- a/javascript/ql/test/library-tests/Expr/stripParens.ql +++ /dev/null @@ -1,7 +0,0 @@ -import javascript - -from ParExpr e, Expr inner -where - inner = e.stripParens() and - inner != e -select e, inner diff --git a/javascript/ql/test/library-tests/Expr/stripParens.qll b/javascript/ql/test/library-tests/Expr/stripParens.qll new file mode 100644 index 000000000000..7d5a4d506fe6 --- /dev/null +++ b/javascript/ql/test/library-tests/Expr/stripParens.qll @@ -0,0 +1,3 @@ +import javascript + +query predicate test_stripParens(ParExpr e, Expr inner) { inner = e.stripParens() and inner != e } diff --git a/javascript/ql/test/library-tests/Expr/tests.expected b/javascript/ql/test/library-tests/Expr/tests.expected new file mode 100644 index 000000000000..dfb9852170d9 --- /dev/null +++ b/javascript/ql/test/library-tests/Expr/tests.expected @@ -0,0 +1,1874 @@ +test_getParent +| assignment.js:1:1:1:1 | a | assignment.js:1:1:1:6 | a = 23 | +| assignment.js:1:1:1:6 | a = 23 | assignment.js:1:1:1:7 | a = 23; | +| assignment.js:1:5:1:6 | 23 | assignment.js:1:1:1:6 | a = 23 | +| assignment.js:2:1:2:1 | a | assignment.js:2:1:2:7 | a += 19 | +| assignment.js:2:1:2:7 | a += 19 | assignment.js:2:1:2:8 | a += 19; | +| assignment.js:2:6:2:7 | 19 | assignment.js:2:1:2:7 | a += 19 | +| assignment.js:3:1:3:1 | a | assignment.js:3:1:3:6 | a -= 9 | +| assignment.js:3:1:3:6 | a -= 9 | assignment.js:3:1:3:7 | a -= 9; | +| assignment.js:3:6:3:6 | 9 | assignment.js:3:1:3:6 | a -= 9 | +| assignment.js:4:1:4:1 | a | assignment.js:4:1:4:6 | a *= b | +| assignment.js:4:1:4:6 | a *= b | assignment.js:4:1:4:7 | a *= b; | +| assignment.js:4:6:4:6 | b | assignment.js:4:1:4:6 | a *= b | +| assignment.js:5:1:5:1 | a | assignment.js:5:1:5:6 | a /= 2 | +| assignment.js:5:1:5:6 | a /= 2 | assignment.js:5:1:5:7 | a /= 2; | +| assignment.js:5:6:5:6 | 2 | assignment.js:5:1:5:6 | a /= 2 | +| assignment.js:6:1:6:1 | a | assignment.js:6:1:6:6 | a %= 2 | +| assignment.js:6:1:6:6 | a %= 2 | assignment.js:6:1:6:7 | a %= 2; | +| assignment.js:6:6:6:6 | 2 | assignment.js:6:1:6:6 | a %= 2 | +| assignment.js:7:1:7:1 | a | assignment.js:7:1:7:7 | a <<= 8 | +| assignment.js:7:1:7:7 | a <<= 8 | assignment.js:7:1:7:8 | a <<= 8; | +| assignment.js:7:7:7:7 | 8 | assignment.js:7:1:7:7 | a <<= 8 | +| assignment.js:8:1:8:1 | a | assignment.js:8:1:8:7 | a >>= 7 | +| assignment.js:8:1:8:7 | a >>= 7 | assignment.js:8:1:8:8 | a >>= 7; | +| assignment.js:8:7:8:7 | 7 | assignment.js:8:1:8:7 | a >>= 7 | +| assignment.js:9:1:9:1 | a | assignment.js:9:1:9:8 | a >>>= 2 | +| assignment.js:9:1:9:8 | a >>>= 2 | assignment.js:9:1:9:9 | a >>>= 2; | +| assignment.js:9:8:9:8 | 2 | assignment.js:9:1:9:8 | a >>>= 2 | +| assignment.js:10:1:10:1 | a | assignment.js:10:1:10:6 | a \|= 2 | +| assignment.js:10:1:10:6 | a \|= 2 | assignment.js:10:1:10:7 | a \|= 2; | +| assignment.js:10:6:10:6 | 2 | assignment.js:10:1:10:6 | a \|= 2 | +| assignment.js:11:1:11:1 | a | assignment.js:11:1:11:6 | a ^= 1 | +| assignment.js:11:1:11:6 | a ^= 1 | assignment.js:11:1:11:7 | a ^= 1; | +| assignment.js:11:6:11:6 | 1 | assignment.js:11:1:11:6 | a ^= 1 | +| assignment.js:12:1:12:1 | a | assignment.js:12:1:12:6 | a &= 3 | +| assignment.js:12:1:12:6 | a &= 3 | assignment.js:12:1:12:7 | a &= 3; | +| assignment.js:12:6:12:6 | 3 | assignment.js:12:1:12:6 | a &= 3 | +| binary.js:1:1:1:1 | 1 | binary.js:1:1:1:6 | 1 << 2 | +| binary.js:1:1:1:6 | 1 << 2 | binary.js:1:1:1:7 | 1 << 2; | +| binary.js:1:6:1:6 | 2 | binary.js:1:1:1:6 | 1 << 2 | +| binary.js:2:1:2:1 | 2 | binary.js:2:1:2:6 | 2 >> 1 | +| binary.js:2:1:2:6 | 2 >> 1 | binary.js:2:1:2:7 | 2 >> 1; | +| binary.js:2:6:2:6 | 1 | binary.js:2:1:2:6 | 2 >> 1 | +| binary.js:3:1:3:1 | 2 | binary.js:3:1:3:7 | 2 >>> 1 | +| binary.js:3:1:3:7 | 2 >>> 1 | binary.js:3:1:3:8 | 2 >>> 1; | +| binary.js:3:7:3:7 | 1 | binary.js:3:1:3:7 | 2 >>> 1 | +| binary.js:4:1:4:2 | 23 | binary.js:4:1:4:7 | 23 + 19 | +| binary.js:4:1:4:7 | 23 + 19 | binary.js:4:1:4:8 | 23 + 19; | +| binary.js:4:6:4:7 | 19 | binary.js:4:1:4:7 | 23 + 19 | +| binary.js:5:1:5:2 | 42 | binary.js:5:1:5:7 | 42 - 19 | +| binary.js:5:1:5:7 | 42 - 19 | binary.js:5:1:5:8 | 42 - 19; | +| binary.js:5:6:5:7 | 19 | binary.js:5:1:5:7 | 42 - 19 | +| binary.js:6:1:6:1 | 2 | binary.js:6:1:6:5 | 2 * 3 | +| binary.js:6:1:6:5 | 2 * 3 | binary.js:6:1:6:6 | 2 * 3; | +| binary.js:6:5:6:5 | 3 | binary.js:6:1:6:5 | 2 * 3 | +| binary.js:7:1:7:1 | 8 | binary.js:7:1:7:5 | 8 / 5 | +| binary.js:7:1:7:5 | 8 / 5 | binary.js:7:1:7:6 | 8 / 5; | +| binary.js:7:5:7:5 | 5 | binary.js:7:1:7:5 | 8 / 5 | +| binary.js:8:1:8:1 | 2 | binary.js:8:1:8:5 | 2 % 1 | +| binary.js:8:1:8:5 | 2 % 1 | binary.js:8:1:8:6 | 2 % 1; | +| binary.js:8:5:8:5 | 1 | binary.js:8:1:8:5 | 2 % 1 | +| binary.js:9:1:9:1 | 2 | binary.js:9:1:9:5 | 2 \| 3 | +| binary.js:9:1:9:5 | 2 \| 3 | binary.js:9:1:9:6 | 2 \| 3; | +| binary.js:9:5:9:5 | 3 | binary.js:9:1:9:5 | 2 \| 3 | +| binary.js:10:1:10:1 | 2 | binary.js:10:1:10:5 | 2 ^ 3 | +| binary.js:10:1:10:5 | 2 ^ 3 | binary.js:10:1:10:6 | 2 ^ 3; | +| binary.js:10:5:10:5 | 3 | binary.js:10:1:10:5 | 2 ^ 3 | +| binary.js:11:1:11:1 | 2 | binary.js:11:1:11:5 | 2 & 3 | +| binary.js:11:1:11:5 | 2 & 3 | binary.js:11:1:11:6 | 2 & 3; | +| binary.js:11:5:11:5 | 3 | binary.js:11:1:11:5 | 2 & 3 | +| binary.js:12:1:12:11 | 'prototype' | binary.js:12:1:12:21 | 'protot ... Object | +| binary.js:12:1:12:21 | 'protot ... Object | binary.js:12:1:12:22 | 'protot ... Object; | +| binary.js:12:16:12:21 | Object | binary.js:12:1:12:21 | 'protot ... Object | +| binary.js:13:1:13:2 | [] | binary.js:13:1:13:19 | [] instanceof Array | +| binary.js:13:1:13:19 | [] instanceof Array | binary.js:13:1:13:20 | [] instanceof Array; | +| binary.js:13:15:13:19 | Array | binary.js:13:1:13:19 | [] instanceof Array | +| binary.js:14:1:14:1 | 1 | binary.js:14:1:14:6 | 1 && 2 | +| binary.js:14:1:14:6 | 1 && 2 | binary.js:14:1:14:7 | 1 && 2; | +| binary.js:14:6:14:6 | 2 | binary.js:14:1:14:6 | 1 && 2 | +| binary.js:15:1:15:1 | 1 | binary.js:15:1:15:6 | 1 \|\| 2 | +| binary.js:15:1:15:6 | 1 \|\| 2 | binary.js:15:1:15:7 | 1 \|\| 2; | +| binary.js:15:6:15:6 | 2 | binary.js:15:1:15:6 | 1 \|\| 2 | +| comparison.js:1:1:1:1 | 1 | comparison.js:1:1:1:6 | 1 == 1 | +| comparison.js:1:1:1:6 | 1 == 1 | comparison.js:1:1:1:7 | 1 == 1; | +| comparison.js:1:6:1:6 | 1 | comparison.js:1:1:1:6 | 1 == 1 | +| comparison.js:2:1:2:1 | 1 | comparison.js:2:1:2:6 | 1 != 2 | +| comparison.js:2:1:2:6 | 1 != 2 | comparison.js:2:1:2:7 | 1 != 2; | +| comparison.js:2:6:2:6 | 2 | comparison.js:2:1:2:6 | 1 != 2 | +| comparison.js:3:1:3:1 | 1 | comparison.js:3:1:3:7 | 1 === 1 | +| comparison.js:3:1:3:7 | 1 === 1 | comparison.js:3:1:3:8 | 1 === 1; | +| comparison.js:3:7:3:7 | 1 | comparison.js:3:1:3:7 | 1 === 1 | +| comparison.js:4:1:4:1 | 1 | comparison.js:4:1:4:7 | 1 !== 2 | +| comparison.js:4:1:4:7 | 1 !== 2 | comparison.js:4:1:4:8 | 1 !== 2; | +| comparison.js:4:7:4:7 | 2 | comparison.js:4:1:4:7 | 1 !== 2 | +| comparison.js:5:1:5:1 | 1 | comparison.js:5:1:5:5 | 1 < 2 | +| comparison.js:5:1:5:5 | 1 < 2 | comparison.js:5:1:5:6 | 1 < 2; | +| comparison.js:5:5:5:5 | 2 | comparison.js:5:1:5:5 | 1 < 2 | +| comparison.js:6:1:6:1 | 1 | comparison.js:6:1:6:6 | 1 <= 2 | +| comparison.js:6:1:6:6 | 1 <= 2 | comparison.js:6:1:6:7 | 1 <= 2; | +| comparison.js:6:6:6:6 | 2 | comparison.js:6:1:6:6 | 1 <= 2 | +| comparison.js:7:1:7:1 | 2 | comparison.js:7:1:7:5 | 2 > 1 | +| comparison.js:7:1:7:5 | 2 > 1 | comparison.js:7:1:7:6 | 2 > 1; | +| comparison.js:7:5:7:5 | 1 | comparison.js:7:1:7:5 | 2 > 1 | +| comparison.js:8:1:8:1 | 2 | comparison.js:8:1:8:6 | 2 >= 1 | +| comparison.js:8:1:8:6 | 2 >= 1 | comparison.js:8:1:8:7 | 2 >= 1; | +| comparison.js:8:6:8:6 | 1 | comparison.js:8:1:8:6 | 2 >= 1 | +| es2015.js:1:1:1:18 | ["a", "ab", "abc"] | es2015.js:1:1:1:22 | ["a", " ... c"].map | +| es2015.js:1:1:1:22 | ["a", " ... c"].map | es2015.js:1:1:1:37 | ["a", " ... length) | +| es2015.js:1:1:1:37 | ["a", " ... length) | es2015.js:1:1:1:38 | ["a", " ... ength); | +| es2015.js:1:2:1:4 | "a" | es2015.js:1:1:1:18 | ["a", "ab", "abc"] | +| es2015.js:1:7:1:10 | "ab" | es2015.js:1:1:1:18 | ["a", "ab", "abc"] | +| es2015.js:1:13:1:17 | "abc" | es2015.js:1:1:1:18 | ["a", "ab", "abc"] | +| es2015.js:1:20:1:22 | map | es2015.js:1:1:1:22 | ["a", " ... c"].map | +| es2015.js:1:24:1:24 | s | es2015.js:1:24:1:36 | s => s.length | +| es2015.js:1:24:1:36 | s => s.length | es2015.js:1:1:1:37 | ["a", " ... length) | +| es2015.js:1:29:1:29 | s | es2015.js:1:29:1:36 | s.length | +| es2015.js:1:29:1:36 | s.length | es2015.js:1:24:1:36 | s => s.length | +| es2015.js:1:31:1:36 | length | es2015.js:1:29:1:36 | s.length | +| es2015.js:2:1:2:11 | setInterval | es2015.js:2:1:2:30 | setInte ... , 1000) | +| es2015.js:2:1:2:30 | setInte ... , 1000) | es2015.js:2:1:2:31 | setInte ... 1000); | +| es2015.js:2:13:2:23 | () => ++cnt | es2015.js:2:1:2:30 | setInte ... , 1000) | +| es2015.js:2:19:2:23 | ++cnt | es2015.js:2:13:2:23 | () => ++cnt | +| es2015.js:2:21:2:23 | cnt | es2015.js:2:19:2:23 | ++cnt | +| es2015.js:2:26:2:29 | 1000 | es2015.js:2:1:2:30 | setInte ... , 1000) | +| es2015.js:3:1:3:10 | setTimeout | es2015.js:3:1:3:47 | setTime ... 60000) | +| es2015.js:3:1:3:47 | setTime ... 60000) | es2015.js:3:1:3:48 | setTime ... 60000); | +| es2015.js:3:12:3:39 | () => { ... p!"); } | es2015.js:3:1:3:47 | setTime ... 60000) | +| es2015.js:3:20:3:24 | alert | es2015.js:3:20:3:36 | alert("Wake up!") | +| es2015.js:3:20:3:36 | alert("Wake up!") | es2015.js:3:20:3:37 | alert("Wake up!"); | +| es2015.js:3:26:3:35 | "Wake up!" | es2015.js:3:20:3:36 | alert("Wake up!") | +| es2015.js:3:42:3:46 | 60000 | es2015.js:3:1:3:47 | setTime ... 60000) | +| es2015.js:5:1:5:10 | [a, ...as] | es2015.js:5:1:5:11 | [a, ...as]; | +| es2015.js:5:2:5:2 | a | es2015.js:5:1:5:10 | [a, ...as] | +| es2015.js:5:5:5:9 | ...as | es2015.js:5:1:5:10 | [a, ...as] | +| es2015.js:5:8:5:9 | as | es2015.js:5:5:5:9 | ...as | +| es2015.js:6:1:6:18 | new Array(...elts) | es2015.js:6:1:6:19 | new Array(...elts); | +| es2015.js:6:5:6:9 | Array | es2015.js:6:1:6:18 | new Array(...elts) | +| es2015.js:6:11:6:17 | ...elts | es2015.js:6:1:6:18 | new Array(...elts) | +| es2015.js:6:14:6:17 | elts | es2015.js:6:11:6:17 | ...elts | +| es2015.js:8:10:8:10 | f | es2015.js:8:1:15:1 | functio ... );\\n\\t}\\n} | +| es2015.js:8:12:8:17 | [x, y] | es2015.js:8:1:15:1 | functio ... );\\n\\t}\\n} | +| es2015.js:8:13:8:13 | x | es2015.js:8:12:8:17 | [x, y] | +| es2015.js:8:16:8:16 | y | es2015.js:8:12:8:17 | [x, y] | +| es2015.js:9:6:9:15 | [a, [, c]] | es2015.js:9:6:9:19 | [a, [, c]] = x | +| es2015.js:9:6:9:19 | [a, [, c]] = x | es2015.js:9:2:9:20 | var [a, [, c]] = x; | +| es2015.js:9:7:9:7 | a | es2015.js:9:6:9:15 | [a, [, c]] | +| es2015.js:9:10:9:14 | [, c] | es2015.js:9:6:9:15 | [a, [, c]] | +| es2015.js:9:13:9:13 | c | es2015.js:9:10:9:14 | [, c] | +| es2015.js:9:19:9:19 | x | es2015.js:9:6:9:19 | [a, [, c]] = x | +| es2015.js:11:9:11:14 | [a, c] | es2015.js:11:3:11:15 | throw [a, c]; | +| es2015.js:11:10:11:10 | a | es2015.js:11:9:11:14 | [a, c] | +| es2015.js:11:13:11:13 | c | es2015.js:11:9:11:14 | [a, c] | +| es2015.js:12:11:12:11 | d | es2015.js:12:4:14:2 | catch ( ... (d);\\n\\t} | +| es2015.js:13:3:13:9 | console | es2015.js:13:3:13:13 | console.log | +| es2015.js:13:3:13:13 | console.log | es2015.js:13:3:13:16 | console.log(d) | +| es2015.js:13:3:13:16 | console.log(d) | es2015.js:13:3:13:17 | console.log(d); | +| es2015.js:13:11:13:13 | log | es2015.js:13:3:13:13 | console.log | +| es2015.js:13:15:13:15 | d | es2015.js:13:3:13:16 | console.log(d) | +| es2015.js:17:10:17:10 | g | es2015.js:17:1:20:1 | functio ... rn w;\\n} | +| es2015.js:17:12:17:22 | { x, y: z } | es2015.js:17:1:20:1 | functio ... rn w;\\n} | +| es2015.js:17:14:17:14 | x | es2015.js:17:14:17:14 | x | +| es2015.js:17:14:17:14 | x | es2015.js:17:14:17:14 | x | +| es2015.js:17:17:17:17 | y | es2015.js:17:17:17:20 | y: z | +| es2015.js:17:20:17:20 | z | es2015.js:17:17:17:20 | y: z | +| es2015.js:18:6:18:15 | { [x]: w } | es2015.js:18:6:18:19 | { [x]: w } = z | +| es2015.js:18:6:18:19 | { [x]: w } = z | es2015.js:18:2:18:20 | var { [x]: w } = z; | +| es2015.js:18:9:18:9 | x | es2015.js:18:8:18:13 | [x]: w | +| es2015.js:18:13:18:13 | w | es2015.js:18:8:18:13 | [x]: w | +| es2015.js:18:19:18:19 | z | es2015.js:18:6:18:19 | { [x]: w } = z | +| es2015.js:19:9:19:9 | w | es2015.js:19:2:19:10 | return w; | +| es2015.js:22:11:22:13 | foo | es2015.js:22:1:26:1 | functio ... o(1);\\n} | +| es2015.js:22:15:22:15 | n | es2015.js:22:1:26:1 | functio ... o(1);\\n} | +| es2015.js:23:8:23:8 | n | es2015.js:23:8:23:10 | n-- | +| es2015.js:23:8:23:10 | n-- | es2015.js:23:8:23:12 | n-->0 | +| es2015.js:23:8:23:12 | n-->0 | es2015.js:23:2:24:10 | while(n ... ield n; | +| es2015.js:23:12:23:12 | 0 | es2015.js:23:8:23:12 | n-->0 | +| es2015.js:24:3:24:9 | yield n | es2015.js:24:3:24:10 | yield n; | +| es2015.js:24:9:24:9 | n | es2015.js:24:3:24:9 | yield n | +| es2015.js:25:2:25:14 | yield* foo(1) | es2015.js:25:2:25:15 | yield* foo(1); | +| es2015.js:25:9:25:11 | foo | es2015.js:25:9:25:14 | foo(1) | +| es2015.js:25:9:25:14 | foo(1) | es2015.js:25:2:25:14 | yield* foo(1) | +| es2015.js:25:13:25:13 | 1 | es2015.js:25:9:25:14 | foo(1) | +| es2015.js:28:10:28:12 | bar | es2015.js:28:1:28:26 | functio ... +19) {} | +| es2015.js:28:14:28:14 | x | es2015.js:28:1:28:26 | functio ... +19) {} | +| es2015.js:28:17:28:17 | y | es2015.js:28:1:28:26 | functio ... +19) {} | +| es2015.js:28:19:28:19 | x | es2015.js:28:19:28:22 | x+19 | +| es2015.js:28:19:28:22 | x+19 | es2015.js:28:1:28:26 | functio ... +19) {} | +| es2015.js:28:21:28:22 | 19 | es2015.js:28:19:28:22 | x+19 | +| functions.js:1:10:1:10 | f | functions.js:1:1:9:1 | functio ... \\t\\t});\\n} | +| functions.js:2:2:2:5 | in_f | functions.js:2:2:2:6 | in_f; | +| functions.js:3:9:3:17 | also_in_f | functions.js:3:2:8:5 | while ( ... n\\n\\t\\t}); | +| functions.js:4:3:6:4 | (functi ... f;\\n\\t\\t}) | functions.js:4:3:8:4 | (functi ... in\\n\\t\\t}) | +| functions.js:4:3:8:4 | (functi ... in\\n\\t\\t}) | functions.js:4:3:8:5 | (functi ... n\\n\\t\\t}); | +| functions.js:4:4:6:3 | functio ... _f;\\n\\t\\t} | functions.js:4:3:6:4 | (functi ... f;\\n\\t\\t}) | +| functions.js:5:4:5:11 | not_in_f | functions.js:5:4:5:12 | not_in_f; | +| functions.js:6:6:8:3 | {\\n\\t\\t\\tx: ... ain\\n\\t\\t} | functions.js:4:3:8:4 | (functi ... in\\n\\t\\t}) | +| functions.js:7:4:7:4 | x | functions.js:7:4:7:16 | x: in_f_again | +| functions.js:7:7:7:16 | in_f_again | functions.js:7:4:7:16 | x: in_f_again | +| functions.js:10:1:10:6 | global | functions.js:10:1:10:7 | global; | +| legacyletexpr.js:1:1:1:7 | console | legacyletexpr.js:1:1:1:11 | console.log | +| legacyletexpr.js:1:1:1:11 | console.log | legacyletexpr.js:1:1:1:39 | console ... x + y) | +| legacyletexpr.js:1:1:1:39 | console ... x + y) | legacyletexpr.js:1:1:1:40 | console ... x + y); | +| legacyletexpr.js:1:9:1:11 | log | legacyletexpr.js:1:1:1:11 | console.log | +| legacyletexpr.js:1:13:1:38 | let (x ... ) x + y | legacyletexpr.js:1:1:1:39 | console ... x + y) | +| legacyletexpr.js:1:18:1:18 | x | legacyletexpr.js:1:18:1:23 | x = 23 | +| legacyletexpr.js:1:18:1:23 | x = 23 | legacyletexpr.js:1:13:1:38 | let (x ... ) x + y | +| legacyletexpr.js:1:22:1:23 | 23 | legacyletexpr.js:1:18:1:23 | x = 23 | +| legacyletexpr.js:1:26:1:26 | y | legacyletexpr.js:1:26:1:31 | y = 19 | +| legacyletexpr.js:1:26:1:31 | y = 19 | legacyletexpr.js:1:13:1:38 | let (x ... ) x + y | +| legacyletexpr.js:1:30:1:31 | 19 | legacyletexpr.js:1:26:1:31 | y = 19 | +| legacyletexpr.js:1:34:1:34 | x | legacyletexpr.js:1:34:1:38 | x + y | +| legacyletexpr.js:1:34:1:38 | x + y | legacyletexpr.js:1:13:1:38 | let (x ... ) x + y | +| legacyletexpr.js:1:38:1:38 | y | legacyletexpr.js:1:34:1:38 | x + y | +| mozextensions.js:1:1:1:5 | array | mozextensions.js:1:1:1:9 | array.map | +| mozextensions.js:1:1:1:9 | array.map | mozextensions.js:1:1:1:26 | array.m ... x) x+1) | +| mozextensions.js:1:1:1:26 | array.m ... x) x+1) | mozextensions.js:1:1:1:27 | array.m ... ) x+1); | +| mozextensions.js:1:7:1:9 | map | mozextensions.js:1:1:1:9 | array.map | +| mozextensions.js:1:11:1:25 | function(x) x+1 | mozextensions.js:1:1:1:26 | array.m ... x) x+1) | +| mozextensions.js:1:20:1:20 | x | mozextensions.js:1:11:1:25 | function(x) x+1 | +| mozextensions.js:1:23:1:23 | x | mozextensions.js:1:23:1:25 | x+1 | +| mozextensions.js:1:23:1:25 | x+1 | mozextensions.js:1:11:1:25 | function(x) x+1 | +| mozextensions.js:1:25:1:25 | 1 | mozextensions.js:1:23:1:25 | x+1 | +| others.js:1:1:1:2 | 23 | others.js:1:1:1:6 | 23, 42 | +| others.js:1:1:1:6 | 23, 42 | others.js:1:1:1:7 | 23, 42; | +| others.js:1:5:1:6 | 42 | others.js:1:1:1:6 | 23, 42 | +| others.js:2:1:2:2 | 23 | others.js:2:1:2:10 | 23, 42, 56 | +| others.js:2:1:2:10 | 23, 42, 56 | others.js:2:1:2:11 | 23, 42, 56; | +| others.js:2:5:2:6 | 42 | others.js:2:1:2:10 | 23, 42, 56 | +| others.js:2:9:2:10 | 56 | others.js:2:1:2:10 | 23, 42, 56 | +| others.js:3:1:3:4 | true | others.js:3:1:3:12 | true ? 0 : 1 | +| others.js:3:1:3:12 | true ? 0 : 1 | others.js:3:1:3:13 | true ? 0 : 1; | +| others.js:3:8:3:8 | 0 | others.js:3:1:3:12 | true ? 0 : 1 | +| others.js:3:12:3:12 | 1 | others.js:3:1:3:12 | true ? 0 : 1 | +| others.js:4:10:4:10 | p | others.js:4:6:4:10 | var p | +| others.js:4:10:4:10 | p | others.js:4:10:4:10 | p | +| others.js:4:15:4:15 | o | others.js:4:1:5:2 | for (var p in o)\\n\\t; | +| primaries.js:1:1:1:4 | null | primaries.js:1:1:1:5 | null; | +| primaries.js:2:1:2:4 | true | primaries.js:2:1:2:5 | true; | +| primaries.js:3:1:3:5 | false | primaries.js:3:1:3:6 | false; | +| primaries.js:4:1:4:2 | 23 | primaries.js:4:1:4:3 | 23; | +| primaries.js:5:1:5:3 | 2.3 | primaries.js:5:1:5:4 | 2.3; | +| primaries.js:6:1:6:3 | .42 | primaries.js:6:1:6:4 | .42; | +| primaries.js:7:1:7:6 | 7.6e23 | primaries.js:7:1:7:7 | 7.6e23; | +| primaries.js:8:1:8:5 | 1E-42 | primaries.js:8:1:8:6 | 1E-42; | +| primaries.js:9:1:9:10 | 0xdeadbeef | primaries.js:9:1:9:11 | 0xdeadbeef; | +| primaries.js:10:1:10:7 | "Hello" | primaries.js:10:1:10:8 | "Hello"; | +| primaries.js:11:1:11:7 | 'world' | primaries.js:11:1:11:8 | 'world'; | +| primaries.js:12:1:12:13 | "'what?'\\x0a" | primaries.js:12:1:12:14 | "'what?'\\x0a"; | +| primaries.js:13:1:13:10 | '"why?"\\n' | primaries.js:13:1:13:11 | '"why?"\\n'; | +| primaries.js:14:1:14:15 | /^(need?le)+/gi | primaries.js:14:1:14:16 | /^(need?le)+/gi; | +| primaries.js:15:1:15:4 | (23) | primaries.js:15:1:15:5 | (23); | +| primaries.js:15:2:15:3 | 23 | primaries.js:15:1:15:4 | (23) | +| primaries.js:16:1:16:17 | [23, 42, , "hi" ] | primaries.js:16:1:16:18 | [23, 42, , "hi" ]; | +| primaries.js:16:2:16:3 | 23 | primaries.js:16:1:16:17 | [23, 42, , "hi" ] | +| primaries.js:16:6:16:7 | 42 | primaries.js:16:1:16:17 | [23, 42, , "hi" ] | +| primaries.js:16:12:16:15 | "hi" | primaries.js:16:1:16:17 | [23, 42, , "hi" ] | +| primaries.js:17:1:21:16 | ({ x: 2 ... v) {}}) | primaries.js:17:1:21:17 | ({ x: 2 ... ) {}}); | +| primaries.js:17:2:21:15 | { x: 23 ... (v) {}} | primaries.js:17:1:21:16 | ({ x: 2 ... v) {}}) | +| primaries.js:17:4:17:4 | x | primaries.js:17:4:17:8 | x: 23 | +| primaries.js:17:7:17:8 | 23 | primaries.js:17:4:17:8 | x: 23 | +| primaries.js:18:4:18:4 | y | primaries.js:18:4:18:10 | y: this | +| primaries.js:18:7:18:10 | this | primaries.js:18:4:18:10 | y: this | +| primaries.js:19:8:19:8 | o | primaries.js:19:4:19:13 | get o() {} | +| primaries.js:19:9:19:13 | () {} | primaries.js:19:4:19:13 | get o() {} | +| primaries.js:20:8:20:8 | p | primaries.js:20:4:20:13 | get p() {} | +| primaries.js:20:9:20:13 | () {} | primaries.js:20:4:20:13 | get p() {} | +| primaries.js:21:8:21:8 | p | primaries.js:21:4:21:14 | set p(v) {} | +| primaries.js:21:9:21:14 | (v) {} | primaries.js:21:4:21:14 | set p(v) {} | +| primaries.js:21:10:21:10 | v | primaries.js:21:9:21:14 | (v) {} | +| primaries.js:22:1:22:9 | new Array | primaries.js:22:1:22:10 | new Array; | +| primaries.js:22:5:22:9 | Array | primaries.js:22:1:22:9 | new Array | +| primaries.js:23:1:23:12 | new Object() | primaries.js:23:1:23:13 | new Object(); | +| primaries.js:23:5:23:10 | Object | primaries.js:23:1:23:12 | new Object() | +| primaries.js:24:1:24:16 | new String("hi") | primaries.js:24:1:24:17 | new String("hi"); | +| primaries.js:24:5:24:10 | String | primaries.js:24:1:24:16 | new String("hi") | +| primaries.js:24:12:24:15 | "hi" | primaries.js:24:1:24:16 | new String("hi") | +| primaries.js:25:1:25:6 | String | primaries.js:25:1:25:10 | String("") | +| primaries.js:25:1:25:10 | String("") | primaries.js:25:1:25:11 | String(""); | +| primaries.js:25:8:25:9 | "" | primaries.js:25:1:25:10 | String("") | +| primaries.js:26:1:26:6 | Object | primaries.js:26:1:26:13 | Object.create | +| primaries.js:26:1:26:13 | Object.create | primaries.js:26:1:26:17 | Object.create({}) | +| primaries.js:26:1:26:17 | Object.create({}) | primaries.js:26:1:26:18 | Object.create({}); | +| primaries.js:26:8:26:13 | create | primaries.js:26:1:26:13 | Object.create | +| primaries.js:26:15:26:16 | {} | primaries.js:26:1:26:17 | Object.create({}) | +| primaries.js:27:1:27:6 | String | primaries.js:27:1:27:29 | String[ ... erse()] | +| primaries.js:27:1:27:29 | String[ ... erse()] | primaries.js:27:1:27:30 | String[ ... rse()]; | +| primaries.js:27:8:27:18 | 'epytotorp' | primaries.js:27:8:27:26 | 'epytotorp'.reverse | +| primaries.js:27:8:27:26 | 'epytotorp'.reverse | primaries.js:27:8:27:28 | 'epytot ... verse() | +| primaries.js:27:8:27:28 | 'epytot ... verse() | primaries.js:27:1:27:29 | String[ ... erse()] | +| primaries.js:27:20:27:26 | reverse | primaries.js:27:8:27:26 | 'epytotorp'.reverse | +| primaries.js:28:1:28:6 | ((42)) | primaries.js:28:1:28:7 | ((42)); | +| primaries.js:28:2:28:5 | (42) | primaries.js:28:1:28:6 | ((42)) | +| primaries.js:28:3:28:4 | 42 | primaries.js:28:2:28:5 | (42) | +| primaries.js:29:1:29:13 | /\\2147483648/ | primaries.js:29:1:29:14 | /\\2147483648/; | +| primaries.js:30:1:30:26 | /a{2147 ... 83649}/ | primaries.js:30:1:30:27 | /a{2147 ... 3649}/; | +| primaries.js:31:1:31:16 | /a{-2147483648}/ | primaries.js:31:1:31:17 | /a{-2147483648}/; | +| primaries.js:32:1:32:16 | /a{-2147483649}/ | primaries.js:32:1:32:17 | /a{-2147483649}/; | +| surrogates.js:1:5:1:5 | a | surrogates.js:1:5:1:16 | a = "\\ud800" | +| surrogates.js:1:5:1:16 | a = "\\ud800" | surrogates.js:1:1:1:17 | var a = "\\ud800"; | +| surrogates.js:1:9:1:16 | "\\ud800" | surrogates.js:1:5:1:16 | a = "\\ud800" | +| surrogates.js:2:1:2:8 | /\\uD800/ | surrogates.js:2:1:2:13 | /\\uD800/.test | +| surrogates.js:2:1:2:13 | /\\uD800/.test | surrogates.js:2:1:2:16 | /\\uD800/.test(a) | +| surrogates.js:2:1:2:16 | /\\uD800/.test(a) | surrogates.js:2:1:2:17 | /\\uD800/.test(a); | +| surrogates.js:2:10:2:13 | test | surrogates.js:2:1:2:13 | /\\uD800/.test | +| surrogates.js:2:15:2:15 | a | surrogates.js:2:1:2:16 | /\\uD800/.test(a) | +| surrogates.js:3:1:3:14 | "\\uD834\\uDF06" | surrogates.js:3:1:3:15 | "\\uD834\\uDF06"; | +| surrogates.js:4:1:4:14 | '\\udc00\\ud800' | surrogates.js:4:1:4:15 | '\\udc00\\ud800'; | +| unary.js:1:1:1:3 | -23 | unary.js:1:1:1:4 | -23; | +| unary.js:1:2:1:3 | 23 | unary.js:1:1:1:3 | -23 | +| unary.js:2:1:2:3 | +42 | unary.js:2:1:2:4 | +42; | +| unary.js:2:2:2:3 | 42 | unary.js:2:1:2:3 | +42 | +| unary.js:3:1:3:5 | !true | unary.js:3:1:3:6 | !true; | +| unary.js:3:2:3:5 | true | unary.js:3:1:3:5 | !true | +| unary.js:4:1:4:2 | ~2 | unary.js:4:1:4:3 | ~2; | +| unary.js:4:2:4:2 | 2 | unary.js:4:1:4:2 | ~2 | +| unary.js:5:1:5:13 | typeof Object | unary.js:5:1:5:14 | typeof Object; | +| unary.js:5:8:5:13 | Object | unary.js:5:1:5:13 | typeof Object | +| unary.js:6:1:6:7 | void(0) | unary.js:6:1:6:8 | void(0); | +| unary.js:6:5:6:7 | (0) | unary.js:6:1:6:7 | void(0) | +| unary.js:6:6:6:6 | 0 | unary.js:6:5:6:7 | (0) | +| unary.js:7:1:7:23 | delete ... ototype | unary.js:7:1:7:24 | delete ... totype; | +| unary.js:7:8:7:13 | Object | unary.js:7:8:7:23 | Object.prototype | +| unary.js:7:8:7:23 | Object.prototype | unary.js:7:1:7:23 | delete ... ototype | +| unary.js:7:15:7:23 | prototype | unary.js:7:8:7:23 | Object.prototype | +| update.js:1:1:1:3 | ++a | update.js:1:1:1:4 | ++a; | +| update.js:1:3:1:3 | a | update.js:1:1:1:3 | ++a | +| update.js:2:1:2:1 | a | update.js:2:1:2:3 | a++ | +| update.js:2:1:2:3 | a++ | update.js:2:1:2:4 | a++; | +| update.js:3:1:3:3 | --b | update.js:3:1:3:4 | --b; | +| update.js:3:3:3:3 | b | update.js:3:1:3:3 | --b | +| update.js:4:1:4:1 | b | update.js:4:1:4:3 | b-- | +| update.js:4:1:4:3 | b-- | update.js:4:1:4:4 | b--; | +test_getTopLevel +| assignment.js:1:1:1:1 | a | assignment.js:1:1:12:7 | | +| assignment.js:1:1:1:6 | a = 23 | assignment.js:1:1:12:7 | | +| assignment.js:1:5:1:6 | 23 | assignment.js:1:1:12:7 | | +| assignment.js:2:1:2:1 | a | assignment.js:1:1:12:7 | | +| assignment.js:2:1:2:7 | a += 19 | assignment.js:1:1:12:7 | | +| assignment.js:2:6:2:7 | 19 | assignment.js:1:1:12:7 | | +| assignment.js:3:1:3:1 | a | assignment.js:1:1:12:7 | | +| assignment.js:3:1:3:6 | a -= 9 | assignment.js:1:1:12:7 | | +| assignment.js:3:6:3:6 | 9 | assignment.js:1:1:12:7 | | +| assignment.js:4:1:4:1 | a | assignment.js:1:1:12:7 | | +| assignment.js:4:1:4:6 | a *= b | assignment.js:1:1:12:7 | | +| assignment.js:4:6:4:6 | b | assignment.js:1:1:12:7 | | +| assignment.js:5:1:5:1 | a | assignment.js:1:1:12:7 | | +| assignment.js:5:1:5:6 | a /= 2 | assignment.js:1:1:12:7 | | +| assignment.js:5:6:5:6 | 2 | assignment.js:1:1:12:7 | | +| assignment.js:6:1:6:1 | a | assignment.js:1:1:12:7 | | +| assignment.js:6:1:6:6 | a %= 2 | assignment.js:1:1:12:7 | | +| assignment.js:6:6:6:6 | 2 | assignment.js:1:1:12:7 | | +| assignment.js:7:1:7:1 | a | assignment.js:1:1:12:7 | | +| assignment.js:7:1:7:7 | a <<= 8 | assignment.js:1:1:12:7 | | +| assignment.js:7:7:7:7 | 8 | assignment.js:1:1:12:7 | | +| assignment.js:8:1:8:1 | a | assignment.js:1:1:12:7 | | +| assignment.js:8:1:8:7 | a >>= 7 | assignment.js:1:1:12:7 | | +| assignment.js:8:7:8:7 | 7 | assignment.js:1:1:12:7 | | +| assignment.js:9:1:9:1 | a | assignment.js:1:1:12:7 | | +| assignment.js:9:1:9:8 | a >>>= 2 | assignment.js:1:1:12:7 | | +| assignment.js:9:8:9:8 | 2 | assignment.js:1:1:12:7 | | +| assignment.js:10:1:10:1 | a | assignment.js:1:1:12:7 | | +| assignment.js:10:1:10:6 | a \|= 2 | assignment.js:1:1:12:7 | | +| assignment.js:10:6:10:6 | 2 | assignment.js:1:1:12:7 | | +| assignment.js:11:1:11:1 | a | assignment.js:1:1:12:7 | | +| assignment.js:11:1:11:6 | a ^= 1 | assignment.js:1:1:12:7 | | +| assignment.js:11:6:11:6 | 1 | assignment.js:1:1:12:7 | | +| assignment.js:12:1:12:1 | a | assignment.js:1:1:12:7 | | +| assignment.js:12:1:12:6 | a &= 3 | assignment.js:1:1:12:7 | | +| assignment.js:12:6:12:6 | 3 | assignment.js:1:1:12:7 | | +| binary.js:1:1:1:1 | 1 | binary.js:1:1:16:0 | | +| binary.js:1:1:1:6 | 1 << 2 | binary.js:1:1:16:0 | | +| binary.js:1:6:1:6 | 2 | binary.js:1:1:16:0 | | +| binary.js:2:1:2:1 | 2 | binary.js:1:1:16:0 | | +| binary.js:2:1:2:6 | 2 >> 1 | binary.js:1:1:16:0 | | +| binary.js:2:6:2:6 | 1 | binary.js:1:1:16:0 | | +| binary.js:3:1:3:1 | 2 | binary.js:1:1:16:0 | | +| binary.js:3:1:3:7 | 2 >>> 1 | binary.js:1:1:16:0 | | +| binary.js:3:7:3:7 | 1 | binary.js:1:1:16:0 | | +| binary.js:4:1:4:2 | 23 | binary.js:1:1:16:0 | | +| binary.js:4:1:4:7 | 23 + 19 | binary.js:1:1:16:0 | | +| binary.js:4:6:4:7 | 19 | binary.js:1:1:16:0 | | +| binary.js:5:1:5:2 | 42 | binary.js:1:1:16:0 | | +| binary.js:5:1:5:7 | 42 - 19 | binary.js:1:1:16:0 | | +| binary.js:5:6:5:7 | 19 | binary.js:1:1:16:0 | | +| binary.js:6:1:6:1 | 2 | binary.js:1:1:16:0 | | +| binary.js:6:1:6:5 | 2 * 3 | binary.js:1:1:16:0 | | +| binary.js:6:5:6:5 | 3 | binary.js:1:1:16:0 | | +| binary.js:7:1:7:1 | 8 | binary.js:1:1:16:0 | | +| binary.js:7:1:7:5 | 8 / 5 | binary.js:1:1:16:0 | | +| binary.js:7:5:7:5 | 5 | binary.js:1:1:16:0 | | +| binary.js:8:1:8:1 | 2 | binary.js:1:1:16:0 | | +| binary.js:8:1:8:5 | 2 % 1 | binary.js:1:1:16:0 | | +| binary.js:8:5:8:5 | 1 | binary.js:1:1:16:0 | | +| binary.js:9:1:9:1 | 2 | binary.js:1:1:16:0 | | +| binary.js:9:1:9:5 | 2 \| 3 | binary.js:1:1:16:0 | | +| binary.js:9:5:9:5 | 3 | binary.js:1:1:16:0 | | +| binary.js:10:1:10:1 | 2 | binary.js:1:1:16:0 | | +| binary.js:10:1:10:5 | 2 ^ 3 | binary.js:1:1:16:0 | | +| binary.js:10:5:10:5 | 3 | binary.js:1:1:16:0 | | +| binary.js:11:1:11:1 | 2 | binary.js:1:1:16:0 | | +| binary.js:11:1:11:5 | 2 & 3 | binary.js:1:1:16:0 | | +| binary.js:11:5:11:5 | 3 | binary.js:1:1:16:0 | | +| binary.js:12:1:12:11 | 'prototype' | binary.js:1:1:16:0 | | +| binary.js:12:1:12:21 | 'protot ... Object | binary.js:1:1:16:0 | | +| binary.js:12:16:12:21 | Object | binary.js:1:1:16:0 | | +| binary.js:13:1:13:2 | [] | binary.js:1:1:16:0 | | +| binary.js:13:1:13:19 | [] instanceof Array | binary.js:1:1:16:0 | | +| binary.js:13:15:13:19 | Array | binary.js:1:1:16:0 | | +| binary.js:14:1:14:1 | 1 | binary.js:1:1:16:0 | | +| binary.js:14:1:14:6 | 1 && 2 | binary.js:1:1:16:0 | | +| binary.js:14:6:14:6 | 2 | binary.js:1:1:16:0 | | +| binary.js:15:1:15:1 | 1 | binary.js:1:1:16:0 | | +| binary.js:15:1:15:6 | 1 \|\| 2 | binary.js:1:1:16:0 | | +| binary.js:15:6:15:6 | 2 | binary.js:1:1:16:0 | | +| comparison.js:1:1:1:1 | 1 | comparison.js:1:1:9:0 | | +| comparison.js:1:1:1:6 | 1 == 1 | comparison.js:1:1:9:0 | | +| comparison.js:1:6:1:6 | 1 | comparison.js:1:1:9:0 | | +| comparison.js:2:1:2:1 | 1 | comparison.js:1:1:9:0 | | +| comparison.js:2:1:2:6 | 1 != 2 | comparison.js:1:1:9:0 | | +| comparison.js:2:6:2:6 | 2 | comparison.js:1:1:9:0 | | +| comparison.js:3:1:3:1 | 1 | comparison.js:1:1:9:0 | | +| comparison.js:3:1:3:7 | 1 === 1 | comparison.js:1:1:9:0 | | +| comparison.js:3:7:3:7 | 1 | comparison.js:1:1:9:0 | | +| comparison.js:4:1:4:1 | 1 | comparison.js:1:1:9:0 | | +| comparison.js:4:1:4:7 | 1 !== 2 | comparison.js:1:1:9:0 | | +| comparison.js:4:7:4:7 | 2 | comparison.js:1:1:9:0 | | +| comparison.js:5:1:5:1 | 1 | comparison.js:1:1:9:0 | | +| comparison.js:5:1:5:5 | 1 < 2 | comparison.js:1:1:9:0 | | +| comparison.js:5:5:5:5 | 2 | comparison.js:1:1:9:0 | | +| comparison.js:6:1:6:1 | 1 | comparison.js:1:1:9:0 | | +| comparison.js:6:1:6:6 | 1 <= 2 | comparison.js:1:1:9:0 | | +| comparison.js:6:6:6:6 | 2 | comparison.js:1:1:9:0 | | +| comparison.js:7:1:7:1 | 2 | comparison.js:1:1:9:0 | | +| comparison.js:7:1:7:5 | 2 > 1 | comparison.js:1:1:9:0 | | +| comparison.js:7:5:7:5 | 1 | comparison.js:1:1:9:0 | | +| comparison.js:8:1:8:1 | 2 | comparison.js:1:1:9:0 | | +| comparison.js:8:1:8:6 | 2 >= 1 | comparison.js:1:1:9:0 | | +| comparison.js:8:6:8:6 | 1 | comparison.js:1:1:9:0 | | +| es2015.js:1:1:1:18 | ["a", "ab", "abc"] | es2015.js:1:1:29:0 | | +| es2015.js:1:1:1:22 | ["a", " ... c"].map | es2015.js:1:1:29:0 | | +| es2015.js:1:1:1:37 | ["a", " ... length) | es2015.js:1:1:29:0 | | +| es2015.js:1:2:1:4 | "a" | es2015.js:1:1:29:0 | | +| es2015.js:1:7:1:10 | "ab" | es2015.js:1:1:29:0 | | +| es2015.js:1:13:1:17 | "abc" | es2015.js:1:1:29:0 | | +| es2015.js:1:20:1:22 | map | es2015.js:1:1:29:0 | | +| es2015.js:1:24:1:24 | s | es2015.js:1:1:29:0 | | +| es2015.js:1:24:1:36 | s => s.length | es2015.js:1:1:29:0 | | +| es2015.js:1:29:1:29 | s | es2015.js:1:1:29:0 | | +| es2015.js:1:29:1:36 | s.length | es2015.js:1:1:29:0 | | +| es2015.js:1:31:1:36 | length | es2015.js:1:1:29:0 | | +| es2015.js:2:1:2:11 | setInterval | es2015.js:1:1:29:0 | | +| es2015.js:2:1:2:30 | setInte ... , 1000) | es2015.js:1:1:29:0 | | +| es2015.js:2:13:2:23 | () => ++cnt | es2015.js:1:1:29:0 | | +| es2015.js:2:19:2:23 | ++cnt | es2015.js:1:1:29:0 | | +| es2015.js:2:21:2:23 | cnt | es2015.js:1:1:29:0 | | +| es2015.js:2:26:2:29 | 1000 | es2015.js:1:1:29:0 | | +| es2015.js:3:1:3:10 | setTimeout | es2015.js:1:1:29:0 | | +| es2015.js:3:1:3:47 | setTime ... 60000) | es2015.js:1:1:29:0 | | +| es2015.js:3:12:3:39 | () => { ... p!"); } | es2015.js:1:1:29:0 | | +| es2015.js:3:20:3:24 | alert | es2015.js:1:1:29:0 | | +| es2015.js:3:20:3:36 | alert("Wake up!") | es2015.js:1:1:29:0 | | +| es2015.js:3:26:3:35 | "Wake up!" | es2015.js:1:1:29:0 | | +| es2015.js:3:42:3:46 | 60000 | es2015.js:1:1:29:0 | | +| es2015.js:5:1:5:10 | [a, ...as] | es2015.js:1:1:29:0 | | +| es2015.js:5:2:5:2 | a | es2015.js:1:1:29:0 | | +| es2015.js:5:5:5:9 | ...as | es2015.js:1:1:29:0 | | +| es2015.js:5:8:5:9 | as | es2015.js:1:1:29:0 | | +| es2015.js:6:1:6:18 | new Array(...elts) | es2015.js:1:1:29:0 | | +| es2015.js:6:5:6:9 | Array | es2015.js:1:1:29:0 | | +| es2015.js:6:11:6:17 | ...elts | es2015.js:1:1:29:0 | | +| es2015.js:6:14:6:17 | elts | es2015.js:1:1:29:0 | | +| es2015.js:8:10:8:10 | f | es2015.js:1:1:29:0 | | +| es2015.js:8:12:8:17 | [x, y] | es2015.js:1:1:29:0 | | +| es2015.js:8:13:8:13 | x | es2015.js:1:1:29:0 | | +| es2015.js:8:16:8:16 | y | es2015.js:1:1:29:0 | | +| es2015.js:9:6:9:15 | [a, [, c]] | es2015.js:1:1:29:0 | | +| es2015.js:9:6:9:19 | [a, [, c]] = x | es2015.js:1:1:29:0 | | +| es2015.js:9:7:9:7 | a | es2015.js:1:1:29:0 | | +| es2015.js:9:10:9:14 | [, c] | es2015.js:1:1:29:0 | | +| es2015.js:9:13:9:13 | c | es2015.js:1:1:29:0 | | +| es2015.js:9:19:9:19 | x | es2015.js:1:1:29:0 | | +| es2015.js:11:9:11:14 | [a, c] | es2015.js:1:1:29:0 | | +| es2015.js:11:10:11:10 | a | es2015.js:1:1:29:0 | | +| es2015.js:11:13:11:13 | c | es2015.js:1:1:29:0 | | +| es2015.js:12:11:12:11 | d | es2015.js:1:1:29:0 | | +| es2015.js:13:3:13:9 | console | es2015.js:1:1:29:0 | | +| es2015.js:13:3:13:13 | console.log | es2015.js:1:1:29:0 | | +| es2015.js:13:3:13:16 | console.log(d) | es2015.js:1:1:29:0 | | +| es2015.js:13:11:13:13 | log | es2015.js:1:1:29:0 | | +| es2015.js:13:15:13:15 | d | es2015.js:1:1:29:0 | | +| es2015.js:17:10:17:10 | g | es2015.js:1:1:29:0 | | +| es2015.js:17:12:17:22 | { x, y: z } | es2015.js:1:1:29:0 | | +| es2015.js:17:14:17:14 | x | es2015.js:1:1:29:0 | | +| es2015.js:17:14:17:14 | x | es2015.js:1:1:29:0 | | +| es2015.js:17:17:17:17 | y | es2015.js:1:1:29:0 | | +| es2015.js:17:20:17:20 | z | es2015.js:1:1:29:0 | | +| es2015.js:18:6:18:15 | { [x]: w } | es2015.js:1:1:29:0 | | +| es2015.js:18:6:18:19 | { [x]: w } = z | es2015.js:1:1:29:0 | | +| es2015.js:18:9:18:9 | x | es2015.js:1:1:29:0 | | +| es2015.js:18:13:18:13 | w | es2015.js:1:1:29:0 | | +| es2015.js:18:19:18:19 | z | es2015.js:1:1:29:0 | | +| es2015.js:19:9:19:9 | w | es2015.js:1:1:29:0 | | +| es2015.js:22:11:22:13 | foo | es2015.js:1:1:29:0 | | +| es2015.js:22:15:22:15 | n | es2015.js:1:1:29:0 | | +| es2015.js:23:8:23:8 | n | es2015.js:1:1:29:0 | | +| es2015.js:23:8:23:10 | n-- | es2015.js:1:1:29:0 | | +| es2015.js:23:8:23:12 | n-->0 | es2015.js:1:1:29:0 | | +| es2015.js:23:12:23:12 | 0 | es2015.js:1:1:29:0 | | +| es2015.js:24:3:24:9 | yield n | es2015.js:1:1:29:0 | | +| es2015.js:24:9:24:9 | n | es2015.js:1:1:29:0 | | +| es2015.js:25:2:25:14 | yield* foo(1) | es2015.js:1:1:29:0 | | +| es2015.js:25:9:25:11 | foo | es2015.js:1:1:29:0 | | +| es2015.js:25:9:25:14 | foo(1) | es2015.js:1:1:29:0 | | +| es2015.js:25:13:25:13 | 1 | es2015.js:1:1:29:0 | | +| es2015.js:28:10:28:12 | bar | es2015.js:1:1:29:0 | | +| es2015.js:28:14:28:14 | x | es2015.js:1:1:29:0 | | +| es2015.js:28:17:28:17 | y | es2015.js:1:1:29:0 | | +| es2015.js:28:19:28:19 | x | es2015.js:1:1:29:0 | | +| es2015.js:28:19:28:22 | x+19 | es2015.js:1:1:29:0 | | +| es2015.js:28:21:28:22 | 19 | es2015.js:1:1:29:0 | | +| functions.js:1:10:1:10 | f | functions.js:1:1:10:7 | | +| functions.js:2:2:2:5 | in_f | functions.js:1:1:10:7 | | +| functions.js:3:9:3:17 | also_in_f | functions.js:1:1:10:7 | | +| functions.js:4:3:6:4 | (functi ... f;\\n\\t\\t}) | functions.js:1:1:10:7 | | +| functions.js:4:3:8:4 | (functi ... in\\n\\t\\t}) | functions.js:1:1:10:7 | | +| functions.js:4:4:6:3 | functio ... _f;\\n\\t\\t} | functions.js:1:1:10:7 | | +| functions.js:5:4:5:11 | not_in_f | functions.js:1:1:10:7 | | +| functions.js:6:6:8:3 | {\\n\\t\\t\\tx: ... ain\\n\\t\\t} | functions.js:1:1:10:7 | | +| functions.js:7:4:7:4 | x | functions.js:1:1:10:7 | | +| functions.js:7:7:7:16 | in_f_again | functions.js:1:1:10:7 | | +| functions.js:10:1:10:6 | global | functions.js:1:1:10:7 | | +| legacyletexpr.js:1:1:1:7 | console | legacyletexpr.js:1:1:3:42 | | +| legacyletexpr.js:1:1:1:11 | console.log | legacyletexpr.js:1:1:3:42 | | +| legacyletexpr.js:1:1:1:39 | console ... x + y) | legacyletexpr.js:1:1:3:42 | | +| legacyletexpr.js:1:9:1:11 | log | legacyletexpr.js:1:1:3:42 | | +| legacyletexpr.js:1:13:1:38 | let (x ... ) x + y | legacyletexpr.js:1:1:3:42 | | +| legacyletexpr.js:1:18:1:18 | x | legacyletexpr.js:1:1:3:42 | | +| legacyletexpr.js:1:18:1:23 | x = 23 | legacyletexpr.js:1:1:3:42 | | +| legacyletexpr.js:1:22:1:23 | 23 | legacyletexpr.js:1:1:3:42 | | +| legacyletexpr.js:1:26:1:26 | y | legacyletexpr.js:1:1:3:42 | | +| legacyletexpr.js:1:26:1:31 | y = 19 | legacyletexpr.js:1:1:3:42 | | +| legacyletexpr.js:1:30:1:31 | 19 | legacyletexpr.js:1:1:3:42 | | +| legacyletexpr.js:1:34:1:34 | x | legacyletexpr.js:1:1:3:42 | | +| legacyletexpr.js:1:34:1:38 | x + y | legacyletexpr.js:1:1:3:42 | | +| legacyletexpr.js:1:38:1:38 | y | legacyletexpr.js:1:1:3:42 | | +| mozextensions.js:1:1:1:5 | array | mozextensions.js:1:1:3:42 | | +| mozextensions.js:1:1:1:9 | array.map | mozextensions.js:1:1:3:42 | | +| mozextensions.js:1:1:1:26 | array.m ... x) x+1) | mozextensions.js:1:1:3:42 | | +| mozextensions.js:1:7:1:9 | map | mozextensions.js:1:1:3:42 | | +| mozextensions.js:1:11:1:25 | function(x) x+1 | mozextensions.js:1:1:3:42 | | +| mozextensions.js:1:20:1:20 | x | mozextensions.js:1:1:3:42 | | +| mozextensions.js:1:23:1:23 | x | mozextensions.js:1:1:3:42 | | +| mozextensions.js:1:23:1:25 | x+1 | mozextensions.js:1:1:3:42 | | +| mozextensions.js:1:25:1:25 | 1 | mozextensions.js:1:1:3:42 | | +| others.js:1:1:1:2 | 23 | others.js:1:1:5:2 | | +| others.js:1:1:1:6 | 23, 42 | others.js:1:1:5:2 | | +| others.js:1:5:1:6 | 42 | others.js:1:1:5:2 | | +| others.js:2:1:2:2 | 23 | others.js:1:1:5:2 | | +| others.js:2:1:2:10 | 23, 42, 56 | others.js:1:1:5:2 | | +| others.js:2:5:2:6 | 42 | others.js:1:1:5:2 | | +| others.js:2:9:2:10 | 56 | others.js:1:1:5:2 | | +| others.js:3:1:3:4 | true | others.js:1:1:5:2 | | +| others.js:3:1:3:12 | true ? 0 : 1 | others.js:1:1:5:2 | | +| others.js:3:8:3:8 | 0 | others.js:1:1:5:2 | | +| others.js:3:12:3:12 | 1 | others.js:1:1:5:2 | | +| others.js:4:10:4:10 | p | others.js:1:1:5:2 | | +| others.js:4:10:4:10 | p | others.js:1:1:5:2 | | +| others.js:4:15:4:15 | o | others.js:1:1:5:2 | | +| primaries.js:1:1:1:4 | null | primaries.js:1:1:32:17 | | +| primaries.js:2:1:2:4 | true | primaries.js:1:1:32:17 | | +| primaries.js:3:1:3:5 | false | primaries.js:1:1:32:17 | | +| primaries.js:4:1:4:2 | 23 | primaries.js:1:1:32:17 | | +| primaries.js:5:1:5:3 | 2.3 | primaries.js:1:1:32:17 | | +| primaries.js:6:1:6:3 | .42 | primaries.js:1:1:32:17 | | +| primaries.js:7:1:7:6 | 7.6e23 | primaries.js:1:1:32:17 | | +| primaries.js:8:1:8:5 | 1E-42 | primaries.js:1:1:32:17 | | +| primaries.js:9:1:9:10 | 0xdeadbeef | primaries.js:1:1:32:17 | | +| primaries.js:10:1:10:7 | "Hello" | primaries.js:1:1:32:17 | | +| primaries.js:11:1:11:7 | 'world' | primaries.js:1:1:32:17 | | +| primaries.js:12:1:12:13 | "'what?'\\x0a" | primaries.js:1:1:32:17 | | +| primaries.js:13:1:13:10 | '"why?"\\n' | primaries.js:1:1:32:17 | | +| primaries.js:14:1:14:15 | /^(need?le)+/gi | primaries.js:1:1:32:17 | | +| primaries.js:15:1:15:4 | (23) | primaries.js:1:1:32:17 | | +| primaries.js:15:2:15:3 | 23 | primaries.js:1:1:32:17 | | +| primaries.js:16:1:16:17 | [23, 42, , "hi" ] | primaries.js:1:1:32:17 | | +| primaries.js:16:2:16:3 | 23 | primaries.js:1:1:32:17 | | +| primaries.js:16:6:16:7 | 42 | primaries.js:1:1:32:17 | | +| primaries.js:16:12:16:15 | "hi" | primaries.js:1:1:32:17 | | +| primaries.js:17:1:21:16 | ({ x: 2 ... v) {}}) | primaries.js:1:1:32:17 | | +| primaries.js:17:2:21:15 | { x: 23 ... (v) {}} | primaries.js:1:1:32:17 | | +| primaries.js:17:4:17:4 | x | primaries.js:1:1:32:17 | | +| primaries.js:17:7:17:8 | 23 | primaries.js:1:1:32:17 | | +| primaries.js:18:4:18:4 | y | primaries.js:1:1:32:17 | | +| primaries.js:18:7:18:10 | this | primaries.js:1:1:32:17 | | +| primaries.js:19:8:19:8 | o | primaries.js:1:1:32:17 | | +| primaries.js:19:9:19:13 | () {} | primaries.js:1:1:32:17 | | +| primaries.js:20:8:20:8 | p | primaries.js:1:1:32:17 | | +| primaries.js:20:9:20:13 | () {} | primaries.js:1:1:32:17 | | +| primaries.js:21:8:21:8 | p | primaries.js:1:1:32:17 | | +| primaries.js:21:9:21:14 | (v) {} | primaries.js:1:1:32:17 | | +| primaries.js:21:10:21:10 | v | primaries.js:1:1:32:17 | | +| primaries.js:22:1:22:9 | new Array | primaries.js:1:1:32:17 | | +| primaries.js:22:5:22:9 | Array | primaries.js:1:1:32:17 | | +| primaries.js:23:1:23:12 | new Object() | primaries.js:1:1:32:17 | | +| primaries.js:23:5:23:10 | Object | primaries.js:1:1:32:17 | | +| primaries.js:24:1:24:16 | new String("hi") | primaries.js:1:1:32:17 | | +| primaries.js:24:5:24:10 | String | primaries.js:1:1:32:17 | | +| primaries.js:24:12:24:15 | "hi" | primaries.js:1:1:32:17 | | +| primaries.js:25:1:25:6 | String | primaries.js:1:1:32:17 | | +| primaries.js:25:1:25:10 | String("") | primaries.js:1:1:32:17 | | +| primaries.js:25:8:25:9 | "" | primaries.js:1:1:32:17 | | +| primaries.js:26:1:26:6 | Object | primaries.js:1:1:32:17 | | +| primaries.js:26:1:26:13 | Object.create | primaries.js:1:1:32:17 | | +| primaries.js:26:1:26:17 | Object.create({}) | primaries.js:1:1:32:17 | | +| primaries.js:26:8:26:13 | create | primaries.js:1:1:32:17 | | +| primaries.js:26:15:26:16 | {} | primaries.js:1:1:32:17 | | +| primaries.js:27:1:27:6 | String | primaries.js:1:1:32:17 | | +| primaries.js:27:1:27:29 | String[ ... erse()] | primaries.js:1:1:32:17 | | +| primaries.js:27:8:27:18 | 'epytotorp' | primaries.js:1:1:32:17 | | +| primaries.js:27:8:27:26 | 'epytotorp'.reverse | primaries.js:1:1:32:17 | | +| primaries.js:27:8:27:28 | 'epytot ... verse() | primaries.js:1:1:32:17 | | +| primaries.js:27:20:27:26 | reverse | primaries.js:1:1:32:17 | | +| primaries.js:28:1:28:6 | ((42)) | primaries.js:1:1:32:17 | | +| primaries.js:28:2:28:5 | (42) | primaries.js:1:1:32:17 | | +| primaries.js:28:3:28:4 | 42 | primaries.js:1:1:32:17 | | +| primaries.js:29:1:29:13 | /\\2147483648/ | primaries.js:1:1:32:17 | | +| primaries.js:30:1:30:26 | /a{2147 ... 83649}/ | primaries.js:1:1:32:17 | | +| primaries.js:31:1:31:16 | /a{-2147483648}/ | primaries.js:1:1:32:17 | | +| primaries.js:32:1:32:16 | /a{-2147483649}/ | primaries.js:1:1:32:17 | | +| surrogates.js:1:5:1:5 | a | surrogates.js:1:1:4:15 | | +| surrogates.js:1:5:1:16 | a = "\\ud800" | surrogates.js:1:1:4:15 | | +| surrogates.js:1:9:1:16 | "\\ud800" | surrogates.js:1:1:4:15 | | +| surrogates.js:2:1:2:8 | /\\uD800/ | surrogates.js:1:1:4:15 | | +| surrogates.js:2:1:2:13 | /\\uD800/.test | surrogates.js:1:1:4:15 | | +| surrogates.js:2:1:2:16 | /\\uD800/.test(a) | surrogates.js:1:1:4:15 | | +| surrogates.js:2:10:2:13 | test | surrogates.js:1:1:4:15 | | +| surrogates.js:2:15:2:15 | a | surrogates.js:1:1:4:15 | | +| surrogates.js:3:1:3:14 | "\\uD834\\uDF06" | surrogates.js:1:1:4:15 | | +| surrogates.js:4:1:4:14 | '\\udc00\\ud800' | surrogates.js:1:1:4:15 | | +| unary.js:1:1:1:3 | -23 | unary.js:1:1:7:24 | | +| unary.js:1:2:1:3 | 23 | unary.js:1:1:7:24 | | +| unary.js:2:1:2:3 | +42 | unary.js:1:1:7:24 | | +| unary.js:2:2:2:3 | 42 | unary.js:1:1:7:24 | | +| unary.js:3:1:3:5 | !true | unary.js:1:1:7:24 | | +| unary.js:3:2:3:5 | true | unary.js:1:1:7:24 | | +| unary.js:4:1:4:2 | ~2 | unary.js:1:1:7:24 | | +| unary.js:4:2:4:2 | 2 | unary.js:1:1:7:24 | | +| unary.js:5:1:5:13 | typeof Object | unary.js:1:1:7:24 | | +| unary.js:5:8:5:13 | Object | unary.js:1:1:7:24 | | +| unary.js:6:1:6:7 | void(0) | unary.js:1:1:7:24 | | +| unary.js:6:5:6:7 | (0) | unary.js:1:1:7:24 | | +| unary.js:6:6:6:6 | 0 | unary.js:1:1:7:24 | | +| unary.js:7:1:7:23 | delete ... ototype | unary.js:1:1:7:24 | | +| unary.js:7:8:7:13 | Object | unary.js:1:1:7:24 | | +| unary.js:7:8:7:23 | Object.prototype | unary.js:1:1:7:24 | | +| unary.js:7:15:7:23 | prototype | unary.js:1:1:7:24 | | +| update.js:1:1:1:3 | ++a | update.js:1:1:5:0 | | +| update.js:1:3:1:3 | a | update.js:1:1:5:0 | | +| update.js:2:1:2:1 | a | update.js:1:1:5:0 | | +| update.js:2:1:2:3 | a++ | update.js:1:1:5:0 | | +| update.js:3:1:3:3 | --b | update.js:1:1:5:0 | | +| update.js:3:3:3:3 | b | update.js:1:1:5:0 | | +| update.js:4:1:4:1 | b | update.js:1:1:5:0 | | +| update.js:4:1:4:3 | b-- | update.js:1:1:5:0 | | +test_getChild +| assignment.js:1:1:1:6 | a = 23 | 0 | assignment.js:1:1:1:1 | a | +| assignment.js:1:1:1:6 | a = 23 | 1 | assignment.js:1:5:1:6 | 23 | +| assignment.js:2:1:2:7 | a += 19 | 0 | assignment.js:2:1:2:1 | a | +| assignment.js:2:1:2:7 | a += 19 | 1 | assignment.js:2:6:2:7 | 19 | +| assignment.js:3:1:3:6 | a -= 9 | 0 | assignment.js:3:1:3:1 | a | +| assignment.js:3:1:3:6 | a -= 9 | 1 | assignment.js:3:6:3:6 | 9 | +| assignment.js:4:1:4:6 | a *= b | 0 | assignment.js:4:1:4:1 | a | +| assignment.js:4:1:4:6 | a *= b | 1 | assignment.js:4:6:4:6 | b | +| assignment.js:5:1:5:6 | a /= 2 | 0 | assignment.js:5:1:5:1 | a | +| assignment.js:5:1:5:6 | a /= 2 | 1 | assignment.js:5:6:5:6 | 2 | +| assignment.js:6:1:6:6 | a %= 2 | 0 | assignment.js:6:1:6:1 | a | +| assignment.js:6:1:6:6 | a %= 2 | 1 | assignment.js:6:6:6:6 | 2 | +| assignment.js:7:1:7:7 | a <<= 8 | 0 | assignment.js:7:1:7:1 | a | +| assignment.js:7:1:7:7 | a <<= 8 | 1 | assignment.js:7:7:7:7 | 8 | +| assignment.js:8:1:8:7 | a >>= 7 | 0 | assignment.js:8:1:8:1 | a | +| assignment.js:8:1:8:7 | a >>= 7 | 1 | assignment.js:8:7:8:7 | 7 | +| assignment.js:9:1:9:8 | a >>>= 2 | 0 | assignment.js:9:1:9:1 | a | +| assignment.js:9:1:9:8 | a >>>= 2 | 1 | assignment.js:9:8:9:8 | 2 | +| assignment.js:10:1:10:6 | a \|= 2 | 0 | assignment.js:10:1:10:1 | a | +| assignment.js:10:1:10:6 | a \|= 2 | 1 | assignment.js:10:6:10:6 | 2 | +| assignment.js:11:1:11:6 | a ^= 1 | 0 | assignment.js:11:1:11:1 | a | +| assignment.js:11:1:11:6 | a ^= 1 | 1 | assignment.js:11:6:11:6 | 1 | +| assignment.js:12:1:12:6 | a &= 3 | 0 | assignment.js:12:1:12:1 | a | +| assignment.js:12:1:12:6 | a &= 3 | 1 | assignment.js:12:6:12:6 | 3 | +| binary.js:1:1:1:6 | 1 << 2 | 0 | binary.js:1:1:1:1 | 1 | +| binary.js:1:1:1:6 | 1 << 2 | 1 | binary.js:1:6:1:6 | 2 | +| binary.js:2:1:2:6 | 2 >> 1 | 0 | binary.js:2:1:2:1 | 2 | +| binary.js:2:1:2:6 | 2 >> 1 | 1 | binary.js:2:6:2:6 | 1 | +| binary.js:3:1:3:7 | 2 >>> 1 | 0 | binary.js:3:1:3:1 | 2 | +| binary.js:3:1:3:7 | 2 >>> 1 | 1 | binary.js:3:7:3:7 | 1 | +| binary.js:4:1:4:7 | 23 + 19 | 0 | binary.js:4:1:4:2 | 23 | +| binary.js:4:1:4:7 | 23 + 19 | 1 | binary.js:4:6:4:7 | 19 | +| binary.js:5:1:5:7 | 42 - 19 | 0 | binary.js:5:1:5:2 | 42 | +| binary.js:5:1:5:7 | 42 - 19 | 1 | binary.js:5:6:5:7 | 19 | +| binary.js:6:1:6:5 | 2 * 3 | 0 | binary.js:6:1:6:1 | 2 | +| binary.js:6:1:6:5 | 2 * 3 | 1 | binary.js:6:5:6:5 | 3 | +| binary.js:7:1:7:5 | 8 / 5 | 0 | binary.js:7:1:7:1 | 8 | +| binary.js:7:1:7:5 | 8 / 5 | 1 | binary.js:7:5:7:5 | 5 | +| binary.js:8:1:8:5 | 2 % 1 | 0 | binary.js:8:1:8:1 | 2 | +| binary.js:8:1:8:5 | 2 % 1 | 1 | binary.js:8:5:8:5 | 1 | +| binary.js:9:1:9:5 | 2 \| 3 | 0 | binary.js:9:1:9:1 | 2 | +| binary.js:9:1:9:5 | 2 \| 3 | 1 | binary.js:9:5:9:5 | 3 | +| binary.js:10:1:10:5 | 2 ^ 3 | 0 | binary.js:10:1:10:1 | 2 | +| binary.js:10:1:10:5 | 2 ^ 3 | 1 | binary.js:10:5:10:5 | 3 | +| binary.js:11:1:11:5 | 2 & 3 | 0 | binary.js:11:1:11:1 | 2 | +| binary.js:11:1:11:5 | 2 & 3 | 1 | binary.js:11:5:11:5 | 3 | +| binary.js:12:1:12:21 | 'protot ... Object | 0 | binary.js:12:1:12:11 | 'prototype' | +| binary.js:12:1:12:21 | 'protot ... Object | 1 | binary.js:12:16:12:21 | Object | +| binary.js:13:1:13:19 | [] instanceof Array | 0 | binary.js:13:1:13:2 | [] | +| binary.js:13:1:13:19 | [] instanceof Array | 1 | binary.js:13:15:13:19 | Array | +| binary.js:14:1:14:6 | 1 && 2 | 0 | binary.js:14:1:14:1 | 1 | +| binary.js:14:1:14:6 | 1 && 2 | 1 | binary.js:14:6:14:6 | 2 | +| binary.js:15:1:15:6 | 1 \|\| 2 | 0 | binary.js:15:1:15:1 | 1 | +| binary.js:15:1:15:6 | 1 \|\| 2 | 1 | binary.js:15:6:15:6 | 2 | +| comparison.js:1:1:1:6 | 1 == 1 | 0 | comparison.js:1:1:1:1 | 1 | +| comparison.js:1:1:1:6 | 1 == 1 | 1 | comparison.js:1:6:1:6 | 1 | +| comparison.js:2:1:2:6 | 1 != 2 | 0 | comparison.js:2:1:2:1 | 1 | +| comparison.js:2:1:2:6 | 1 != 2 | 1 | comparison.js:2:6:2:6 | 2 | +| comparison.js:3:1:3:7 | 1 === 1 | 0 | comparison.js:3:1:3:1 | 1 | +| comparison.js:3:1:3:7 | 1 === 1 | 1 | comparison.js:3:7:3:7 | 1 | +| comparison.js:4:1:4:7 | 1 !== 2 | 0 | comparison.js:4:1:4:1 | 1 | +| comparison.js:4:1:4:7 | 1 !== 2 | 1 | comparison.js:4:7:4:7 | 2 | +| comparison.js:5:1:5:5 | 1 < 2 | 0 | comparison.js:5:1:5:1 | 1 | +| comparison.js:5:1:5:5 | 1 < 2 | 1 | comparison.js:5:5:5:5 | 2 | +| comparison.js:6:1:6:6 | 1 <= 2 | 0 | comparison.js:6:1:6:1 | 1 | +| comparison.js:6:1:6:6 | 1 <= 2 | 1 | comparison.js:6:6:6:6 | 2 | +| comparison.js:7:1:7:5 | 2 > 1 | 0 | comparison.js:7:1:7:1 | 2 | +| comparison.js:7:1:7:5 | 2 > 1 | 1 | comparison.js:7:5:7:5 | 1 | +| comparison.js:8:1:8:6 | 2 >= 1 | 0 | comparison.js:8:1:8:1 | 2 | +| comparison.js:8:1:8:6 | 2 >= 1 | 1 | comparison.js:8:6:8:6 | 1 | +| es2015.js:1:1:1:18 | ["a", "ab", "abc"] | 0 | es2015.js:1:2:1:4 | "a" | +| es2015.js:1:1:1:18 | ["a", "ab", "abc"] | 1 | es2015.js:1:7:1:10 | "ab" | +| es2015.js:1:1:1:18 | ["a", "ab", "abc"] | 2 | es2015.js:1:13:1:17 | "abc" | +| es2015.js:1:1:1:22 | ["a", " ... c"].map | 0 | es2015.js:1:1:1:18 | ["a", "ab", "abc"] | +| es2015.js:1:1:1:22 | ["a", " ... c"].map | 1 | es2015.js:1:20:1:22 | map | +| es2015.js:1:1:1:37 | ["a", " ... length) | 0 | es2015.js:1:24:1:36 | s => s.length | +| es2015.js:1:1:1:37 | ["a", " ... length) | -1 | es2015.js:1:1:1:22 | ["a", " ... c"].map | +| es2015.js:1:24:1:36 | s => s.length | 0 | es2015.js:1:24:1:24 | s | +| es2015.js:1:24:1:36 | s => s.length | -2 | es2015.js:1:29:1:36 | s.length | +| es2015.js:1:29:1:36 | s.length | 0 | es2015.js:1:29:1:29 | s | +| es2015.js:1:29:1:36 | s.length | 1 | es2015.js:1:31:1:36 | length | +| es2015.js:2:1:2:30 | setInte ... , 1000) | 0 | es2015.js:2:13:2:23 | () => ++cnt | +| es2015.js:2:1:2:30 | setInte ... , 1000) | 1 | es2015.js:2:26:2:29 | 1000 | +| es2015.js:2:1:2:30 | setInte ... , 1000) | -1 | es2015.js:2:1:2:11 | setInterval | +| es2015.js:2:13:2:23 | () => ++cnt | -2 | es2015.js:2:19:2:23 | ++cnt | +| es2015.js:2:19:2:23 | ++cnt | 0 | es2015.js:2:21:2:23 | cnt | +| es2015.js:3:1:3:47 | setTime ... 60000) | 0 | es2015.js:3:12:3:39 | () => { ... p!"); } | +| es2015.js:3:1:3:47 | setTime ... 60000) | 1 | es2015.js:3:42:3:46 | 60000 | +| es2015.js:3:1:3:47 | setTime ... 60000) | -1 | es2015.js:3:1:3:10 | setTimeout | +| es2015.js:3:20:3:36 | alert("Wake up!") | 0 | es2015.js:3:26:3:35 | "Wake up!" | +| es2015.js:3:20:3:36 | alert("Wake up!") | -1 | es2015.js:3:20:3:24 | alert | +| es2015.js:5:1:5:10 | [a, ...as] | 0 | es2015.js:5:2:5:2 | a | +| es2015.js:5:1:5:10 | [a, ...as] | 1 | es2015.js:5:5:5:9 | ...as | +| es2015.js:5:5:5:9 | ...as | 0 | es2015.js:5:8:5:9 | as | +| es2015.js:6:1:6:18 | new Array(...elts) | 0 | es2015.js:6:11:6:17 | ...elts | +| es2015.js:6:1:6:18 | new Array(...elts) | -1 | es2015.js:6:5:6:9 | Array | +| es2015.js:6:11:6:17 | ...elts | 0 | es2015.js:6:14:6:17 | elts | +| es2015.js:8:12:8:17 | [x, y] | 0 | es2015.js:8:13:8:13 | x | +| es2015.js:8:12:8:17 | [x, y] | 1 | es2015.js:8:16:8:16 | y | +| es2015.js:9:6:9:15 | [a, [, c]] | 0 | es2015.js:9:7:9:7 | a | +| es2015.js:9:6:9:15 | [a, [, c]] | 1 | es2015.js:9:10:9:14 | [, c] | +| es2015.js:9:6:9:19 | [a, [, c]] = x | 0 | es2015.js:9:6:9:15 | [a, [, c]] | +| es2015.js:9:6:9:19 | [a, [, c]] = x | 1 | es2015.js:9:19:9:19 | x | +| es2015.js:9:10:9:14 | [, c] | 1 | es2015.js:9:13:9:13 | c | +| es2015.js:11:9:11:14 | [a, c] | 0 | es2015.js:11:10:11:10 | a | +| es2015.js:11:9:11:14 | [a, c] | 1 | es2015.js:11:13:11:13 | c | +| es2015.js:13:3:13:13 | console.log | 0 | es2015.js:13:3:13:9 | console | +| es2015.js:13:3:13:13 | console.log | 1 | es2015.js:13:11:13:13 | log | +| es2015.js:13:3:13:16 | console.log(d) | 0 | es2015.js:13:15:13:15 | d | +| es2015.js:13:3:13:16 | console.log(d) | -1 | es2015.js:13:3:13:13 | console.log | +| es2015.js:18:6:18:19 | { [x]: w } = z | 0 | es2015.js:18:6:18:15 | { [x]: w } | +| es2015.js:18:6:18:19 | { [x]: w } = z | 1 | es2015.js:18:19:18:19 | z | +| es2015.js:23:8:23:10 | n-- | 0 | es2015.js:23:8:23:8 | n | +| es2015.js:23:8:23:12 | n-->0 | 0 | es2015.js:23:8:23:10 | n-- | +| es2015.js:23:8:23:12 | n-->0 | 1 | es2015.js:23:12:23:12 | 0 | +| es2015.js:24:3:24:9 | yield n | 0 | es2015.js:24:9:24:9 | n | +| es2015.js:25:2:25:14 | yield* foo(1) | 0 | es2015.js:25:9:25:14 | foo(1) | +| es2015.js:25:9:25:14 | foo(1) | 0 | es2015.js:25:13:25:13 | 1 | +| es2015.js:25:9:25:14 | foo(1) | -1 | es2015.js:25:9:25:11 | foo | +| es2015.js:28:19:28:22 | x+19 | 0 | es2015.js:28:19:28:19 | x | +| es2015.js:28:19:28:22 | x+19 | 1 | es2015.js:28:21:28:22 | 19 | +| functions.js:4:3:6:4 | (functi ... f;\\n\\t\\t}) | 0 | functions.js:4:4:6:3 | functio ... _f;\\n\\t\\t} | +| functions.js:4:3:8:4 | (functi ... in\\n\\t\\t}) | 0 | functions.js:6:6:8:3 | {\\n\\t\\t\\tx: ... ain\\n\\t\\t} | +| functions.js:4:3:8:4 | (functi ... in\\n\\t\\t}) | -1 | functions.js:4:3:6:4 | (functi ... f;\\n\\t\\t}) | +| legacyletexpr.js:1:1:1:11 | console.log | 0 | legacyletexpr.js:1:1:1:7 | console | +| legacyletexpr.js:1:1:1:11 | console.log | 1 | legacyletexpr.js:1:9:1:11 | log | +| legacyletexpr.js:1:1:1:39 | console ... x + y) | 0 | legacyletexpr.js:1:13:1:38 | let (x ... ) x + y | +| legacyletexpr.js:1:1:1:39 | console ... x + y) | -1 | legacyletexpr.js:1:1:1:11 | console.log | +| legacyletexpr.js:1:13:1:38 | let (x ... ) x + y | 0 | legacyletexpr.js:1:18:1:23 | x = 23 | +| legacyletexpr.js:1:13:1:38 | let (x ... ) x + y | 1 | legacyletexpr.js:1:26:1:31 | y = 19 | +| legacyletexpr.js:1:13:1:38 | let (x ... ) x + y | -1 | legacyletexpr.js:1:34:1:38 | x + y | +| legacyletexpr.js:1:18:1:23 | x = 23 | 0 | legacyletexpr.js:1:18:1:18 | x | +| legacyletexpr.js:1:18:1:23 | x = 23 | 1 | legacyletexpr.js:1:22:1:23 | 23 | +| legacyletexpr.js:1:26:1:31 | y = 19 | 0 | legacyletexpr.js:1:26:1:26 | y | +| legacyletexpr.js:1:26:1:31 | y = 19 | 1 | legacyletexpr.js:1:30:1:31 | 19 | +| legacyletexpr.js:1:34:1:38 | x + y | 0 | legacyletexpr.js:1:34:1:34 | x | +| legacyletexpr.js:1:34:1:38 | x + y | 1 | legacyletexpr.js:1:38:1:38 | y | +| mozextensions.js:1:1:1:9 | array.map | 0 | mozextensions.js:1:1:1:5 | array | +| mozextensions.js:1:1:1:9 | array.map | 1 | mozextensions.js:1:7:1:9 | map | +| mozextensions.js:1:1:1:26 | array.m ... x) x+1) | 0 | mozextensions.js:1:11:1:25 | function(x) x+1 | +| mozextensions.js:1:1:1:26 | array.m ... x) x+1) | -1 | mozextensions.js:1:1:1:9 | array.map | +| mozextensions.js:1:11:1:25 | function(x) x+1 | 0 | mozextensions.js:1:20:1:20 | x | +| mozextensions.js:1:11:1:25 | function(x) x+1 | -2 | mozextensions.js:1:23:1:25 | x+1 | +| mozextensions.js:1:23:1:25 | x+1 | 0 | mozextensions.js:1:23:1:23 | x | +| mozextensions.js:1:23:1:25 | x+1 | 1 | mozextensions.js:1:25:1:25 | 1 | +| others.js:1:1:1:6 | 23, 42 | 0 | others.js:1:1:1:2 | 23 | +| others.js:1:1:1:6 | 23, 42 | 1 | others.js:1:5:1:6 | 42 | +| others.js:2:1:2:10 | 23, 42, 56 | 0 | others.js:2:1:2:2 | 23 | +| others.js:2:1:2:10 | 23, 42, 56 | 1 | others.js:2:5:2:6 | 42 | +| others.js:2:1:2:10 | 23, 42, 56 | 2 | others.js:2:9:2:10 | 56 | +| others.js:3:1:3:12 | true ? 0 : 1 | 0 | others.js:3:1:3:4 | true | +| others.js:3:1:3:12 | true ? 0 : 1 | 1 | others.js:3:8:3:8 | 0 | +| others.js:3:1:3:12 | true ? 0 : 1 | 2 | others.js:3:12:3:12 | 1 | +| others.js:4:10:4:10 | p | 0 | others.js:4:10:4:10 | p | +| primaries.js:15:1:15:4 | (23) | 0 | primaries.js:15:2:15:3 | 23 | +| primaries.js:16:1:16:17 | [23, 42, , "hi" ] | 0 | primaries.js:16:2:16:3 | 23 | +| primaries.js:16:1:16:17 | [23, 42, , "hi" ] | 1 | primaries.js:16:6:16:7 | 42 | +| primaries.js:16:1:16:17 | [23, 42, , "hi" ] | 3 | primaries.js:16:12:16:15 | "hi" | +| primaries.js:17:1:21:16 | ({ x: 2 ... v) {}}) | 0 | primaries.js:17:2:21:15 | { x: 23 ... (v) {}} | +| primaries.js:21:9:21:14 | (v) {} | 0 | primaries.js:21:10:21:10 | v | +| primaries.js:22:1:22:9 | new Array | -1 | primaries.js:22:5:22:9 | Array | +| primaries.js:23:1:23:12 | new Object() | -1 | primaries.js:23:5:23:10 | Object | +| primaries.js:24:1:24:16 | new String("hi") | 0 | primaries.js:24:12:24:15 | "hi" | +| primaries.js:24:1:24:16 | new String("hi") | -1 | primaries.js:24:5:24:10 | String | +| primaries.js:25:1:25:10 | String("") | 0 | primaries.js:25:8:25:9 | "" | +| primaries.js:25:1:25:10 | String("") | -1 | primaries.js:25:1:25:6 | String | +| primaries.js:26:1:26:13 | Object.create | 0 | primaries.js:26:1:26:6 | Object | +| primaries.js:26:1:26:13 | Object.create | 1 | primaries.js:26:8:26:13 | create | +| primaries.js:26:1:26:17 | Object.create({}) | 0 | primaries.js:26:15:26:16 | {} | +| primaries.js:26:1:26:17 | Object.create({}) | -1 | primaries.js:26:1:26:13 | Object.create | +| primaries.js:27:1:27:29 | String[ ... erse()] | 0 | primaries.js:27:1:27:6 | String | +| primaries.js:27:1:27:29 | String[ ... erse()] | 1 | primaries.js:27:8:27:28 | 'epytot ... verse() | +| primaries.js:27:8:27:26 | 'epytotorp'.reverse | 0 | primaries.js:27:8:27:18 | 'epytotorp' | +| primaries.js:27:8:27:26 | 'epytotorp'.reverse | 1 | primaries.js:27:20:27:26 | reverse | +| primaries.js:27:8:27:28 | 'epytot ... verse() | -1 | primaries.js:27:8:27:26 | 'epytotorp'.reverse | +| primaries.js:28:1:28:6 | ((42)) | 0 | primaries.js:28:2:28:5 | (42) | +| primaries.js:28:2:28:5 | (42) | 0 | primaries.js:28:3:28:4 | 42 | +| surrogates.js:1:5:1:16 | a = "\\ud800" | 0 | surrogates.js:1:5:1:5 | a | +| surrogates.js:1:5:1:16 | a = "\\ud800" | 1 | surrogates.js:1:9:1:16 | "\\ud800" | +| surrogates.js:2:1:2:13 | /\\uD800/.test | 0 | surrogates.js:2:1:2:8 | /\\uD800/ | +| surrogates.js:2:1:2:13 | /\\uD800/.test | 1 | surrogates.js:2:10:2:13 | test | +| surrogates.js:2:1:2:16 | /\\uD800/.test(a) | 0 | surrogates.js:2:15:2:15 | a | +| surrogates.js:2:1:2:16 | /\\uD800/.test(a) | -1 | surrogates.js:2:1:2:13 | /\\uD800/.test | +| unary.js:1:1:1:3 | -23 | 0 | unary.js:1:2:1:3 | 23 | +| unary.js:2:1:2:3 | +42 | 0 | unary.js:2:2:2:3 | 42 | +| unary.js:3:1:3:5 | !true | 0 | unary.js:3:2:3:5 | true | +| unary.js:4:1:4:2 | ~2 | 0 | unary.js:4:2:4:2 | 2 | +| unary.js:5:1:5:13 | typeof Object | 0 | unary.js:5:8:5:13 | Object | +| unary.js:6:1:6:7 | void(0) | 0 | unary.js:6:5:6:7 | (0) | +| unary.js:6:5:6:7 | (0) | 0 | unary.js:6:6:6:6 | 0 | +| unary.js:7:1:7:23 | delete ... ototype | 0 | unary.js:7:8:7:23 | Object.prototype | +| unary.js:7:8:7:23 | Object.prototype | 0 | unary.js:7:8:7:13 | Object | +| unary.js:7:8:7:23 | Object.prototype | 1 | unary.js:7:15:7:23 | prototype | +| update.js:1:1:1:3 | ++a | 0 | update.js:1:3:1:3 | a | +| update.js:2:1:2:3 | a++ | 0 | update.js:2:1:2:1 | a | +| update.js:3:1:3:3 | --b | 0 | update.js:3:3:3:3 | b | +| update.js:4:1:4:3 | b-- | 0 | update.js:4:1:4:1 | b | +test_isPure +| assignment.js:1:1:1:1 | a | +| assignment.js:1:5:1:6 | 23 | +| assignment.js:2:1:2:1 | a | +| assignment.js:2:6:2:7 | 19 | +| assignment.js:3:1:3:1 | a | +| assignment.js:3:6:3:6 | 9 | +| assignment.js:4:1:4:1 | a | +| assignment.js:4:6:4:6 | b | +| assignment.js:5:1:5:1 | a | +| assignment.js:5:6:5:6 | 2 | +| assignment.js:6:1:6:1 | a | +| assignment.js:6:6:6:6 | 2 | +| assignment.js:7:1:7:1 | a | +| assignment.js:7:7:7:7 | 8 | +| assignment.js:8:1:8:1 | a | +| assignment.js:8:7:8:7 | 7 | +| assignment.js:9:1:9:1 | a | +| assignment.js:9:8:9:8 | 2 | +| assignment.js:10:1:10:1 | a | +| assignment.js:10:6:10:6 | 2 | +| assignment.js:11:1:11:1 | a | +| assignment.js:11:6:11:6 | 1 | +| assignment.js:12:1:12:1 | a | +| assignment.js:12:6:12:6 | 3 | +| binary.js:1:1:1:1 | 1 | +| binary.js:1:1:1:6 | 1 << 2 | +| binary.js:1:6:1:6 | 2 | +| binary.js:2:1:2:1 | 2 | +| binary.js:2:1:2:6 | 2 >> 1 | +| binary.js:2:6:2:6 | 1 | +| binary.js:3:1:3:1 | 2 | +| binary.js:3:1:3:7 | 2 >>> 1 | +| binary.js:3:7:3:7 | 1 | +| binary.js:4:1:4:2 | 23 | +| binary.js:4:1:4:7 | 23 + 19 | +| binary.js:4:6:4:7 | 19 | +| binary.js:5:1:5:2 | 42 | +| binary.js:5:1:5:7 | 42 - 19 | +| binary.js:5:6:5:7 | 19 | +| binary.js:6:1:6:1 | 2 | +| binary.js:6:1:6:5 | 2 * 3 | +| binary.js:6:5:6:5 | 3 | +| binary.js:7:1:7:1 | 8 | +| binary.js:7:1:7:5 | 8 / 5 | +| binary.js:7:5:7:5 | 5 | +| binary.js:8:1:8:1 | 2 | +| binary.js:8:1:8:5 | 2 % 1 | +| binary.js:8:5:8:5 | 1 | +| binary.js:9:1:9:1 | 2 | +| binary.js:9:1:9:5 | 2 \| 3 | +| binary.js:9:5:9:5 | 3 | +| binary.js:10:1:10:1 | 2 | +| binary.js:10:1:10:5 | 2 ^ 3 | +| binary.js:10:5:10:5 | 3 | +| binary.js:11:1:11:1 | 2 | +| binary.js:11:1:11:5 | 2 & 3 | +| binary.js:11:5:11:5 | 3 | +| binary.js:12:1:12:11 | 'prototype' | +| binary.js:12:1:12:21 | 'protot ... Object | +| binary.js:12:16:12:21 | Object | +| binary.js:13:1:13:2 | [] | +| binary.js:13:1:13:19 | [] instanceof Array | +| binary.js:13:15:13:19 | Array | +| binary.js:14:1:14:1 | 1 | +| binary.js:14:1:14:6 | 1 && 2 | +| binary.js:14:6:14:6 | 2 | +| binary.js:15:1:15:1 | 1 | +| binary.js:15:1:15:6 | 1 \|\| 2 | +| binary.js:15:6:15:6 | 2 | +| comparison.js:1:1:1:1 | 1 | +| comparison.js:1:1:1:6 | 1 == 1 | +| comparison.js:1:6:1:6 | 1 | +| comparison.js:2:1:2:1 | 1 | +| comparison.js:2:1:2:6 | 1 != 2 | +| comparison.js:2:6:2:6 | 2 | +| comparison.js:3:1:3:1 | 1 | +| comparison.js:3:1:3:7 | 1 === 1 | +| comparison.js:3:7:3:7 | 1 | +| comparison.js:4:1:4:1 | 1 | +| comparison.js:4:1:4:7 | 1 !== 2 | +| comparison.js:4:7:4:7 | 2 | +| comparison.js:5:1:5:1 | 1 | +| comparison.js:5:1:5:5 | 1 < 2 | +| comparison.js:5:5:5:5 | 2 | +| comparison.js:6:1:6:1 | 1 | +| comparison.js:6:1:6:6 | 1 <= 2 | +| comparison.js:6:6:6:6 | 2 | +| comparison.js:7:1:7:1 | 2 | +| comparison.js:7:1:7:5 | 2 > 1 | +| comparison.js:7:5:7:5 | 1 | +| comparison.js:8:1:8:1 | 2 | +| comparison.js:8:1:8:6 | 2 >= 1 | +| comparison.js:8:6:8:6 | 1 | +| es2015.js:1:1:1:18 | ["a", "ab", "abc"] | +| es2015.js:1:1:1:22 | ["a", " ... c"].map | +| es2015.js:1:2:1:4 | "a" | +| es2015.js:1:7:1:10 | "ab" | +| es2015.js:1:13:1:17 | "abc" | +| es2015.js:1:20:1:22 | map | +| es2015.js:1:24:1:24 | s | +| es2015.js:1:24:1:36 | s => s.length | +| es2015.js:1:29:1:29 | s | +| es2015.js:1:29:1:36 | s.length | +| es2015.js:1:31:1:36 | length | +| es2015.js:2:1:2:11 | setInterval | +| es2015.js:2:13:2:23 | () => ++cnt | +| es2015.js:2:21:2:23 | cnt | +| es2015.js:2:26:2:29 | 1000 | +| es2015.js:3:1:3:10 | setTimeout | +| es2015.js:3:12:3:39 | () => { ... p!"); } | +| es2015.js:3:20:3:24 | alert | +| es2015.js:3:26:3:35 | "Wake up!" | +| es2015.js:3:42:3:46 | 60000 | +| es2015.js:5:1:5:10 | [a, ...as] | +| es2015.js:5:2:5:2 | a | +| es2015.js:5:5:5:9 | ...as | +| es2015.js:5:8:5:9 | as | +| es2015.js:6:5:6:9 | Array | +| es2015.js:6:11:6:17 | ...elts | +| es2015.js:6:14:6:17 | elts | +| es2015.js:8:10:8:10 | f | +| es2015.js:8:12:8:17 | [x, y] | +| es2015.js:8:13:8:13 | x | +| es2015.js:8:16:8:16 | y | +| es2015.js:9:6:9:15 | [a, [, c]] | +| es2015.js:9:7:9:7 | a | +| es2015.js:9:10:9:14 | [, c] | +| es2015.js:9:13:9:13 | c | +| es2015.js:9:19:9:19 | x | +| es2015.js:11:9:11:14 | [a, c] | +| es2015.js:11:10:11:10 | a | +| es2015.js:11:13:11:13 | c | +| es2015.js:12:11:12:11 | d | +| es2015.js:13:3:13:9 | console | +| es2015.js:13:3:13:13 | console.log | +| es2015.js:13:11:13:13 | log | +| es2015.js:13:15:13:15 | d | +| es2015.js:17:10:17:10 | g | +| es2015.js:17:12:17:22 | { x, y: z } | +| es2015.js:17:14:17:14 | x | +| es2015.js:17:14:17:14 | x | +| es2015.js:17:17:17:17 | y | +| es2015.js:17:20:17:20 | z | +| es2015.js:18:6:18:15 | { [x]: w } | +| es2015.js:18:9:18:9 | x | +| es2015.js:18:13:18:13 | w | +| es2015.js:18:19:18:19 | z | +| es2015.js:19:9:19:9 | w | +| es2015.js:22:11:22:13 | foo | +| es2015.js:22:15:22:15 | n | +| es2015.js:23:8:23:8 | n | +| es2015.js:23:12:23:12 | 0 | +| es2015.js:24:9:24:9 | n | +| es2015.js:25:9:25:11 | foo | +| es2015.js:25:13:25:13 | 1 | +| es2015.js:28:10:28:12 | bar | +| es2015.js:28:14:28:14 | x | +| es2015.js:28:17:28:17 | y | +| es2015.js:28:19:28:19 | x | +| es2015.js:28:19:28:22 | x+19 | +| es2015.js:28:21:28:22 | 19 | +| functions.js:1:10:1:10 | f | +| functions.js:2:2:2:5 | in_f | +| functions.js:3:9:3:17 | also_in_f | +| functions.js:4:3:6:4 | (functi ... f;\\n\\t\\t}) | +| functions.js:4:4:6:3 | functio ... _f;\\n\\t\\t} | +| functions.js:5:4:5:11 | not_in_f | +| functions.js:6:6:8:3 | {\\n\\t\\t\\tx: ... ain\\n\\t\\t} | +| functions.js:7:4:7:4 | x | +| functions.js:7:7:7:16 | in_f_again | +| functions.js:10:1:10:6 | global | +| legacyletexpr.js:1:1:1:7 | console | +| legacyletexpr.js:1:1:1:11 | console.log | +| legacyletexpr.js:1:9:1:11 | log | +| legacyletexpr.js:1:18:1:18 | x | +| legacyletexpr.js:1:22:1:23 | 23 | +| legacyletexpr.js:1:26:1:26 | y | +| legacyletexpr.js:1:30:1:31 | 19 | +| legacyletexpr.js:1:34:1:34 | x | +| legacyletexpr.js:1:34:1:38 | x + y | +| legacyletexpr.js:1:38:1:38 | y | +| mozextensions.js:1:1:1:5 | array | +| mozextensions.js:1:1:1:9 | array.map | +| mozextensions.js:1:7:1:9 | map | +| mozextensions.js:1:11:1:25 | function(x) x+1 | +| mozextensions.js:1:20:1:20 | x | +| mozextensions.js:1:23:1:23 | x | +| mozextensions.js:1:23:1:25 | x+1 | +| mozextensions.js:1:25:1:25 | 1 | +| others.js:1:1:1:2 | 23 | +| others.js:1:1:1:6 | 23, 42 | +| others.js:1:5:1:6 | 42 | +| others.js:2:1:2:2 | 23 | +| others.js:2:1:2:10 | 23, 42, 56 | +| others.js:2:5:2:6 | 42 | +| others.js:2:9:2:10 | 56 | +| others.js:3:1:3:4 | true | +| others.js:3:1:3:12 | true ? 0 : 1 | +| others.js:3:8:3:8 | 0 | +| others.js:3:12:3:12 | 1 | +| others.js:4:10:4:10 | p | +| others.js:4:15:4:15 | o | +| primaries.js:1:1:1:4 | null | +| primaries.js:2:1:2:4 | true | +| primaries.js:3:1:3:5 | false | +| primaries.js:4:1:4:2 | 23 | +| primaries.js:5:1:5:3 | 2.3 | +| primaries.js:6:1:6:3 | .42 | +| primaries.js:7:1:7:6 | 7.6e23 | +| primaries.js:8:1:8:5 | 1E-42 | +| primaries.js:9:1:9:10 | 0xdeadbeef | +| primaries.js:10:1:10:7 | "Hello" | +| primaries.js:11:1:11:7 | 'world' | +| primaries.js:12:1:12:13 | "'what?'\\x0a" | +| primaries.js:13:1:13:10 | '"why?"\\n' | +| primaries.js:14:1:14:15 | /^(need?le)+/gi | +| primaries.js:15:1:15:4 | (23) | +| primaries.js:15:2:15:3 | 23 | +| primaries.js:16:1:16:17 | [23, 42, , "hi" ] | +| primaries.js:16:2:16:3 | 23 | +| primaries.js:16:6:16:7 | 42 | +| primaries.js:16:12:16:15 | "hi" | +| primaries.js:17:1:21:16 | ({ x: 2 ... v) {}}) | +| primaries.js:17:2:21:15 | { x: 23 ... (v) {}} | +| primaries.js:17:4:17:4 | x | +| primaries.js:17:7:17:8 | 23 | +| primaries.js:18:4:18:4 | y | +| primaries.js:18:7:18:10 | this | +| primaries.js:19:8:19:8 | o | +| primaries.js:19:9:19:13 | () {} | +| primaries.js:20:8:20:8 | p | +| primaries.js:20:9:20:13 | () {} | +| primaries.js:21:8:21:8 | p | +| primaries.js:21:9:21:14 | (v) {} | +| primaries.js:21:10:21:10 | v | +| primaries.js:22:5:22:9 | Array | +| primaries.js:23:5:23:10 | Object | +| primaries.js:24:5:24:10 | String | +| primaries.js:24:12:24:15 | "hi" | +| primaries.js:25:1:25:6 | String | +| primaries.js:25:8:25:9 | "" | +| primaries.js:26:1:26:6 | Object | +| primaries.js:26:1:26:13 | Object.create | +| primaries.js:26:8:26:13 | create | +| primaries.js:26:15:26:16 | {} | +| primaries.js:27:1:27:6 | String | +| primaries.js:27:8:27:18 | 'epytotorp' | +| primaries.js:27:8:27:26 | 'epytotorp'.reverse | +| primaries.js:27:20:27:26 | reverse | +| primaries.js:28:1:28:6 | ((42)) | +| primaries.js:28:2:28:5 | (42) | +| primaries.js:28:3:28:4 | 42 | +| primaries.js:29:1:29:13 | /\\2147483648/ | +| primaries.js:30:1:30:26 | /a{2147 ... 83649}/ | +| primaries.js:31:1:31:16 | /a{-2147483648}/ | +| primaries.js:32:1:32:16 | /a{-2147483649}/ | +| surrogates.js:1:5:1:5 | a | +| surrogates.js:1:9:1:16 | "\\ud800" | +| surrogates.js:2:1:2:8 | /\\uD800/ | +| surrogates.js:2:1:2:13 | /\\uD800/.test | +| surrogates.js:2:10:2:13 | test | +| surrogates.js:2:15:2:15 | a | +| surrogates.js:3:1:3:14 | "\\uD834\\uDF06" | +| surrogates.js:4:1:4:14 | '\\udc00\\ud800' | +| unary.js:1:1:1:3 | -23 | +| unary.js:1:2:1:3 | 23 | +| unary.js:2:1:2:3 | +42 | +| unary.js:2:2:2:3 | 42 | +| unary.js:3:1:3:5 | !true | +| unary.js:3:2:3:5 | true | +| unary.js:4:1:4:2 | ~2 | +| unary.js:4:2:4:2 | 2 | +| unary.js:5:1:5:13 | typeof Object | +| unary.js:5:8:5:13 | Object | +| unary.js:6:1:6:7 | void(0) | +| unary.js:6:5:6:7 | (0) | +| unary.js:6:6:6:6 | 0 | +| unary.js:7:8:7:13 | Object | +| unary.js:7:8:7:23 | Object.prototype | +| unary.js:7:15:7:23 | prototype | +| update.js:1:3:1:3 | a | +| update.js:2:1:2:1 | a | +| update.js:3:3:3:3 | b | +| update.js:4:1:4:1 | b | +test_YieldExpr +| es2015.js:24:3:24:9 | yield n | not delegating | +| es2015.js:25:2:25:14 | yield* foo(1) | delegating | +test_RelationalComparisons +| comparison.js:5:1:5:5 | 1 < 2 | comparison.js:5:1:5:1 | 1 | comparison.js:5:5:5:5 | 2 | +| comparison.js:6:1:6:6 | 1 <= 2 | comparison.js:6:1:6:1 | 1 | comparison.js:6:6:6:6 | 2 | +| comparison.js:7:1:7:5 | 2 > 1 | comparison.js:7:5:7:5 | 1 | comparison.js:7:1:7:1 | 2 | +| comparison.js:8:1:8:6 | 2 >= 1 | comparison.js:8:6:8:6 | 1 | comparison.js:8:1:8:1 | 2 | +| es2015.js:23:8:23:12 | n-->0 | es2015.js:23:12:23:12 | 0 | es2015.js:23:8:23:10 | n-- | +test_getEnclosingFunction +| es2015.js:1:24:1:24 | s | es2015.js:1:24:1:36 | s => s.length | +| es2015.js:1:29:1:29 | s | es2015.js:1:24:1:36 | s => s.length | +| es2015.js:1:29:1:36 | s.length | es2015.js:1:24:1:36 | s => s.length | +| es2015.js:1:31:1:36 | length | es2015.js:1:24:1:36 | s => s.length | +| es2015.js:2:19:2:23 | ++cnt | es2015.js:2:13:2:23 | () => ++cnt | +| es2015.js:2:21:2:23 | cnt | es2015.js:2:13:2:23 | () => ++cnt | +| es2015.js:3:20:3:24 | alert | es2015.js:3:12:3:39 | () => { ... p!"); } | +| es2015.js:3:20:3:36 | alert("Wake up!") | es2015.js:3:12:3:39 | () => { ... p!"); } | +| es2015.js:3:26:3:35 | "Wake up!" | es2015.js:3:12:3:39 | () => { ... p!"); } | +| es2015.js:8:10:8:10 | f | es2015.js:8:1:15:1 | functio ... );\\n\\t}\\n} | +| es2015.js:8:12:8:17 | [x, y] | es2015.js:8:1:15:1 | functio ... );\\n\\t}\\n} | +| es2015.js:8:13:8:13 | x | es2015.js:8:1:15:1 | functio ... );\\n\\t}\\n} | +| es2015.js:8:16:8:16 | y | es2015.js:8:1:15:1 | functio ... );\\n\\t}\\n} | +| es2015.js:9:6:9:15 | [a, [, c]] | es2015.js:8:1:15:1 | functio ... );\\n\\t}\\n} | +| es2015.js:9:6:9:19 | [a, [, c]] = x | es2015.js:8:1:15:1 | functio ... );\\n\\t}\\n} | +| es2015.js:9:7:9:7 | a | es2015.js:8:1:15:1 | functio ... );\\n\\t}\\n} | +| es2015.js:9:10:9:14 | [, c] | es2015.js:8:1:15:1 | functio ... );\\n\\t}\\n} | +| es2015.js:9:13:9:13 | c | es2015.js:8:1:15:1 | functio ... );\\n\\t}\\n} | +| es2015.js:9:19:9:19 | x | es2015.js:8:1:15:1 | functio ... );\\n\\t}\\n} | +| es2015.js:11:9:11:14 | [a, c] | es2015.js:8:1:15:1 | functio ... );\\n\\t}\\n} | +| es2015.js:11:10:11:10 | a | es2015.js:8:1:15:1 | functio ... );\\n\\t}\\n} | +| es2015.js:11:13:11:13 | c | es2015.js:8:1:15:1 | functio ... );\\n\\t}\\n} | +| es2015.js:12:11:12:11 | d | es2015.js:8:1:15:1 | functio ... );\\n\\t}\\n} | +| es2015.js:13:3:13:9 | console | es2015.js:8:1:15:1 | functio ... );\\n\\t}\\n} | +| es2015.js:13:3:13:13 | console.log | es2015.js:8:1:15:1 | functio ... );\\n\\t}\\n} | +| es2015.js:13:3:13:16 | console.log(d) | es2015.js:8:1:15:1 | functio ... );\\n\\t}\\n} | +| es2015.js:13:11:13:13 | log | es2015.js:8:1:15:1 | functio ... );\\n\\t}\\n} | +| es2015.js:13:15:13:15 | d | es2015.js:8:1:15:1 | functio ... );\\n\\t}\\n} | +| es2015.js:17:10:17:10 | g | es2015.js:17:1:20:1 | functio ... rn w;\\n} | +| es2015.js:17:12:17:22 | { x, y: z } | es2015.js:17:1:20:1 | functio ... rn w;\\n} | +| es2015.js:17:14:17:14 | x | es2015.js:17:1:20:1 | functio ... rn w;\\n} | +| es2015.js:17:14:17:14 | x | es2015.js:17:1:20:1 | functio ... rn w;\\n} | +| es2015.js:17:17:17:17 | y | es2015.js:17:1:20:1 | functio ... rn w;\\n} | +| es2015.js:17:20:17:20 | z | es2015.js:17:1:20:1 | functio ... rn w;\\n} | +| es2015.js:18:6:18:15 | { [x]: w } | es2015.js:17:1:20:1 | functio ... rn w;\\n} | +| es2015.js:18:6:18:19 | { [x]: w } = z | es2015.js:17:1:20:1 | functio ... rn w;\\n} | +| es2015.js:18:9:18:9 | x | es2015.js:17:1:20:1 | functio ... rn w;\\n} | +| es2015.js:18:13:18:13 | w | es2015.js:17:1:20:1 | functio ... rn w;\\n} | +| es2015.js:18:19:18:19 | z | es2015.js:17:1:20:1 | functio ... rn w;\\n} | +| es2015.js:19:9:19:9 | w | es2015.js:17:1:20:1 | functio ... rn w;\\n} | +| es2015.js:22:11:22:13 | foo | es2015.js:22:1:26:1 | functio ... o(1);\\n} | +| es2015.js:22:15:22:15 | n | es2015.js:22:1:26:1 | functio ... o(1);\\n} | +| es2015.js:23:8:23:8 | n | es2015.js:22:1:26:1 | functio ... o(1);\\n} | +| es2015.js:23:8:23:10 | n-- | es2015.js:22:1:26:1 | functio ... o(1);\\n} | +| es2015.js:23:8:23:12 | n-->0 | es2015.js:22:1:26:1 | functio ... o(1);\\n} | +| es2015.js:23:12:23:12 | 0 | es2015.js:22:1:26:1 | functio ... o(1);\\n} | +| es2015.js:24:3:24:9 | yield n | es2015.js:22:1:26:1 | functio ... o(1);\\n} | +| es2015.js:24:9:24:9 | n | es2015.js:22:1:26:1 | functio ... o(1);\\n} | +| es2015.js:25:2:25:14 | yield* foo(1) | es2015.js:22:1:26:1 | functio ... o(1);\\n} | +| es2015.js:25:9:25:11 | foo | es2015.js:22:1:26:1 | functio ... o(1);\\n} | +| es2015.js:25:9:25:14 | foo(1) | es2015.js:22:1:26:1 | functio ... o(1);\\n} | +| es2015.js:25:13:25:13 | 1 | es2015.js:22:1:26:1 | functio ... o(1);\\n} | +| es2015.js:28:10:28:12 | bar | es2015.js:28:1:28:26 | functio ... +19) {} | +| es2015.js:28:14:28:14 | x | es2015.js:28:1:28:26 | functio ... +19) {} | +| es2015.js:28:17:28:17 | y | es2015.js:28:1:28:26 | functio ... +19) {} | +| es2015.js:28:19:28:19 | x | es2015.js:28:1:28:26 | functio ... +19) {} | +| es2015.js:28:19:28:22 | x+19 | es2015.js:28:1:28:26 | functio ... +19) {} | +| es2015.js:28:21:28:22 | 19 | es2015.js:28:1:28:26 | functio ... +19) {} | +| functions.js:1:10:1:10 | f | functions.js:1:1:9:1 | functio ... \\t\\t});\\n} | +| functions.js:2:2:2:5 | in_f | functions.js:1:1:9:1 | functio ... \\t\\t});\\n} | +| functions.js:3:9:3:17 | also_in_f | functions.js:1:1:9:1 | functio ... \\t\\t});\\n} | +| functions.js:4:3:6:4 | (functi ... f;\\n\\t\\t}) | functions.js:1:1:9:1 | functio ... \\t\\t});\\n} | +| functions.js:4:3:8:4 | (functi ... in\\n\\t\\t}) | functions.js:1:1:9:1 | functio ... \\t\\t});\\n} | +| functions.js:4:4:6:3 | functio ... _f;\\n\\t\\t} | functions.js:1:1:9:1 | functio ... \\t\\t});\\n} | +| functions.js:5:4:5:11 | not_in_f | functions.js:4:4:6:3 | functio ... _f;\\n\\t\\t} | +| functions.js:6:6:8:3 | {\\n\\t\\t\\tx: ... ain\\n\\t\\t} | functions.js:1:1:9:1 | functio ... \\t\\t});\\n} | +| functions.js:7:4:7:4 | x | functions.js:1:1:9:1 | functio ... \\t\\t});\\n} | +| functions.js:7:7:7:16 | in_f_again | functions.js:1:1:9:1 | functio ... \\t\\t});\\n} | +| mozextensions.js:1:20:1:20 | x | mozextensions.js:1:11:1:25 | function(x) x+1 | +| mozextensions.js:1:23:1:23 | x | mozextensions.js:1:11:1:25 | function(x) x+1 | +| mozextensions.js:1:23:1:25 | x+1 | mozextensions.js:1:11:1:25 | function(x) x+1 | +| mozextensions.js:1:25:1:25 | 1 | mozextensions.js:1:11:1:25 | function(x) x+1 | +| primaries.js:21:10:21:10 | v | primaries.js:21:9:21:14 | (v) {} | +test_LetExpr +| legacyletexpr.js:1:13:1:38 | let (x ... ) x + y | 0 | legacyletexpr.js:1:18:1:23 | x = 23 | legacyletexpr.js:1:34:1:38 | x + y | +| legacyletexpr.js:1:13:1:38 | let (x ... ) x + y | 1 | legacyletexpr.js:1:26:1:31 | y = 19 | legacyletexpr.js:1:34:1:38 | x + y | +test_stripParens +| functions.js:4:3:6:4 | (functi ... f;\\n\\t\\t}) | functions.js:4:4:6:3 | functio ... _f;\\n\\t\\t} | +| primaries.js:15:1:15:4 | (23) | primaries.js:15:2:15:3 | 23 | +| primaries.js:17:1:21:16 | ({ x: 2 ... v) {}}) | primaries.js:17:2:21:15 | { x: 23 ... (v) {}} | +| primaries.js:28:1:28:6 | ((42)) | primaries.js:28:3:28:4 | 42 | +| primaries.js:28:2:28:5 | (42) | primaries.js:28:3:28:4 | 42 | +| unary.js:6:5:6:7 | (0) | unary.js:6:6:6:6 | 0 | +test_getContainer +| assignment.js:1:1:1:1 | a | assignment.js:1:1:12:7 | | +| assignment.js:1:1:1:6 | a = 23 | assignment.js:1:1:12:7 | | +| assignment.js:1:5:1:6 | 23 | assignment.js:1:1:12:7 | | +| assignment.js:2:1:2:1 | a | assignment.js:1:1:12:7 | | +| assignment.js:2:1:2:7 | a += 19 | assignment.js:1:1:12:7 | | +| assignment.js:2:6:2:7 | 19 | assignment.js:1:1:12:7 | | +| assignment.js:3:1:3:1 | a | assignment.js:1:1:12:7 | | +| assignment.js:3:1:3:6 | a -= 9 | assignment.js:1:1:12:7 | | +| assignment.js:3:6:3:6 | 9 | assignment.js:1:1:12:7 | | +| assignment.js:4:1:4:1 | a | assignment.js:1:1:12:7 | | +| assignment.js:4:1:4:6 | a *= b | assignment.js:1:1:12:7 | | +| assignment.js:4:6:4:6 | b | assignment.js:1:1:12:7 | | +| assignment.js:5:1:5:1 | a | assignment.js:1:1:12:7 | | +| assignment.js:5:1:5:6 | a /= 2 | assignment.js:1:1:12:7 | | +| assignment.js:5:6:5:6 | 2 | assignment.js:1:1:12:7 | | +| assignment.js:6:1:6:1 | a | assignment.js:1:1:12:7 | | +| assignment.js:6:1:6:6 | a %= 2 | assignment.js:1:1:12:7 | | +| assignment.js:6:6:6:6 | 2 | assignment.js:1:1:12:7 | | +| assignment.js:7:1:7:1 | a | assignment.js:1:1:12:7 | | +| assignment.js:7:1:7:7 | a <<= 8 | assignment.js:1:1:12:7 | | +| assignment.js:7:7:7:7 | 8 | assignment.js:1:1:12:7 | | +| assignment.js:8:1:8:1 | a | assignment.js:1:1:12:7 | | +| assignment.js:8:1:8:7 | a >>= 7 | assignment.js:1:1:12:7 | | +| assignment.js:8:7:8:7 | 7 | assignment.js:1:1:12:7 | | +| assignment.js:9:1:9:1 | a | assignment.js:1:1:12:7 | | +| assignment.js:9:1:9:8 | a >>>= 2 | assignment.js:1:1:12:7 | | +| assignment.js:9:8:9:8 | 2 | assignment.js:1:1:12:7 | | +| assignment.js:10:1:10:1 | a | assignment.js:1:1:12:7 | | +| assignment.js:10:1:10:6 | a \|= 2 | assignment.js:1:1:12:7 | | +| assignment.js:10:6:10:6 | 2 | assignment.js:1:1:12:7 | | +| assignment.js:11:1:11:1 | a | assignment.js:1:1:12:7 | | +| assignment.js:11:1:11:6 | a ^= 1 | assignment.js:1:1:12:7 | | +| assignment.js:11:6:11:6 | 1 | assignment.js:1:1:12:7 | | +| assignment.js:12:1:12:1 | a | assignment.js:1:1:12:7 | | +| assignment.js:12:1:12:6 | a &= 3 | assignment.js:1:1:12:7 | | +| assignment.js:12:6:12:6 | 3 | assignment.js:1:1:12:7 | | +| binary.js:1:1:1:1 | 1 | binary.js:1:1:16:0 | | +| binary.js:1:1:1:6 | 1 << 2 | binary.js:1:1:16:0 | | +| binary.js:1:6:1:6 | 2 | binary.js:1:1:16:0 | | +| binary.js:2:1:2:1 | 2 | binary.js:1:1:16:0 | | +| binary.js:2:1:2:6 | 2 >> 1 | binary.js:1:1:16:0 | | +| binary.js:2:6:2:6 | 1 | binary.js:1:1:16:0 | | +| binary.js:3:1:3:1 | 2 | binary.js:1:1:16:0 | | +| binary.js:3:1:3:7 | 2 >>> 1 | binary.js:1:1:16:0 | | +| binary.js:3:7:3:7 | 1 | binary.js:1:1:16:0 | | +| binary.js:4:1:4:2 | 23 | binary.js:1:1:16:0 | | +| binary.js:4:1:4:7 | 23 + 19 | binary.js:1:1:16:0 | | +| binary.js:4:6:4:7 | 19 | binary.js:1:1:16:0 | | +| binary.js:5:1:5:2 | 42 | binary.js:1:1:16:0 | | +| binary.js:5:1:5:7 | 42 - 19 | binary.js:1:1:16:0 | | +| binary.js:5:6:5:7 | 19 | binary.js:1:1:16:0 | | +| binary.js:6:1:6:1 | 2 | binary.js:1:1:16:0 | | +| binary.js:6:1:6:5 | 2 * 3 | binary.js:1:1:16:0 | | +| binary.js:6:5:6:5 | 3 | binary.js:1:1:16:0 | | +| binary.js:7:1:7:1 | 8 | binary.js:1:1:16:0 | | +| binary.js:7:1:7:5 | 8 / 5 | binary.js:1:1:16:0 | | +| binary.js:7:5:7:5 | 5 | binary.js:1:1:16:0 | | +| binary.js:8:1:8:1 | 2 | binary.js:1:1:16:0 | | +| binary.js:8:1:8:5 | 2 % 1 | binary.js:1:1:16:0 | | +| binary.js:8:5:8:5 | 1 | binary.js:1:1:16:0 | | +| binary.js:9:1:9:1 | 2 | binary.js:1:1:16:0 | | +| binary.js:9:1:9:5 | 2 \| 3 | binary.js:1:1:16:0 | | +| binary.js:9:5:9:5 | 3 | binary.js:1:1:16:0 | | +| binary.js:10:1:10:1 | 2 | binary.js:1:1:16:0 | | +| binary.js:10:1:10:5 | 2 ^ 3 | binary.js:1:1:16:0 | | +| binary.js:10:5:10:5 | 3 | binary.js:1:1:16:0 | | +| binary.js:11:1:11:1 | 2 | binary.js:1:1:16:0 | | +| binary.js:11:1:11:5 | 2 & 3 | binary.js:1:1:16:0 | | +| binary.js:11:5:11:5 | 3 | binary.js:1:1:16:0 | | +| binary.js:12:1:12:11 | 'prototype' | binary.js:1:1:16:0 | | +| binary.js:12:1:12:21 | 'protot ... Object | binary.js:1:1:16:0 | | +| binary.js:12:16:12:21 | Object | binary.js:1:1:16:0 | | +| binary.js:13:1:13:2 | [] | binary.js:1:1:16:0 | | +| binary.js:13:1:13:19 | [] instanceof Array | binary.js:1:1:16:0 | | +| binary.js:13:15:13:19 | Array | binary.js:1:1:16:0 | | +| binary.js:14:1:14:1 | 1 | binary.js:1:1:16:0 | | +| binary.js:14:1:14:6 | 1 && 2 | binary.js:1:1:16:0 | | +| binary.js:14:6:14:6 | 2 | binary.js:1:1:16:0 | | +| binary.js:15:1:15:1 | 1 | binary.js:1:1:16:0 | | +| binary.js:15:1:15:6 | 1 \|\| 2 | binary.js:1:1:16:0 | | +| binary.js:15:6:15:6 | 2 | binary.js:1:1:16:0 | | +| comparison.js:1:1:1:1 | 1 | comparison.js:1:1:9:0 | | +| comparison.js:1:1:1:6 | 1 == 1 | comparison.js:1:1:9:0 | | +| comparison.js:1:6:1:6 | 1 | comparison.js:1:1:9:0 | | +| comparison.js:2:1:2:1 | 1 | comparison.js:1:1:9:0 | | +| comparison.js:2:1:2:6 | 1 != 2 | comparison.js:1:1:9:0 | | +| comparison.js:2:6:2:6 | 2 | comparison.js:1:1:9:0 | | +| comparison.js:3:1:3:1 | 1 | comparison.js:1:1:9:0 | | +| comparison.js:3:1:3:7 | 1 === 1 | comparison.js:1:1:9:0 | | +| comparison.js:3:7:3:7 | 1 | comparison.js:1:1:9:0 | | +| comparison.js:4:1:4:1 | 1 | comparison.js:1:1:9:0 | | +| comparison.js:4:1:4:7 | 1 !== 2 | comparison.js:1:1:9:0 | | +| comparison.js:4:7:4:7 | 2 | comparison.js:1:1:9:0 | | +| comparison.js:5:1:5:1 | 1 | comparison.js:1:1:9:0 | | +| comparison.js:5:1:5:5 | 1 < 2 | comparison.js:1:1:9:0 | | +| comparison.js:5:5:5:5 | 2 | comparison.js:1:1:9:0 | | +| comparison.js:6:1:6:1 | 1 | comparison.js:1:1:9:0 | | +| comparison.js:6:1:6:6 | 1 <= 2 | comparison.js:1:1:9:0 | | +| comparison.js:6:6:6:6 | 2 | comparison.js:1:1:9:0 | | +| comparison.js:7:1:7:1 | 2 | comparison.js:1:1:9:0 | | +| comparison.js:7:1:7:5 | 2 > 1 | comparison.js:1:1:9:0 | | +| comparison.js:7:5:7:5 | 1 | comparison.js:1:1:9:0 | | +| comparison.js:8:1:8:1 | 2 | comparison.js:1:1:9:0 | | +| comparison.js:8:1:8:6 | 2 >= 1 | comparison.js:1:1:9:0 | | +| comparison.js:8:6:8:6 | 1 | comparison.js:1:1:9:0 | | +| es2015.js:1:1:1:18 | ["a", "ab", "abc"] | es2015.js:1:1:29:0 | | +| es2015.js:1:1:1:22 | ["a", " ... c"].map | es2015.js:1:1:29:0 | | +| es2015.js:1:1:1:37 | ["a", " ... length) | es2015.js:1:1:29:0 | | +| es2015.js:1:2:1:4 | "a" | es2015.js:1:1:29:0 | | +| es2015.js:1:7:1:10 | "ab" | es2015.js:1:1:29:0 | | +| es2015.js:1:13:1:17 | "abc" | es2015.js:1:1:29:0 | | +| es2015.js:1:20:1:22 | map | es2015.js:1:1:29:0 | | +| es2015.js:1:24:1:24 | s | es2015.js:1:24:1:36 | s => s.length | +| es2015.js:1:24:1:36 | s => s.length | es2015.js:1:1:29:0 | | +| es2015.js:1:29:1:29 | s | es2015.js:1:24:1:36 | s => s.length | +| es2015.js:1:29:1:36 | s.length | es2015.js:1:24:1:36 | s => s.length | +| es2015.js:1:31:1:36 | length | es2015.js:1:24:1:36 | s => s.length | +| es2015.js:2:1:2:11 | setInterval | es2015.js:1:1:29:0 | | +| es2015.js:2:1:2:30 | setInte ... , 1000) | es2015.js:1:1:29:0 | | +| es2015.js:2:13:2:23 | () => ++cnt | es2015.js:1:1:29:0 | | +| es2015.js:2:19:2:23 | ++cnt | es2015.js:2:13:2:23 | () => ++cnt | +| es2015.js:2:21:2:23 | cnt | es2015.js:2:13:2:23 | () => ++cnt | +| es2015.js:2:26:2:29 | 1000 | es2015.js:1:1:29:0 | | +| es2015.js:3:1:3:10 | setTimeout | es2015.js:1:1:29:0 | | +| es2015.js:3:1:3:47 | setTime ... 60000) | es2015.js:1:1:29:0 | | +| es2015.js:3:12:3:39 | () => { ... p!"); } | es2015.js:1:1:29:0 | | +| es2015.js:3:20:3:24 | alert | es2015.js:3:12:3:39 | () => { ... p!"); } | +| es2015.js:3:20:3:36 | alert("Wake up!") | es2015.js:3:12:3:39 | () => { ... p!"); } | +| es2015.js:3:26:3:35 | "Wake up!" | es2015.js:3:12:3:39 | () => { ... p!"); } | +| es2015.js:3:42:3:46 | 60000 | es2015.js:1:1:29:0 | | +| es2015.js:5:1:5:10 | [a, ...as] | es2015.js:1:1:29:0 | | +| es2015.js:5:2:5:2 | a | es2015.js:1:1:29:0 | | +| es2015.js:5:5:5:9 | ...as | es2015.js:1:1:29:0 | | +| es2015.js:5:8:5:9 | as | es2015.js:1:1:29:0 | | +| es2015.js:6:1:6:18 | new Array(...elts) | es2015.js:1:1:29:0 | | +| es2015.js:6:5:6:9 | Array | es2015.js:1:1:29:0 | | +| es2015.js:6:11:6:17 | ...elts | es2015.js:1:1:29:0 | | +| es2015.js:6:14:6:17 | elts | es2015.js:1:1:29:0 | | +| es2015.js:8:10:8:10 | f | es2015.js:8:1:15:1 | functio ... );\\n\\t}\\n} | +| es2015.js:8:12:8:17 | [x, y] | es2015.js:8:1:15:1 | functio ... );\\n\\t}\\n} | +| es2015.js:8:13:8:13 | x | es2015.js:8:1:15:1 | functio ... );\\n\\t}\\n} | +| es2015.js:8:16:8:16 | y | es2015.js:8:1:15:1 | functio ... );\\n\\t}\\n} | +| es2015.js:9:6:9:15 | [a, [, c]] | es2015.js:8:1:15:1 | functio ... );\\n\\t}\\n} | +| es2015.js:9:6:9:19 | [a, [, c]] = x | es2015.js:8:1:15:1 | functio ... );\\n\\t}\\n} | +| es2015.js:9:7:9:7 | a | es2015.js:8:1:15:1 | functio ... );\\n\\t}\\n} | +| es2015.js:9:10:9:14 | [, c] | es2015.js:8:1:15:1 | functio ... );\\n\\t}\\n} | +| es2015.js:9:13:9:13 | c | es2015.js:8:1:15:1 | functio ... );\\n\\t}\\n} | +| es2015.js:9:19:9:19 | x | es2015.js:8:1:15:1 | functio ... );\\n\\t}\\n} | +| es2015.js:11:9:11:14 | [a, c] | es2015.js:8:1:15:1 | functio ... );\\n\\t}\\n} | +| es2015.js:11:10:11:10 | a | es2015.js:8:1:15:1 | functio ... );\\n\\t}\\n} | +| es2015.js:11:13:11:13 | c | es2015.js:8:1:15:1 | functio ... );\\n\\t}\\n} | +| es2015.js:12:11:12:11 | d | es2015.js:8:1:15:1 | functio ... );\\n\\t}\\n} | +| es2015.js:13:3:13:9 | console | es2015.js:8:1:15:1 | functio ... );\\n\\t}\\n} | +| es2015.js:13:3:13:13 | console.log | es2015.js:8:1:15:1 | functio ... );\\n\\t}\\n} | +| es2015.js:13:3:13:16 | console.log(d) | es2015.js:8:1:15:1 | functio ... );\\n\\t}\\n} | +| es2015.js:13:11:13:13 | log | es2015.js:8:1:15:1 | functio ... );\\n\\t}\\n} | +| es2015.js:13:15:13:15 | d | es2015.js:8:1:15:1 | functio ... );\\n\\t}\\n} | +| es2015.js:17:10:17:10 | g | es2015.js:17:1:20:1 | functio ... rn w;\\n} | +| es2015.js:17:12:17:22 | { x, y: z } | es2015.js:17:1:20:1 | functio ... rn w;\\n} | +| es2015.js:17:14:17:14 | x | es2015.js:17:1:20:1 | functio ... rn w;\\n} | +| es2015.js:17:14:17:14 | x | es2015.js:17:1:20:1 | functio ... rn w;\\n} | +| es2015.js:17:17:17:17 | y | es2015.js:17:1:20:1 | functio ... rn w;\\n} | +| es2015.js:17:20:17:20 | z | es2015.js:17:1:20:1 | functio ... rn w;\\n} | +| es2015.js:18:6:18:15 | { [x]: w } | es2015.js:17:1:20:1 | functio ... rn w;\\n} | +| es2015.js:18:6:18:19 | { [x]: w } = z | es2015.js:17:1:20:1 | functio ... rn w;\\n} | +| es2015.js:18:9:18:9 | x | es2015.js:17:1:20:1 | functio ... rn w;\\n} | +| es2015.js:18:13:18:13 | w | es2015.js:17:1:20:1 | functio ... rn w;\\n} | +| es2015.js:18:19:18:19 | z | es2015.js:17:1:20:1 | functio ... rn w;\\n} | +| es2015.js:19:9:19:9 | w | es2015.js:17:1:20:1 | functio ... rn w;\\n} | +| es2015.js:22:11:22:13 | foo | es2015.js:22:1:26:1 | functio ... o(1);\\n} | +| es2015.js:22:15:22:15 | n | es2015.js:22:1:26:1 | functio ... o(1);\\n} | +| es2015.js:23:8:23:8 | n | es2015.js:22:1:26:1 | functio ... o(1);\\n} | +| es2015.js:23:8:23:10 | n-- | es2015.js:22:1:26:1 | functio ... o(1);\\n} | +| es2015.js:23:8:23:12 | n-->0 | es2015.js:22:1:26:1 | functio ... o(1);\\n} | +| es2015.js:23:12:23:12 | 0 | es2015.js:22:1:26:1 | functio ... o(1);\\n} | +| es2015.js:24:3:24:9 | yield n | es2015.js:22:1:26:1 | functio ... o(1);\\n} | +| es2015.js:24:9:24:9 | n | es2015.js:22:1:26:1 | functio ... o(1);\\n} | +| es2015.js:25:2:25:14 | yield* foo(1) | es2015.js:22:1:26:1 | functio ... o(1);\\n} | +| es2015.js:25:9:25:11 | foo | es2015.js:22:1:26:1 | functio ... o(1);\\n} | +| es2015.js:25:9:25:14 | foo(1) | es2015.js:22:1:26:1 | functio ... o(1);\\n} | +| es2015.js:25:13:25:13 | 1 | es2015.js:22:1:26:1 | functio ... o(1);\\n} | +| es2015.js:28:10:28:12 | bar | es2015.js:28:1:28:26 | functio ... +19) {} | +| es2015.js:28:14:28:14 | x | es2015.js:28:1:28:26 | functio ... +19) {} | +| es2015.js:28:17:28:17 | y | es2015.js:28:1:28:26 | functio ... +19) {} | +| es2015.js:28:19:28:19 | x | es2015.js:28:1:28:26 | functio ... +19) {} | +| es2015.js:28:19:28:22 | x+19 | es2015.js:28:1:28:26 | functio ... +19) {} | +| es2015.js:28:21:28:22 | 19 | es2015.js:28:1:28:26 | functio ... +19) {} | +| functions.js:1:10:1:10 | f | functions.js:1:1:9:1 | functio ... \\t\\t});\\n} | +| functions.js:2:2:2:5 | in_f | functions.js:1:1:9:1 | functio ... \\t\\t});\\n} | +| functions.js:3:9:3:17 | also_in_f | functions.js:1:1:9:1 | functio ... \\t\\t});\\n} | +| functions.js:4:3:6:4 | (functi ... f;\\n\\t\\t}) | functions.js:1:1:9:1 | functio ... \\t\\t});\\n} | +| functions.js:4:3:8:4 | (functi ... in\\n\\t\\t}) | functions.js:1:1:9:1 | functio ... \\t\\t});\\n} | +| functions.js:4:4:6:3 | functio ... _f;\\n\\t\\t} | functions.js:1:1:9:1 | functio ... \\t\\t});\\n} | +| functions.js:5:4:5:11 | not_in_f | functions.js:4:4:6:3 | functio ... _f;\\n\\t\\t} | +| functions.js:6:6:8:3 | {\\n\\t\\t\\tx: ... ain\\n\\t\\t} | functions.js:1:1:9:1 | functio ... \\t\\t});\\n} | +| functions.js:7:4:7:4 | x | functions.js:1:1:9:1 | functio ... \\t\\t});\\n} | +| functions.js:7:7:7:16 | in_f_again | functions.js:1:1:9:1 | functio ... \\t\\t});\\n} | +| functions.js:10:1:10:6 | global | functions.js:1:1:10:7 | | +| legacyletexpr.js:1:1:1:7 | console | legacyletexpr.js:1:1:3:42 | | +| legacyletexpr.js:1:1:1:11 | console.log | legacyletexpr.js:1:1:3:42 | | +| legacyletexpr.js:1:1:1:39 | console ... x + y) | legacyletexpr.js:1:1:3:42 | | +| legacyletexpr.js:1:9:1:11 | log | legacyletexpr.js:1:1:3:42 | | +| legacyletexpr.js:1:13:1:38 | let (x ... ) x + y | legacyletexpr.js:1:1:3:42 | | +| legacyletexpr.js:1:18:1:18 | x | legacyletexpr.js:1:1:3:42 | | +| legacyletexpr.js:1:18:1:23 | x = 23 | legacyletexpr.js:1:1:3:42 | | +| legacyletexpr.js:1:22:1:23 | 23 | legacyletexpr.js:1:1:3:42 | | +| legacyletexpr.js:1:26:1:26 | y | legacyletexpr.js:1:1:3:42 | | +| legacyletexpr.js:1:26:1:31 | y = 19 | legacyletexpr.js:1:1:3:42 | | +| legacyletexpr.js:1:30:1:31 | 19 | legacyletexpr.js:1:1:3:42 | | +| legacyletexpr.js:1:34:1:34 | x | legacyletexpr.js:1:1:3:42 | | +| legacyletexpr.js:1:34:1:38 | x + y | legacyletexpr.js:1:1:3:42 | | +| legacyletexpr.js:1:38:1:38 | y | legacyletexpr.js:1:1:3:42 | | +| mozextensions.js:1:1:1:5 | array | mozextensions.js:1:1:3:42 | | +| mozextensions.js:1:1:1:9 | array.map | mozextensions.js:1:1:3:42 | | +| mozextensions.js:1:1:1:26 | array.m ... x) x+1) | mozextensions.js:1:1:3:42 | | +| mozextensions.js:1:7:1:9 | map | mozextensions.js:1:1:3:42 | | +| mozextensions.js:1:11:1:25 | function(x) x+1 | mozextensions.js:1:1:3:42 | | +| mozextensions.js:1:20:1:20 | x | mozextensions.js:1:11:1:25 | function(x) x+1 | +| mozextensions.js:1:23:1:23 | x | mozextensions.js:1:11:1:25 | function(x) x+1 | +| mozextensions.js:1:23:1:25 | x+1 | mozextensions.js:1:11:1:25 | function(x) x+1 | +| mozextensions.js:1:25:1:25 | 1 | mozextensions.js:1:11:1:25 | function(x) x+1 | +| others.js:1:1:1:2 | 23 | others.js:1:1:5:2 | | +| others.js:1:1:1:6 | 23, 42 | others.js:1:1:5:2 | | +| others.js:1:5:1:6 | 42 | others.js:1:1:5:2 | | +| others.js:2:1:2:2 | 23 | others.js:1:1:5:2 | | +| others.js:2:1:2:10 | 23, 42, 56 | others.js:1:1:5:2 | | +| others.js:2:5:2:6 | 42 | others.js:1:1:5:2 | | +| others.js:2:9:2:10 | 56 | others.js:1:1:5:2 | | +| others.js:3:1:3:4 | true | others.js:1:1:5:2 | | +| others.js:3:1:3:12 | true ? 0 : 1 | others.js:1:1:5:2 | | +| others.js:3:8:3:8 | 0 | others.js:1:1:5:2 | | +| others.js:3:12:3:12 | 1 | others.js:1:1:5:2 | | +| others.js:4:10:4:10 | p | others.js:1:1:5:2 | | +| others.js:4:10:4:10 | p | others.js:1:1:5:2 | | +| others.js:4:15:4:15 | o | others.js:1:1:5:2 | | +| primaries.js:1:1:1:4 | null | primaries.js:1:1:32:17 | | +| primaries.js:2:1:2:4 | true | primaries.js:1:1:32:17 | | +| primaries.js:3:1:3:5 | false | primaries.js:1:1:32:17 | | +| primaries.js:4:1:4:2 | 23 | primaries.js:1:1:32:17 | | +| primaries.js:5:1:5:3 | 2.3 | primaries.js:1:1:32:17 | | +| primaries.js:6:1:6:3 | .42 | primaries.js:1:1:32:17 | | +| primaries.js:7:1:7:6 | 7.6e23 | primaries.js:1:1:32:17 | | +| primaries.js:8:1:8:5 | 1E-42 | primaries.js:1:1:32:17 | | +| primaries.js:9:1:9:10 | 0xdeadbeef | primaries.js:1:1:32:17 | | +| primaries.js:10:1:10:7 | "Hello" | primaries.js:1:1:32:17 | | +| primaries.js:11:1:11:7 | 'world' | primaries.js:1:1:32:17 | | +| primaries.js:12:1:12:13 | "'what?'\\x0a" | primaries.js:1:1:32:17 | | +| primaries.js:13:1:13:10 | '"why?"\\n' | primaries.js:1:1:32:17 | | +| primaries.js:14:1:14:15 | /^(need?le)+/gi | primaries.js:1:1:32:17 | | +| primaries.js:15:1:15:4 | (23) | primaries.js:1:1:32:17 | | +| primaries.js:15:2:15:3 | 23 | primaries.js:1:1:32:17 | | +| primaries.js:16:1:16:17 | [23, 42, , "hi" ] | primaries.js:1:1:32:17 | | +| primaries.js:16:2:16:3 | 23 | primaries.js:1:1:32:17 | | +| primaries.js:16:6:16:7 | 42 | primaries.js:1:1:32:17 | | +| primaries.js:16:12:16:15 | "hi" | primaries.js:1:1:32:17 | | +| primaries.js:17:1:21:16 | ({ x: 2 ... v) {}}) | primaries.js:1:1:32:17 | | +| primaries.js:17:2:21:15 | { x: 23 ... (v) {}} | primaries.js:1:1:32:17 | | +| primaries.js:17:4:17:4 | x | primaries.js:1:1:32:17 | | +| primaries.js:17:7:17:8 | 23 | primaries.js:1:1:32:17 | | +| primaries.js:18:4:18:4 | y | primaries.js:1:1:32:17 | | +| primaries.js:18:7:18:10 | this | primaries.js:1:1:32:17 | | +| primaries.js:19:8:19:8 | o | primaries.js:1:1:32:17 | | +| primaries.js:19:9:19:13 | () {} | primaries.js:1:1:32:17 | | +| primaries.js:20:8:20:8 | p | primaries.js:1:1:32:17 | | +| primaries.js:20:9:20:13 | () {} | primaries.js:1:1:32:17 | | +| primaries.js:21:8:21:8 | p | primaries.js:1:1:32:17 | | +| primaries.js:21:9:21:14 | (v) {} | primaries.js:1:1:32:17 | | +| primaries.js:21:10:21:10 | v | primaries.js:21:9:21:14 | (v) {} | +| primaries.js:22:1:22:9 | new Array | primaries.js:1:1:32:17 | | +| primaries.js:22:5:22:9 | Array | primaries.js:1:1:32:17 | | +| primaries.js:23:1:23:12 | new Object() | primaries.js:1:1:32:17 | | +| primaries.js:23:5:23:10 | Object | primaries.js:1:1:32:17 | | +| primaries.js:24:1:24:16 | new String("hi") | primaries.js:1:1:32:17 | | +| primaries.js:24:5:24:10 | String | primaries.js:1:1:32:17 | | +| primaries.js:24:12:24:15 | "hi" | primaries.js:1:1:32:17 | | +| primaries.js:25:1:25:6 | String | primaries.js:1:1:32:17 | | +| primaries.js:25:1:25:10 | String("") | primaries.js:1:1:32:17 | | +| primaries.js:25:8:25:9 | "" | primaries.js:1:1:32:17 | | +| primaries.js:26:1:26:6 | Object | primaries.js:1:1:32:17 | | +| primaries.js:26:1:26:13 | Object.create | primaries.js:1:1:32:17 | | +| primaries.js:26:1:26:17 | Object.create({}) | primaries.js:1:1:32:17 | | +| primaries.js:26:8:26:13 | create | primaries.js:1:1:32:17 | | +| primaries.js:26:15:26:16 | {} | primaries.js:1:1:32:17 | | +| primaries.js:27:1:27:6 | String | primaries.js:1:1:32:17 | | +| primaries.js:27:1:27:29 | String[ ... erse()] | primaries.js:1:1:32:17 | | +| primaries.js:27:8:27:18 | 'epytotorp' | primaries.js:1:1:32:17 | | +| primaries.js:27:8:27:26 | 'epytotorp'.reverse | primaries.js:1:1:32:17 | | +| primaries.js:27:8:27:28 | 'epytot ... verse() | primaries.js:1:1:32:17 | | +| primaries.js:27:20:27:26 | reverse | primaries.js:1:1:32:17 | | +| primaries.js:28:1:28:6 | ((42)) | primaries.js:1:1:32:17 | | +| primaries.js:28:2:28:5 | (42) | primaries.js:1:1:32:17 | | +| primaries.js:28:3:28:4 | 42 | primaries.js:1:1:32:17 | | +| primaries.js:29:1:29:13 | /\\2147483648/ | primaries.js:1:1:32:17 | | +| primaries.js:30:1:30:26 | /a{2147 ... 83649}/ | primaries.js:1:1:32:17 | | +| primaries.js:31:1:31:16 | /a{-2147483648}/ | primaries.js:1:1:32:17 | | +| primaries.js:32:1:32:16 | /a{-2147483649}/ | primaries.js:1:1:32:17 | | +| surrogates.js:1:5:1:5 | a | surrogates.js:1:1:4:15 | | +| surrogates.js:1:5:1:16 | a = "\\ud800" | surrogates.js:1:1:4:15 | | +| surrogates.js:1:9:1:16 | "\\ud800" | surrogates.js:1:1:4:15 | | +| surrogates.js:2:1:2:8 | /\\uD800/ | surrogates.js:1:1:4:15 | | +| surrogates.js:2:1:2:13 | /\\uD800/.test | surrogates.js:1:1:4:15 | | +| surrogates.js:2:1:2:16 | /\\uD800/.test(a) | surrogates.js:1:1:4:15 | | +| surrogates.js:2:10:2:13 | test | surrogates.js:1:1:4:15 | | +| surrogates.js:2:15:2:15 | a | surrogates.js:1:1:4:15 | | +| surrogates.js:3:1:3:14 | "\\uD834\\uDF06" | surrogates.js:1:1:4:15 | | +| surrogates.js:4:1:4:14 | '\\udc00\\ud800' | surrogates.js:1:1:4:15 | | +| unary.js:1:1:1:3 | -23 | unary.js:1:1:7:24 | | +| unary.js:1:2:1:3 | 23 | unary.js:1:1:7:24 | | +| unary.js:2:1:2:3 | +42 | unary.js:1:1:7:24 | | +| unary.js:2:2:2:3 | 42 | unary.js:1:1:7:24 | | +| unary.js:3:1:3:5 | !true | unary.js:1:1:7:24 | | +| unary.js:3:2:3:5 | true | unary.js:1:1:7:24 | | +| unary.js:4:1:4:2 | ~2 | unary.js:1:1:7:24 | | +| unary.js:4:2:4:2 | 2 | unary.js:1:1:7:24 | | +| unary.js:5:1:5:13 | typeof Object | unary.js:1:1:7:24 | | +| unary.js:5:8:5:13 | Object | unary.js:1:1:7:24 | | +| unary.js:6:1:6:7 | void(0) | unary.js:1:1:7:24 | | +| unary.js:6:5:6:7 | (0) | unary.js:1:1:7:24 | | +| unary.js:6:6:6:6 | 0 | unary.js:1:1:7:24 | | +| unary.js:7:1:7:23 | delete ... ototype | unary.js:1:1:7:24 | | +| unary.js:7:8:7:13 | Object | unary.js:1:1:7:24 | | +| unary.js:7:8:7:23 | Object.prototype | unary.js:1:1:7:24 | | +| unary.js:7:15:7:23 | prototype | unary.js:1:1:7:24 | | +| update.js:1:1:1:3 | ++a | update.js:1:1:5:0 | | +| update.js:1:3:1:3 | a | update.js:1:1:5:0 | | +| update.js:2:1:2:1 | a | update.js:1:1:5:0 | | +| update.js:2:1:2:3 | a++ | update.js:1:1:5:0 | | +| update.js:3:1:3:3 | --b | update.js:1:1:5:0 | | +| update.js:3:3:3:3 | b | update.js:1:1:5:0 | | +| update.js:4:1:4:1 | b | update.js:1:1:5:0 | | +| update.js:4:1:4:3 | b-- | update.js:1:1:5:0 | | +test_getEnclosingStmt +| assignment.js:1:1:1:1 | a | assignment.js:1:1:1:7 | a = 23; | +| assignment.js:1:1:1:6 | a = 23 | assignment.js:1:1:1:7 | a = 23; | +| assignment.js:1:5:1:6 | 23 | assignment.js:1:1:1:7 | a = 23; | +| assignment.js:2:1:2:1 | a | assignment.js:2:1:2:8 | a += 19; | +| assignment.js:2:1:2:7 | a += 19 | assignment.js:2:1:2:8 | a += 19; | +| assignment.js:2:6:2:7 | 19 | assignment.js:2:1:2:8 | a += 19; | +| assignment.js:3:1:3:1 | a | assignment.js:3:1:3:7 | a -= 9; | +| assignment.js:3:1:3:6 | a -= 9 | assignment.js:3:1:3:7 | a -= 9; | +| assignment.js:3:6:3:6 | 9 | assignment.js:3:1:3:7 | a -= 9; | +| assignment.js:4:1:4:1 | a | assignment.js:4:1:4:7 | a *= b; | +| assignment.js:4:1:4:6 | a *= b | assignment.js:4:1:4:7 | a *= b; | +| assignment.js:4:6:4:6 | b | assignment.js:4:1:4:7 | a *= b; | +| assignment.js:5:1:5:1 | a | assignment.js:5:1:5:7 | a /= 2; | +| assignment.js:5:1:5:6 | a /= 2 | assignment.js:5:1:5:7 | a /= 2; | +| assignment.js:5:6:5:6 | 2 | assignment.js:5:1:5:7 | a /= 2; | +| assignment.js:6:1:6:1 | a | assignment.js:6:1:6:7 | a %= 2; | +| assignment.js:6:1:6:6 | a %= 2 | assignment.js:6:1:6:7 | a %= 2; | +| assignment.js:6:6:6:6 | 2 | assignment.js:6:1:6:7 | a %= 2; | +| assignment.js:7:1:7:1 | a | assignment.js:7:1:7:8 | a <<= 8; | +| assignment.js:7:1:7:7 | a <<= 8 | assignment.js:7:1:7:8 | a <<= 8; | +| assignment.js:7:7:7:7 | 8 | assignment.js:7:1:7:8 | a <<= 8; | +| assignment.js:8:1:8:1 | a | assignment.js:8:1:8:8 | a >>= 7; | +| assignment.js:8:1:8:7 | a >>= 7 | assignment.js:8:1:8:8 | a >>= 7; | +| assignment.js:8:7:8:7 | 7 | assignment.js:8:1:8:8 | a >>= 7; | +| assignment.js:9:1:9:1 | a | assignment.js:9:1:9:9 | a >>>= 2; | +| assignment.js:9:1:9:8 | a >>>= 2 | assignment.js:9:1:9:9 | a >>>= 2; | +| assignment.js:9:8:9:8 | 2 | assignment.js:9:1:9:9 | a >>>= 2; | +| assignment.js:10:1:10:1 | a | assignment.js:10:1:10:7 | a \|= 2; | +| assignment.js:10:1:10:6 | a \|= 2 | assignment.js:10:1:10:7 | a \|= 2; | +| assignment.js:10:6:10:6 | 2 | assignment.js:10:1:10:7 | a \|= 2; | +| assignment.js:11:1:11:1 | a | assignment.js:11:1:11:7 | a ^= 1; | +| assignment.js:11:1:11:6 | a ^= 1 | assignment.js:11:1:11:7 | a ^= 1; | +| assignment.js:11:6:11:6 | 1 | assignment.js:11:1:11:7 | a ^= 1; | +| assignment.js:12:1:12:1 | a | assignment.js:12:1:12:7 | a &= 3; | +| assignment.js:12:1:12:6 | a &= 3 | assignment.js:12:1:12:7 | a &= 3; | +| assignment.js:12:6:12:6 | 3 | assignment.js:12:1:12:7 | a &= 3; | +| binary.js:1:1:1:1 | 1 | binary.js:1:1:1:7 | 1 << 2; | +| binary.js:1:1:1:6 | 1 << 2 | binary.js:1:1:1:7 | 1 << 2; | +| binary.js:1:6:1:6 | 2 | binary.js:1:1:1:7 | 1 << 2; | +| binary.js:2:1:2:1 | 2 | binary.js:2:1:2:7 | 2 >> 1; | +| binary.js:2:1:2:6 | 2 >> 1 | binary.js:2:1:2:7 | 2 >> 1; | +| binary.js:2:6:2:6 | 1 | binary.js:2:1:2:7 | 2 >> 1; | +| binary.js:3:1:3:1 | 2 | binary.js:3:1:3:8 | 2 >>> 1; | +| binary.js:3:1:3:7 | 2 >>> 1 | binary.js:3:1:3:8 | 2 >>> 1; | +| binary.js:3:7:3:7 | 1 | binary.js:3:1:3:8 | 2 >>> 1; | +| binary.js:4:1:4:2 | 23 | binary.js:4:1:4:8 | 23 + 19; | +| binary.js:4:1:4:7 | 23 + 19 | binary.js:4:1:4:8 | 23 + 19; | +| binary.js:4:6:4:7 | 19 | binary.js:4:1:4:8 | 23 + 19; | +| binary.js:5:1:5:2 | 42 | binary.js:5:1:5:8 | 42 - 19; | +| binary.js:5:1:5:7 | 42 - 19 | binary.js:5:1:5:8 | 42 - 19; | +| binary.js:5:6:5:7 | 19 | binary.js:5:1:5:8 | 42 - 19; | +| binary.js:6:1:6:1 | 2 | binary.js:6:1:6:6 | 2 * 3; | +| binary.js:6:1:6:5 | 2 * 3 | binary.js:6:1:6:6 | 2 * 3; | +| binary.js:6:5:6:5 | 3 | binary.js:6:1:6:6 | 2 * 3; | +| binary.js:7:1:7:1 | 8 | binary.js:7:1:7:6 | 8 / 5; | +| binary.js:7:1:7:5 | 8 / 5 | binary.js:7:1:7:6 | 8 / 5; | +| binary.js:7:5:7:5 | 5 | binary.js:7:1:7:6 | 8 / 5; | +| binary.js:8:1:8:1 | 2 | binary.js:8:1:8:6 | 2 % 1; | +| binary.js:8:1:8:5 | 2 % 1 | binary.js:8:1:8:6 | 2 % 1; | +| binary.js:8:5:8:5 | 1 | binary.js:8:1:8:6 | 2 % 1; | +| binary.js:9:1:9:1 | 2 | binary.js:9:1:9:6 | 2 \| 3; | +| binary.js:9:1:9:5 | 2 \| 3 | binary.js:9:1:9:6 | 2 \| 3; | +| binary.js:9:5:9:5 | 3 | binary.js:9:1:9:6 | 2 \| 3; | +| binary.js:10:1:10:1 | 2 | binary.js:10:1:10:6 | 2 ^ 3; | +| binary.js:10:1:10:5 | 2 ^ 3 | binary.js:10:1:10:6 | 2 ^ 3; | +| binary.js:10:5:10:5 | 3 | binary.js:10:1:10:6 | 2 ^ 3; | +| binary.js:11:1:11:1 | 2 | binary.js:11:1:11:6 | 2 & 3; | +| binary.js:11:1:11:5 | 2 & 3 | binary.js:11:1:11:6 | 2 & 3; | +| binary.js:11:5:11:5 | 3 | binary.js:11:1:11:6 | 2 & 3; | +| binary.js:12:1:12:11 | 'prototype' | binary.js:12:1:12:22 | 'protot ... Object; | +| binary.js:12:1:12:21 | 'protot ... Object | binary.js:12:1:12:22 | 'protot ... Object; | +| binary.js:12:16:12:21 | Object | binary.js:12:1:12:22 | 'protot ... Object; | +| binary.js:13:1:13:2 | [] | binary.js:13:1:13:20 | [] instanceof Array; | +| binary.js:13:1:13:19 | [] instanceof Array | binary.js:13:1:13:20 | [] instanceof Array; | +| binary.js:13:15:13:19 | Array | binary.js:13:1:13:20 | [] instanceof Array; | +| binary.js:14:1:14:1 | 1 | binary.js:14:1:14:7 | 1 && 2; | +| binary.js:14:1:14:6 | 1 && 2 | binary.js:14:1:14:7 | 1 && 2; | +| binary.js:14:6:14:6 | 2 | binary.js:14:1:14:7 | 1 && 2; | +| binary.js:15:1:15:1 | 1 | binary.js:15:1:15:7 | 1 \|\| 2; | +| binary.js:15:1:15:6 | 1 \|\| 2 | binary.js:15:1:15:7 | 1 \|\| 2; | +| binary.js:15:6:15:6 | 2 | binary.js:15:1:15:7 | 1 \|\| 2; | +| comparison.js:1:1:1:1 | 1 | comparison.js:1:1:1:7 | 1 == 1; | +| comparison.js:1:1:1:6 | 1 == 1 | comparison.js:1:1:1:7 | 1 == 1; | +| comparison.js:1:6:1:6 | 1 | comparison.js:1:1:1:7 | 1 == 1; | +| comparison.js:2:1:2:1 | 1 | comparison.js:2:1:2:7 | 1 != 2; | +| comparison.js:2:1:2:6 | 1 != 2 | comparison.js:2:1:2:7 | 1 != 2; | +| comparison.js:2:6:2:6 | 2 | comparison.js:2:1:2:7 | 1 != 2; | +| comparison.js:3:1:3:1 | 1 | comparison.js:3:1:3:8 | 1 === 1; | +| comparison.js:3:1:3:7 | 1 === 1 | comparison.js:3:1:3:8 | 1 === 1; | +| comparison.js:3:7:3:7 | 1 | comparison.js:3:1:3:8 | 1 === 1; | +| comparison.js:4:1:4:1 | 1 | comparison.js:4:1:4:8 | 1 !== 2; | +| comparison.js:4:1:4:7 | 1 !== 2 | comparison.js:4:1:4:8 | 1 !== 2; | +| comparison.js:4:7:4:7 | 2 | comparison.js:4:1:4:8 | 1 !== 2; | +| comparison.js:5:1:5:1 | 1 | comparison.js:5:1:5:6 | 1 < 2; | +| comparison.js:5:1:5:5 | 1 < 2 | comparison.js:5:1:5:6 | 1 < 2; | +| comparison.js:5:5:5:5 | 2 | comparison.js:5:1:5:6 | 1 < 2; | +| comparison.js:6:1:6:1 | 1 | comparison.js:6:1:6:7 | 1 <= 2; | +| comparison.js:6:1:6:6 | 1 <= 2 | comparison.js:6:1:6:7 | 1 <= 2; | +| comparison.js:6:6:6:6 | 2 | comparison.js:6:1:6:7 | 1 <= 2; | +| comparison.js:7:1:7:1 | 2 | comparison.js:7:1:7:6 | 2 > 1; | +| comparison.js:7:1:7:5 | 2 > 1 | comparison.js:7:1:7:6 | 2 > 1; | +| comparison.js:7:5:7:5 | 1 | comparison.js:7:1:7:6 | 2 > 1; | +| comparison.js:8:1:8:1 | 2 | comparison.js:8:1:8:7 | 2 >= 1; | +| comparison.js:8:1:8:6 | 2 >= 1 | comparison.js:8:1:8:7 | 2 >= 1; | +| comparison.js:8:6:8:6 | 1 | comparison.js:8:1:8:7 | 2 >= 1; | +| es2015.js:1:1:1:18 | ["a", "ab", "abc"] | es2015.js:1:1:1:38 | ["a", " ... ength); | +| es2015.js:1:1:1:22 | ["a", " ... c"].map | es2015.js:1:1:1:38 | ["a", " ... ength); | +| es2015.js:1:1:1:37 | ["a", " ... length) | es2015.js:1:1:1:38 | ["a", " ... ength); | +| es2015.js:1:2:1:4 | "a" | es2015.js:1:1:1:38 | ["a", " ... ength); | +| es2015.js:1:7:1:10 | "ab" | es2015.js:1:1:1:38 | ["a", " ... ength); | +| es2015.js:1:13:1:17 | "abc" | es2015.js:1:1:1:38 | ["a", " ... ength); | +| es2015.js:1:20:1:22 | map | es2015.js:1:1:1:38 | ["a", " ... ength); | +| es2015.js:1:24:1:36 | s => s.length | es2015.js:1:1:1:38 | ["a", " ... ength); | +| es2015.js:2:1:2:11 | setInterval | es2015.js:2:1:2:31 | setInte ... 1000); | +| es2015.js:2:1:2:30 | setInte ... , 1000) | es2015.js:2:1:2:31 | setInte ... 1000); | +| es2015.js:2:13:2:23 | () => ++cnt | es2015.js:2:1:2:31 | setInte ... 1000); | +| es2015.js:2:26:2:29 | 1000 | es2015.js:2:1:2:31 | setInte ... 1000); | +| es2015.js:3:1:3:10 | setTimeout | es2015.js:3:1:3:48 | setTime ... 60000); | +| es2015.js:3:1:3:47 | setTime ... 60000) | es2015.js:3:1:3:48 | setTime ... 60000); | +| es2015.js:3:12:3:39 | () => { ... p!"); } | es2015.js:3:1:3:48 | setTime ... 60000); | +| es2015.js:3:20:3:24 | alert | es2015.js:3:20:3:37 | alert("Wake up!"); | +| es2015.js:3:20:3:36 | alert("Wake up!") | es2015.js:3:20:3:37 | alert("Wake up!"); | +| es2015.js:3:26:3:35 | "Wake up!" | es2015.js:3:20:3:37 | alert("Wake up!"); | +| es2015.js:3:42:3:46 | 60000 | es2015.js:3:1:3:48 | setTime ... 60000); | +| es2015.js:5:1:5:10 | [a, ...as] | es2015.js:5:1:5:11 | [a, ...as]; | +| es2015.js:5:2:5:2 | a | es2015.js:5:1:5:11 | [a, ...as]; | +| es2015.js:5:5:5:9 | ...as | es2015.js:5:1:5:11 | [a, ...as]; | +| es2015.js:5:8:5:9 | as | es2015.js:5:1:5:11 | [a, ...as]; | +| es2015.js:6:1:6:18 | new Array(...elts) | es2015.js:6:1:6:19 | new Array(...elts); | +| es2015.js:6:5:6:9 | Array | es2015.js:6:1:6:19 | new Array(...elts); | +| es2015.js:6:11:6:17 | ...elts | es2015.js:6:1:6:19 | new Array(...elts); | +| es2015.js:6:14:6:17 | elts | es2015.js:6:1:6:19 | new Array(...elts); | +| es2015.js:9:6:9:15 | [a, [, c]] | es2015.js:9:2:9:20 | var [a, [, c]] = x; | +| es2015.js:9:6:9:19 | [a, [, c]] = x | es2015.js:9:2:9:20 | var [a, [, c]] = x; | +| es2015.js:9:7:9:7 | a | es2015.js:9:2:9:20 | var [a, [, c]] = x; | +| es2015.js:9:10:9:14 | [, c] | es2015.js:9:2:9:20 | var [a, [, c]] = x; | +| es2015.js:9:13:9:13 | c | es2015.js:9:2:9:20 | var [a, [, c]] = x; | +| es2015.js:9:19:9:19 | x | es2015.js:9:2:9:20 | var [a, [, c]] = x; | +| es2015.js:11:9:11:14 | [a, c] | es2015.js:11:3:11:15 | throw [a, c]; | +| es2015.js:11:10:11:10 | a | es2015.js:11:3:11:15 | throw [a, c]; | +| es2015.js:11:13:11:13 | c | es2015.js:11:3:11:15 | throw [a, c]; | +| es2015.js:12:11:12:11 | d | es2015.js:12:4:14:2 | catch ( ... (d);\\n\\t} | +| es2015.js:13:3:13:9 | console | es2015.js:13:3:13:17 | console.log(d); | +| es2015.js:13:3:13:13 | console.log | es2015.js:13:3:13:17 | console.log(d); | +| es2015.js:13:3:13:16 | console.log(d) | es2015.js:13:3:13:17 | console.log(d); | +| es2015.js:13:11:13:13 | log | es2015.js:13:3:13:17 | console.log(d); | +| es2015.js:13:15:13:15 | d | es2015.js:13:3:13:17 | console.log(d); | +| es2015.js:18:6:18:15 | { [x]: w } | es2015.js:18:2:18:20 | var { [x]: w } = z; | +| es2015.js:18:6:18:19 | { [x]: w } = z | es2015.js:18:2:18:20 | var { [x]: w } = z; | +| es2015.js:18:9:18:9 | x | es2015.js:18:2:18:20 | var { [x]: w } = z; | +| es2015.js:18:13:18:13 | w | es2015.js:18:2:18:20 | var { [x]: w } = z; | +| es2015.js:18:19:18:19 | z | es2015.js:18:2:18:20 | var { [x]: w } = z; | +| es2015.js:19:9:19:9 | w | es2015.js:19:2:19:10 | return w; | +| es2015.js:23:8:23:8 | n | es2015.js:23:2:24:10 | while(n ... ield n; | +| es2015.js:23:8:23:10 | n-- | es2015.js:23:2:24:10 | while(n ... ield n; | +| es2015.js:23:8:23:12 | n-->0 | es2015.js:23:2:24:10 | while(n ... ield n; | +| es2015.js:23:12:23:12 | 0 | es2015.js:23:2:24:10 | while(n ... ield n; | +| es2015.js:24:3:24:9 | yield n | es2015.js:24:3:24:10 | yield n; | +| es2015.js:24:9:24:9 | n | es2015.js:24:3:24:10 | yield n; | +| es2015.js:25:2:25:14 | yield* foo(1) | es2015.js:25:2:25:15 | yield* foo(1); | +| es2015.js:25:9:25:11 | foo | es2015.js:25:2:25:15 | yield* foo(1); | +| es2015.js:25:9:25:14 | foo(1) | es2015.js:25:2:25:15 | yield* foo(1); | +| es2015.js:25:13:25:13 | 1 | es2015.js:25:2:25:15 | yield* foo(1); | +| functions.js:2:2:2:5 | in_f | functions.js:2:2:2:6 | in_f; | +| functions.js:3:9:3:17 | also_in_f | functions.js:3:2:8:5 | while ( ... n\\n\\t\\t}); | +| functions.js:4:3:6:4 | (functi ... f;\\n\\t\\t}) | functions.js:4:3:8:5 | (functi ... n\\n\\t\\t}); | +| functions.js:4:3:8:4 | (functi ... in\\n\\t\\t}) | functions.js:4:3:8:5 | (functi ... n\\n\\t\\t}); | +| functions.js:4:4:6:3 | functio ... _f;\\n\\t\\t} | functions.js:4:3:8:5 | (functi ... n\\n\\t\\t}); | +| functions.js:5:4:5:11 | not_in_f | functions.js:5:4:5:12 | not_in_f; | +| functions.js:6:6:8:3 | {\\n\\t\\t\\tx: ... ain\\n\\t\\t} | functions.js:4:3:8:5 | (functi ... n\\n\\t\\t}); | +| functions.js:7:4:7:4 | x | functions.js:4:3:8:5 | (functi ... n\\n\\t\\t}); | +| functions.js:7:7:7:16 | in_f_again | functions.js:4:3:8:5 | (functi ... n\\n\\t\\t}); | +| functions.js:10:1:10:6 | global | functions.js:10:1:10:7 | global; | +| legacyletexpr.js:1:1:1:7 | console | legacyletexpr.js:1:1:1:40 | console ... x + y); | +| legacyletexpr.js:1:1:1:11 | console.log | legacyletexpr.js:1:1:1:40 | console ... x + y); | +| legacyletexpr.js:1:1:1:39 | console ... x + y) | legacyletexpr.js:1:1:1:40 | console ... x + y); | +| legacyletexpr.js:1:9:1:11 | log | legacyletexpr.js:1:1:1:40 | console ... x + y); | +| legacyletexpr.js:1:13:1:38 | let (x ... ) x + y | legacyletexpr.js:1:1:1:40 | console ... x + y); | +| legacyletexpr.js:1:18:1:18 | x | legacyletexpr.js:1:1:1:40 | console ... x + y); | +| legacyletexpr.js:1:18:1:23 | x = 23 | legacyletexpr.js:1:1:1:40 | console ... x + y); | +| legacyletexpr.js:1:22:1:23 | 23 | legacyletexpr.js:1:1:1:40 | console ... x + y); | +| legacyletexpr.js:1:26:1:26 | y | legacyletexpr.js:1:1:1:40 | console ... x + y); | +| legacyletexpr.js:1:26:1:31 | y = 19 | legacyletexpr.js:1:1:1:40 | console ... x + y); | +| legacyletexpr.js:1:30:1:31 | 19 | legacyletexpr.js:1:1:1:40 | console ... x + y); | +| legacyletexpr.js:1:34:1:34 | x | legacyletexpr.js:1:1:1:40 | console ... x + y); | +| legacyletexpr.js:1:34:1:38 | x + y | legacyletexpr.js:1:1:1:40 | console ... x + y); | +| legacyletexpr.js:1:38:1:38 | y | legacyletexpr.js:1:1:1:40 | console ... x + y); | +| mozextensions.js:1:1:1:5 | array | mozextensions.js:1:1:1:27 | array.m ... ) x+1); | +| mozextensions.js:1:1:1:9 | array.map | mozextensions.js:1:1:1:27 | array.m ... ) x+1); | +| mozextensions.js:1:1:1:26 | array.m ... x) x+1) | mozextensions.js:1:1:1:27 | array.m ... ) x+1); | +| mozextensions.js:1:7:1:9 | map | mozextensions.js:1:1:1:27 | array.m ... ) x+1); | +| mozextensions.js:1:11:1:25 | function(x) x+1 | mozextensions.js:1:1:1:27 | array.m ... ) x+1); | +| others.js:1:1:1:2 | 23 | others.js:1:1:1:7 | 23, 42; | +| others.js:1:1:1:6 | 23, 42 | others.js:1:1:1:7 | 23, 42; | +| others.js:1:5:1:6 | 42 | others.js:1:1:1:7 | 23, 42; | +| others.js:2:1:2:2 | 23 | others.js:2:1:2:11 | 23, 42, 56; | +| others.js:2:1:2:10 | 23, 42, 56 | others.js:2:1:2:11 | 23, 42, 56; | +| others.js:2:5:2:6 | 42 | others.js:2:1:2:11 | 23, 42, 56; | +| others.js:2:9:2:10 | 56 | others.js:2:1:2:11 | 23, 42, 56; | +| others.js:3:1:3:4 | true | others.js:3:1:3:13 | true ? 0 : 1; | +| others.js:3:1:3:12 | true ? 0 : 1 | others.js:3:1:3:13 | true ? 0 : 1; | +| others.js:3:8:3:8 | 0 | others.js:3:1:3:13 | true ? 0 : 1; | +| others.js:3:12:3:12 | 1 | others.js:3:1:3:13 | true ? 0 : 1; | +| others.js:4:10:4:10 | p | others.js:4:6:4:10 | var p | +| others.js:4:10:4:10 | p | others.js:4:6:4:10 | var p | +| others.js:4:15:4:15 | o | others.js:4:1:5:2 | for (var p in o)\\n\\t; | +| primaries.js:1:1:1:4 | null | primaries.js:1:1:1:5 | null; | +| primaries.js:2:1:2:4 | true | primaries.js:2:1:2:5 | true; | +| primaries.js:3:1:3:5 | false | primaries.js:3:1:3:6 | false; | +| primaries.js:4:1:4:2 | 23 | primaries.js:4:1:4:3 | 23; | +| primaries.js:5:1:5:3 | 2.3 | primaries.js:5:1:5:4 | 2.3; | +| primaries.js:6:1:6:3 | .42 | primaries.js:6:1:6:4 | .42; | +| primaries.js:7:1:7:6 | 7.6e23 | primaries.js:7:1:7:7 | 7.6e23; | +| primaries.js:8:1:8:5 | 1E-42 | primaries.js:8:1:8:6 | 1E-42; | +| primaries.js:9:1:9:10 | 0xdeadbeef | primaries.js:9:1:9:11 | 0xdeadbeef; | +| primaries.js:10:1:10:7 | "Hello" | primaries.js:10:1:10:8 | "Hello"; | +| primaries.js:11:1:11:7 | 'world' | primaries.js:11:1:11:8 | 'world'; | +| primaries.js:12:1:12:13 | "'what?'\\x0a" | primaries.js:12:1:12:14 | "'what?'\\x0a"; | +| primaries.js:13:1:13:10 | '"why?"\\n' | primaries.js:13:1:13:11 | '"why?"\\n'; | +| primaries.js:14:1:14:15 | /^(need?le)+/gi | primaries.js:14:1:14:16 | /^(need?le)+/gi; | +| primaries.js:15:1:15:4 | (23) | primaries.js:15:1:15:5 | (23); | +| primaries.js:15:2:15:3 | 23 | primaries.js:15:1:15:5 | (23); | +| primaries.js:16:1:16:17 | [23, 42, , "hi" ] | primaries.js:16:1:16:18 | [23, 42, , "hi" ]; | +| primaries.js:16:2:16:3 | 23 | primaries.js:16:1:16:18 | [23, 42, , "hi" ]; | +| primaries.js:16:6:16:7 | 42 | primaries.js:16:1:16:18 | [23, 42, , "hi" ]; | +| primaries.js:16:12:16:15 | "hi" | primaries.js:16:1:16:18 | [23, 42, , "hi" ]; | +| primaries.js:17:1:21:16 | ({ x: 2 ... v) {}}) | primaries.js:17:1:21:17 | ({ x: 2 ... ) {}}); | +| primaries.js:17:2:21:15 | { x: 23 ... (v) {}} | primaries.js:17:1:21:17 | ({ x: 2 ... ) {}}); | +| primaries.js:17:4:17:4 | x | primaries.js:17:1:21:17 | ({ x: 2 ... ) {}}); | +| primaries.js:17:7:17:8 | 23 | primaries.js:17:1:21:17 | ({ x: 2 ... ) {}}); | +| primaries.js:18:4:18:4 | y | primaries.js:17:1:21:17 | ({ x: 2 ... ) {}}); | +| primaries.js:18:7:18:10 | this | primaries.js:17:1:21:17 | ({ x: 2 ... ) {}}); | +| primaries.js:19:8:19:8 | o | primaries.js:17:1:21:17 | ({ x: 2 ... ) {}}); | +| primaries.js:19:9:19:13 | () {} | primaries.js:17:1:21:17 | ({ x: 2 ... ) {}}); | +| primaries.js:20:8:20:8 | p | primaries.js:17:1:21:17 | ({ x: 2 ... ) {}}); | +| primaries.js:20:9:20:13 | () {} | primaries.js:17:1:21:17 | ({ x: 2 ... ) {}}); | +| primaries.js:21:8:21:8 | p | primaries.js:17:1:21:17 | ({ x: 2 ... ) {}}); | +| primaries.js:21:9:21:14 | (v) {} | primaries.js:17:1:21:17 | ({ x: 2 ... ) {}}); | +| primaries.js:22:1:22:9 | new Array | primaries.js:22:1:22:10 | new Array; | +| primaries.js:22:5:22:9 | Array | primaries.js:22:1:22:10 | new Array; | +| primaries.js:23:1:23:12 | new Object() | primaries.js:23:1:23:13 | new Object(); | +| primaries.js:23:5:23:10 | Object | primaries.js:23:1:23:13 | new Object(); | +| primaries.js:24:1:24:16 | new String("hi") | primaries.js:24:1:24:17 | new String("hi"); | +| primaries.js:24:5:24:10 | String | primaries.js:24:1:24:17 | new String("hi"); | +| primaries.js:24:12:24:15 | "hi" | primaries.js:24:1:24:17 | new String("hi"); | +| primaries.js:25:1:25:6 | String | primaries.js:25:1:25:11 | String(""); | +| primaries.js:25:1:25:10 | String("") | primaries.js:25:1:25:11 | String(""); | +| primaries.js:25:8:25:9 | "" | primaries.js:25:1:25:11 | String(""); | +| primaries.js:26:1:26:6 | Object | primaries.js:26:1:26:18 | Object.create({}); | +| primaries.js:26:1:26:13 | Object.create | primaries.js:26:1:26:18 | Object.create({}); | +| primaries.js:26:1:26:17 | Object.create({}) | primaries.js:26:1:26:18 | Object.create({}); | +| primaries.js:26:8:26:13 | create | primaries.js:26:1:26:18 | Object.create({}); | +| primaries.js:26:15:26:16 | {} | primaries.js:26:1:26:18 | Object.create({}); | +| primaries.js:27:1:27:6 | String | primaries.js:27:1:27:30 | String[ ... rse()]; | +| primaries.js:27:1:27:29 | String[ ... erse()] | primaries.js:27:1:27:30 | String[ ... rse()]; | +| primaries.js:27:8:27:18 | 'epytotorp' | primaries.js:27:1:27:30 | String[ ... rse()]; | +| primaries.js:27:8:27:26 | 'epytotorp'.reverse | primaries.js:27:1:27:30 | String[ ... rse()]; | +| primaries.js:27:8:27:28 | 'epytot ... verse() | primaries.js:27:1:27:30 | String[ ... rse()]; | +| primaries.js:27:20:27:26 | reverse | primaries.js:27:1:27:30 | String[ ... rse()]; | +| primaries.js:28:1:28:6 | ((42)) | primaries.js:28:1:28:7 | ((42)); | +| primaries.js:28:2:28:5 | (42) | primaries.js:28:1:28:7 | ((42)); | +| primaries.js:28:3:28:4 | 42 | primaries.js:28:1:28:7 | ((42)); | +| primaries.js:29:1:29:13 | /\\2147483648/ | primaries.js:29:1:29:14 | /\\2147483648/; | +| primaries.js:30:1:30:26 | /a{2147 ... 83649}/ | primaries.js:30:1:30:27 | /a{2147 ... 3649}/; | +| primaries.js:31:1:31:16 | /a{-2147483648}/ | primaries.js:31:1:31:17 | /a{-2147483648}/; | +| primaries.js:32:1:32:16 | /a{-2147483649}/ | primaries.js:32:1:32:17 | /a{-2147483649}/; | +| surrogates.js:1:5:1:5 | a | surrogates.js:1:1:1:17 | var a = "\\ud800"; | +| surrogates.js:1:5:1:16 | a = "\\ud800" | surrogates.js:1:1:1:17 | var a = "\\ud800"; | +| surrogates.js:1:9:1:16 | "\\ud800" | surrogates.js:1:1:1:17 | var a = "\\ud800"; | +| surrogates.js:2:1:2:8 | /\\uD800/ | surrogates.js:2:1:2:17 | /\\uD800/.test(a); | +| surrogates.js:2:1:2:13 | /\\uD800/.test | surrogates.js:2:1:2:17 | /\\uD800/.test(a); | +| surrogates.js:2:1:2:16 | /\\uD800/.test(a) | surrogates.js:2:1:2:17 | /\\uD800/.test(a); | +| surrogates.js:2:10:2:13 | test | surrogates.js:2:1:2:17 | /\\uD800/.test(a); | +| surrogates.js:2:15:2:15 | a | surrogates.js:2:1:2:17 | /\\uD800/.test(a); | +| surrogates.js:3:1:3:14 | "\\uD834\\uDF06" | surrogates.js:3:1:3:15 | "\\uD834\\uDF06"; | +| surrogates.js:4:1:4:14 | '\\udc00\\ud800' | surrogates.js:4:1:4:15 | '\\udc00\\ud800'; | +| unary.js:1:1:1:3 | -23 | unary.js:1:1:1:4 | -23; | +| unary.js:1:2:1:3 | 23 | unary.js:1:1:1:4 | -23; | +| unary.js:2:1:2:3 | +42 | unary.js:2:1:2:4 | +42; | +| unary.js:2:2:2:3 | 42 | unary.js:2:1:2:4 | +42; | +| unary.js:3:1:3:5 | !true | unary.js:3:1:3:6 | !true; | +| unary.js:3:2:3:5 | true | unary.js:3:1:3:6 | !true; | +| unary.js:4:1:4:2 | ~2 | unary.js:4:1:4:3 | ~2; | +| unary.js:4:2:4:2 | 2 | unary.js:4:1:4:3 | ~2; | +| unary.js:5:1:5:13 | typeof Object | unary.js:5:1:5:14 | typeof Object; | +| unary.js:5:8:5:13 | Object | unary.js:5:1:5:14 | typeof Object; | +| unary.js:6:1:6:7 | void(0) | unary.js:6:1:6:8 | void(0); | +| unary.js:6:5:6:7 | (0) | unary.js:6:1:6:8 | void(0); | +| unary.js:6:6:6:6 | 0 | unary.js:6:1:6:8 | void(0); | +| unary.js:7:1:7:23 | delete ... ototype | unary.js:7:1:7:24 | delete ... totype; | +| unary.js:7:8:7:13 | Object | unary.js:7:1:7:24 | delete ... totype; | +| unary.js:7:8:7:23 | Object.prototype | unary.js:7:1:7:24 | delete ... totype; | +| unary.js:7:15:7:23 | prototype | unary.js:7:1:7:24 | delete ... totype; | +| update.js:1:1:1:3 | ++a | update.js:1:1:1:4 | ++a; | +| update.js:1:3:1:3 | a | update.js:1:1:1:4 | ++a; | +| update.js:2:1:2:1 | a | update.js:2:1:2:4 | a++; | +| update.js:2:1:2:3 | a++ | update.js:2:1:2:4 | a++; | +| update.js:3:1:3:3 | --b | update.js:3:1:3:4 | --b; | +| update.js:3:3:3:3 | b | update.js:3:1:3:4 | --b; | +| update.js:4:1:4:1 | b | update.js:4:1:4:4 | b--; | +| update.js:4:1:4:3 | b-- | update.js:4:1:4:4 | b--; | diff --git a/javascript/ql/test/library-tests/Expr/tests.ql b/javascript/ql/test/library-tests/Expr/tests.ql new file mode 100644 index 000000000000..e2aaad1b9e29 --- /dev/null +++ b/javascript/ql/test/library-tests/Expr/tests.ql @@ -0,0 +1,11 @@ +import getParent +import getTopLevel +import getChild +import isPure +import YieldExpr +import RelationalComparisons +import getEnclosingFunction +import LetExpr +import stripParens +import getContainer +import getEnclosingStmt diff --git a/javascript/ql/test/library-tests/Functions/Function.expected b/javascript/ql/test/library-tests/Functions/Function.expected deleted file mode 100644 index 5e2d28b0c4ec..000000000000 --- a/javascript/ql/test/library-tests/Functions/Function.expected +++ /dev/null @@ -1,20 +0,0 @@ -| arrowfns.js:1:24:1:36 | s => s.length | -| arrowfns.js:2:13:2:23 | () => ++cnt | -| arrowfns.js:3:12:3:41 | () => { ... "); ; } | -| defaultargs.js:1:1:1:24 | functio ... +19) {} | -| exprclosures.js:1:7:1:21 | function(x) x+1 | -| generators.js:1:1:4:1 | functio ... i++;\\n} | -| generators.js:6:2:6:19 | function* bar() {} | -| restparms.js:1:1:2:1 | functio ... ys) {\\n} | -| tst.js:1:1:1:15 | function A() {} | -| tst.js:2:1:2:16 | function B(x) {} | -| tst.js:3:1:3:19 | function C(x, y) {} | -| tst.js:4:9:4:21 | function() {} | -| tst.js:5:2:5:15 | function(x) {} | -| tst.js:6:2:6:18 | function(x, y) {} | -| tst.js:7:9:7:23 | function h() {} | -| tst.js:9:1:9:24 | functio ... nts) {} | -| tst.js:10:1:10:31 | functio ... ents; } | -| tst.js:11:1:11:35 | functio ... ts; } } | -| tst.js:12:1:12:44 | functio ... s) {} } | -| tst.js:14:1:14:37 | functio ... s[0]; } | diff --git a/javascript/ql/test/library-tests/Functions/Function.ql b/javascript/ql/test/library-tests/Functions/Function.ql deleted file mode 100644 index 04a782cafc74..000000000000 --- a/javascript/ql/test/library-tests/Functions/Function.ql +++ /dev/null @@ -1,4 +0,0 @@ -import javascript - -from Function f -select f diff --git a/javascript/ql/test/library-tests/Functions/Function.qll b/javascript/ql/test/library-tests/Functions/Function.qll new file mode 100644 index 000000000000..0835952e6ea5 --- /dev/null +++ b/javascript/ql/test/library-tests/Functions/Function.qll @@ -0,0 +1,3 @@ +import javascript + +query predicate test_Function(Function f) { any() } diff --git a/javascript/ql/test/library-tests/Functions/ReturnStmt.expected b/javascript/ql/test/library-tests/Functions/ReturnStmt.expected deleted file mode 100644 index f27607866045..000000000000 --- a/javascript/ql/test/library-tests/Functions/ReturnStmt.expected +++ /dev/null @@ -1 +0,0 @@ -| tst.js:14:1:14:37 | functio ... s[0]; } | tst.js:14:16:14:35 | return arguments[0]; | \ No newline at end of file diff --git a/javascript/ql/test/library-tests/Functions/ReturnStmt.ql b/javascript/ql/test/library-tests/Functions/ReturnStmt.ql deleted file mode 100644 index 6edc5dba37c7..000000000000 --- a/javascript/ql/test/library-tests/Functions/ReturnStmt.ql +++ /dev/null @@ -1,4 +0,0 @@ -import javascript - -from Function f -select f, f.getAReturnStmt() diff --git a/javascript/ql/test/library-tests/Functions/ReturnStmt.qll b/javascript/ql/test/library-tests/Functions/ReturnStmt.qll new file mode 100644 index 000000000000..77a9a175784a --- /dev/null +++ b/javascript/ql/test/library-tests/Functions/ReturnStmt.qll @@ -0,0 +1,3 @@ +import javascript + +query predicate test_ReturnStmt(Function f, ReturnStmt res) { res = f.getAReturnStmt() } diff --git a/javascript/ql/test/library-tests/Functions/ReturnedExpression.expected b/javascript/ql/test/library-tests/Functions/ReturnedExpression.expected deleted file mode 100644 index b4ead7936b13..000000000000 --- a/javascript/ql/test/library-tests/Functions/ReturnedExpression.expected +++ /dev/null @@ -1,4 +0,0 @@ -| arrowfns.js:1:24:1:36 | s => s.length | arrowfns.js:1:29:1:36 | s.length | -| arrowfns.js:2:13:2:23 | () => ++cnt | arrowfns.js:2:19:2:23 | ++cnt | -| exprclosures.js:1:7:1:21 | function(x) x+1 | exprclosures.js:1:19:1:21 | x+1 | -| tst.js:14:1:14:37 | functio ... s[0]; } | tst.js:14:23:14:34 | arguments[0] | \ No newline at end of file diff --git a/javascript/ql/test/library-tests/Functions/ReturnedExpression.ql b/javascript/ql/test/library-tests/Functions/ReturnedExpression.ql deleted file mode 100644 index f662de4b8081..000000000000 --- a/javascript/ql/test/library-tests/Functions/ReturnedExpression.ql +++ /dev/null @@ -1,4 +0,0 @@ -import javascript - -from Function f -select f, f.getAReturnedExpr() diff --git a/javascript/ql/test/library-tests/Functions/ReturnedExpression.qll b/javascript/ql/test/library-tests/Functions/ReturnedExpression.qll new file mode 100644 index 000000000000..87abf54c290a --- /dev/null +++ b/javascript/ql/test/library-tests/Functions/ReturnedExpression.qll @@ -0,0 +1,3 @@ +import javascript + +query predicate test_ReturnedExpression(Function f, Expr res) { res = f.getAReturnedExpr() } diff --git a/javascript/ql/test/library-tests/Functions/getArgumentsVariable.expected b/javascript/ql/test/library-tests/Functions/getArgumentsVariable.expected deleted file mode 100644 index 0c7a57c0aa9d..000000000000 --- a/javascript/ql/test/library-tests/Functions/getArgumentsVariable.expected +++ /dev/null @@ -1,17 +0,0 @@ -| defaultargs.js:1:1:1:24 | functio ... +19) {} | -| exprclosures.js:1:7:1:21 | function(x) x+1 | -| generators.js:1:1:4:1 | functio ... i++;\\n} | -| generators.js:6:2:6:19 | function* bar() {} | -| restparms.js:1:1:2:1 | functio ... ys) {\\n} | -| tst.js:1:1:1:15 | function A() {} | -| tst.js:2:1:2:16 | function B(x) {} | -| tst.js:3:1:3:19 | function C(x, y) {} | -| tst.js:4:9:4:21 | function() {} | -| tst.js:5:2:5:15 | function(x) {} | -| tst.js:6:2:6:18 | function(x, y) {} | -| tst.js:7:9:7:23 | function h() {} | -| tst.js:9:1:9:24 | functio ... nts) {} | -| tst.js:10:1:10:31 | functio ... ents; } | -| tst.js:11:1:11:35 | functio ... ts; } } | -| tst.js:12:1:12:44 | functio ... s) {} } | -| tst.js:14:1:14:37 | functio ... s[0]; } | diff --git a/javascript/ql/test/library-tests/Functions/getArgumentsVariable.ql b/javascript/ql/test/library-tests/Functions/getArgumentsVariable.ql deleted file mode 100644 index b092b47825ea..000000000000 --- a/javascript/ql/test/library-tests/Functions/getArgumentsVariable.ql +++ /dev/null @@ -1,5 +0,0 @@ -import javascript - -from Function f -where exists(f.getArgumentsVariable()) -select f diff --git a/javascript/ql/test/library-tests/Functions/getArgumentsVariable.qll b/javascript/ql/test/library-tests/Functions/getArgumentsVariable.qll new file mode 100644 index 000000000000..23ec488340fb --- /dev/null +++ b/javascript/ql/test/library-tests/Functions/getArgumentsVariable.qll @@ -0,0 +1,3 @@ +import javascript + +query predicate test_getArgumentsVariable(Function f) { exists(f.getArgumentsVariable()) } diff --git a/javascript/ql/test/library-tests/Functions/getBody.expected b/javascript/ql/test/library-tests/Functions/getBody.expected deleted file mode 100644 index fd714ebc0998..000000000000 --- a/javascript/ql/test/library-tests/Functions/getBody.expected +++ /dev/null @@ -1,20 +0,0 @@ -| arrowfns.js:1:24:1:36 | s => s.length | arrowfns.js:1:29:1:36 | s.length | -| arrowfns.js:2:13:2:23 | () => ++cnt | arrowfns.js:2:19:2:23 | ++cnt | -| arrowfns.js:3:12:3:41 | () => { ... "); ; } | arrowfns.js:3:18:3:41 | { alert ... "); ; } | -| defaultargs.js:1:1:1:24 | functio ... +19) {} | defaultargs.js:1:23:1:24 | {} | -| exprclosures.js:1:7:1:21 | function(x) x+1 | exprclosures.js:1:19:1:21 | x+1 | -| generators.js:1:1:4:1 | functio ... i++;\\n} | generators.js:1:16:4:1 | {\\n for ... i++;\\n} | -| generators.js:6:2:6:19 | function* bar() {} | generators.js:6:18:6:19 | {} | -| restparms.js:1:1:2:1 | functio ... ys) {\\n} | restparms.js:1:22:2:1 | {\\n} | -| tst.js:1:1:1:15 | function A() {} | tst.js:1:14:1:15 | {} | -| tst.js:2:1:2:16 | function B(x) {} | tst.js:2:15:2:16 | {} | -| tst.js:3:1:3:19 | function C(x, y) {} | tst.js:3:18:3:19 | {} | -| tst.js:4:9:4:21 | function() {} | tst.js:4:20:4:21 | {} | -| tst.js:5:2:5:15 | function(x) {} | tst.js:5:14:5:15 | {} | -| tst.js:6:2:6:18 | function(x, y) {} | tst.js:6:17:6:18 | {} | -| tst.js:7:9:7:23 | function h() {} | tst.js:7:22:7:23 | {} | -| tst.js:9:1:9:24 | functio ... nts) {} | tst.js:9:23:9:24 | {} | -| tst.js:10:1:10:31 | functio ... ents; } | tst.js:10:14:10:31 | { var arguments; } | -| tst.js:11:1:11:35 | functio ... ts; } } | tst.js:11:14:11:35 | { { var ... ts; } } | -| tst.js:12:1:12:44 | functio ... s) {} } | tst.js:12:14:12:44 | { try { ... s) {} } | -| tst.js:14:1:14:37 | functio ... s[0]; } | tst.js:14:14:14:37 | { retur ... s[0]; } | diff --git a/javascript/ql/test/library-tests/Functions/getBody.ql b/javascript/ql/test/library-tests/Functions/getBody.ql deleted file mode 100644 index 3f807b4f61ff..000000000000 --- a/javascript/ql/test/library-tests/Functions/getBody.ql +++ /dev/null @@ -1,4 +0,0 @@ -import javascript - -from Function f -select f, f.getBody() diff --git a/javascript/ql/test/library-tests/Functions/getBody.qll b/javascript/ql/test/library-tests/Functions/getBody.qll new file mode 100644 index 000000000000..835100c132d7 --- /dev/null +++ b/javascript/ql/test/library-tests/Functions/getBody.qll @@ -0,0 +1,3 @@ +import javascript + +query predicate test_getBody(Function f, ExprOrStmt res) { res = f.getBody() } diff --git a/javascript/ql/test/library-tests/Functions/getBodyStmt.expected b/javascript/ql/test/library-tests/Functions/getBodyStmt.expected deleted file mode 100644 index 9d316f35cc57..000000000000 --- a/javascript/ql/test/library-tests/Functions/getBodyStmt.expected +++ /dev/null @@ -1,7 +0,0 @@ -| arrowfns.js:3:12:3:41 | () => { ... "); ; } | 0 | arrowfns.js:3:20:3:37 | alert("Wake up!"); | -| arrowfns.js:3:12:3:41 | () => { ... "); ; } | 1 | arrowfns.js:3:39:3:39 | ; | -| generators.js:1:1:4:1 | functio ... i++;\\n} | 0 | generators.js:2:3:3:14 | for (va ... ld i++; | -| tst.js:10:1:10:31 | functio ... ents; } | 0 | tst.js:10:16:10:29 | var arguments; | -| tst.js:11:1:11:35 | functio ... ts; } } | 0 | tst.js:11:16:11:33 | { var arguments; } | -| tst.js:12:1:12:44 | functio ... s) {} } | 0 | tst.js:12:16:12:42 | try { } ... nts) {} | -| tst.js:14:1:14:37 | functio ... s[0]; } | 0 | tst.js:14:16:14:35 | return arguments[0]; | diff --git a/javascript/ql/test/library-tests/Functions/getBodyStmt.ql b/javascript/ql/test/library-tests/Functions/getBodyStmt.ql deleted file mode 100644 index bf5c65aa011d..000000000000 --- a/javascript/ql/test/library-tests/Functions/getBodyStmt.ql +++ /dev/null @@ -1,4 +0,0 @@ -import javascript - -from Function f, int i -select f, i, f.getBodyStmt(i) diff --git a/javascript/ql/test/library-tests/Functions/getBodyStmt.qll b/javascript/ql/test/library-tests/Functions/getBodyStmt.qll new file mode 100644 index 000000000000..33df6a2dd6fc --- /dev/null +++ b/javascript/ql/test/library-tests/Functions/getBodyStmt.qll @@ -0,0 +1,3 @@ +import javascript + +query predicate test_getBodyStmt(Function f, int i, Stmt res) { res = f.getBodyStmt(i) } diff --git a/javascript/ql/test/library-tests/Functions/getDefaultArguments.expected b/javascript/ql/test/library-tests/Functions/getDefaultArguments.expected deleted file mode 100644 index 8f6b18768bc8..000000000000 --- a/javascript/ql/test/library-tests/Functions/getDefaultArguments.expected +++ /dev/null @@ -1 +0,0 @@ -| defaultargs.js:1:15:1:15 | y | defaultargs.js:1:17:1:20 | x+19 | diff --git a/javascript/ql/test/library-tests/Functions/getDefaultArguments.ql b/javascript/ql/test/library-tests/Functions/getDefaultArguments.ql deleted file mode 100644 index 7371235b0b28..000000000000 --- a/javascript/ql/test/library-tests/Functions/getDefaultArguments.ql +++ /dev/null @@ -1,4 +0,0 @@ -import javascript - -from Parameter p -select p, p.getDefault() diff --git a/javascript/ql/test/library-tests/Functions/getDefaultArguments.qll b/javascript/ql/test/library-tests/Functions/getDefaultArguments.qll new file mode 100644 index 000000000000..2466c14f95d0 --- /dev/null +++ b/javascript/ql/test/library-tests/Functions/getDefaultArguments.qll @@ -0,0 +1,3 @@ +import javascript + +query predicate test_getDefaultArguments(Parameter p, Expr res) { res = p.getDefault() } diff --git a/javascript/ql/test/library-tests/Functions/getEnclosingStmt.expected b/javascript/ql/test/library-tests/Functions/getEnclosingStmt.expected deleted file mode 100644 index fe83706b2aa1..000000000000 --- a/javascript/ql/test/library-tests/Functions/getEnclosingStmt.expected +++ /dev/null @@ -1,20 +0,0 @@ -| arrowfns.js:1:24:1:36 | s => s.length | arrowfns.js:1:1:1:38 | ["a", " ... ength); | -| arrowfns.js:2:13:2:23 | () => ++cnt | arrowfns.js:2:1:2:31 | setInte ... 1000); | -| arrowfns.js:3:12:3:41 | () => { ... "); ; } | arrowfns.js:3:1:3:50 | setTime ... 60000); | -| defaultargs.js:1:1:1:24 | functio ... +19) {} | defaultargs.js:1:1:1:24 | functio ... +19) {} | -| exprclosures.js:1:7:1:21 | function(x) x+1 | exprclosures.js:1:1:1:23 | a.map(f ... ) x+1); | -| generators.js:1:1:4:1 | functio ... i++;\\n} | generators.js:1:1:4:1 | functio ... i++;\\n} | -| generators.js:6:2:6:19 | function* bar() {} | generators.js:6:1:6:23 | (functi ... {})(); | -| restparms.js:1:1:2:1 | functio ... ys) {\\n} | restparms.js:1:1:2:1 | functio ... ys) {\\n} | -| tst.js:1:1:1:15 | function A() {} | tst.js:1:1:1:15 | function A() {} | -| tst.js:2:1:2:16 | function B(x) {} | tst.js:2:1:2:16 | function B(x) {} | -| tst.js:3:1:3:19 | function C(x, y) {} | tst.js:3:1:3:19 | function C(x, y) {} | -| tst.js:4:9:4:21 | function() {} | tst.js:4:1:4:22 | var f = ... n() {}; | -| tst.js:5:2:5:15 | function(x) {} | tst.js:5:1:5:16 | !function(x) {}; | -| tst.js:6:2:6:18 | function(x, y) {} | tst.js:6:1:6:20 | (function(x, y) {}); | -| tst.js:7:9:7:23 | function h() {} | tst.js:7:1:7:24 | var g = ... h() {}; | -| tst.js:9:1:9:24 | functio ... nts) {} | tst.js:9:1:9:24 | functio ... nts) {} | -| tst.js:10:1:10:31 | functio ... ents; } | tst.js:10:1:10:31 | functio ... ents; } | -| tst.js:11:1:11:35 | functio ... ts; } } | tst.js:11:1:11:35 | functio ... ts; } } | -| tst.js:12:1:12:44 | functio ... s) {} } | tst.js:12:1:12:44 | functio ... s) {} } | -| tst.js:14:1:14:37 | functio ... s[0]; } | tst.js:14:1:14:37 | functio ... s[0]; } | diff --git a/javascript/ql/test/library-tests/Functions/getEnclosingStmt.ql b/javascript/ql/test/library-tests/Functions/getEnclosingStmt.ql deleted file mode 100644 index ea1fc282542d..000000000000 --- a/javascript/ql/test/library-tests/Functions/getEnclosingStmt.ql +++ /dev/null @@ -1,4 +0,0 @@ -import javascript - -from Function f -select f, f.getEnclosingStmt() diff --git a/javascript/ql/test/library-tests/Functions/getEnclosingStmt.qll b/javascript/ql/test/library-tests/Functions/getEnclosingStmt.qll new file mode 100644 index 000000000000..b630d393d1bb --- /dev/null +++ b/javascript/ql/test/library-tests/Functions/getEnclosingStmt.qll @@ -0,0 +1,3 @@ +import javascript + +query predicate test_getEnclosingStmt(Function f, Stmt res) { res = f.getEnclosingStmt() } diff --git a/javascript/ql/test/library-tests/Functions/getId.expected b/javascript/ql/test/library-tests/Functions/getId.expected deleted file mode 100644 index 27e2f9c8af47..000000000000 --- a/javascript/ql/test/library-tests/Functions/getId.expected +++ /dev/null @@ -1,13 +0,0 @@ -| defaultargs.js:1:1:1:24 | functio ... +19) {} | defaultargs.js:1:10:1:10 | f | f | -| generators.js:1:1:4:1 | functio ... i++;\\n} | generators.js:1:11:1:13 | foo | foo | -| generators.js:6:2:6:19 | function* bar() {} | generators.js:6:12:6:14 | bar | bar | -| restparms.js:1:1:2:1 | functio ... ys) {\\n} | restparms.js:1:10:1:10 | r | r | -| tst.js:1:1:1:15 | function A() {} | tst.js:1:10:1:10 | A | A | -| tst.js:2:1:2:16 | function B(x) {} | tst.js:2:10:2:10 | B | B | -| tst.js:3:1:3:19 | function C(x, y) {} | tst.js:3:10:3:10 | C | C | -| tst.js:7:9:7:23 | function h() {} | tst.js:7:18:7:18 | h | h | -| tst.js:9:1:9:24 | functio ... nts) {} | tst.js:9:10:9:10 | k | k | -| tst.js:10:1:10:31 | functio ... ents; } | tst.js:10:10:10:10 | l | l | -| tst.js:11:1:11:35 | functio ... ts; } } | tst.js:11:10:11:10 | m | m | -| tst.js:12:1:12:44 | functio ... s) {} } | tst.js:12:10:12:10 | n | n | -| tst.js:14:1:14:37 | functio ... s[0]; } | tst.js:14:10:14:10 | p | p | diff --git a/javascript/ql/test/library-tests/Functions/getId.ql b/javascript/ql/test/library-tests/Functions/getId.ql deleted file mode 100644 index 1eb88cefb5d8..000000000000 --- a/javascript/ql/test/library-tests/Functions/getId.ql +++ /dev/null @@ -1,4 +0,0 @@ -import javascript - -from Function f -select f, f.getId(), f.getName() diff --git a/javascript/ql/test/library-tests/Functions/getId.qll b/javascript/ql/test/library-tests/Functions/getId.qll new file mode 100644 index 000000000000..990b76ec01e0 --- /dev/null +++ b/javascript/ql/test/library-tests/Functions/getId.qll @@ -0,0 +1,5 @@ +import javascript + +query predicate test_getId(Function f, VarDecl res0, string res1) { + res0 = f.getId() and res1 = f.getName() +} diff --git a/javascript/ql/test/library-tests/Functions/getParameter.expected b/javascript/ql/test/library-tests/Functions/getParameter.expected deleted file mode 100644 index a49beda78c26..000000000000 --- a/javascript/ql/test/library-tests/Functions/getParameter.expected +++ /dev/null @@ -1,13 +0,0 @@ -| arrowfns.js:1:24:1:36 | s => s.length | 0 | arrowfns.js:1:24:1:24 | s | -| defaultargs.js:1:1:1:24 | functio ... +19) {} | 0 | defaultargs.js:1:12:1:12 | x | -| defaultargs.js:1:1:1:24 | functio ... +19) {} | 1 | defaultargs.js:1:15:1:15 | y | -| exprclosures.js:1:7:1:21 | function(x) x+1 | 0 | exprclosures.js:1:16:1:16 | x | -| restparms.js:1:1:2:1 | functio ... ys) {\\n} | 0 | restparms.js:1:12:1:12 | x | -| restparms.js:1:1:2:1 | functio ... ys) {\\n} | 1 | restparms.js:1:18:1:19 | ys | -| tst.js:2:1:2:16 | function B(x) {} | 0 | tst.js:2:12:2:12 | x | -| tst.js:3:1:3:19 | function C(x, y) {} | 0 | tst.js:3:12:3:12 | x | -| tst.js:3:1:3:19 | function C(x, y) {} | 1 | tst.js:3:15:3:15 | y | -| tst.js:5:2:5:15 | function(x) {} | 0 | tst.js:5:11:5:11 | x | -| tst.js:6:2:6:18 | function(x, y) {} | 0 | tst.js:6:11:6:11 | x | -| tst.js:6:2:6:18 | function(x, y) {} | 1 | tst.js:6:14:6:14 | y | -| tst.js:9:1:9:24 | functio ... nts) {} | 0 | tst.js:9:12:9:20 | arguments | diff --git a/javascript/ql/test/library-tests/Functions/getParameter.ql b/javascript/ql/test/library-tests/Functions/getParameter.ql deleted file mode 100644 index 3e29d2d64753..000000000000 --- a/javascript/ql/test/library-tests/Functions/getParameter.ql +++ /dev/null @@ -1,5 +0,0 @@ -import javascript - -from Function f, int i, Parameter p -where p = f.getParameter(i) -select f, i, p diff --git a/javascript/ql/test/library-tests/Functions/getParameter.qll b/javascript/ql/test/library-tests/Functions/getParameter.qll new file mode 100644 index 000000000000..0aca54eea7a0 --- /dev/null +++ b/javascript/ql/test/library-tests/Functions/getParameter.qll @@ -0,0 +1,3 @@ +import javascript + +query predicate test_getParameter(Function f, int i, Parameter p) { p = f.getParameter(i) } diff --git a/javascript/ql/test/library-tests/Functions/getScope.expected b/javascript/ql/test/library-tests/Functions/getScope.expected deleted file mode 100644 index 5e2d28b0c4ec..000000000000 --- a/javascript/ql/test/library-tests/Functions/getScope.expected +++ /dev/null @@ -1,20 +0,0 @@ -| arrowfns.js:1:24:1:36 | s => s.length | -| arrowfns.js:2:13:2:23 | () => ++cnt | -| arrowfns.js:3:12:3:41 | () => { ... "); ; } | -| defaultargs.js:1:1:1:24 | functio ... +19) {} | -| exprclosures.js:1:7:1:21 | function(x) x+1 | -| generators.js:1:1:4:1 | functio ... i++;\\n} | -| generators.js:6:2:6:19 | function* bar() {} | -| restparms.js:1:1:2:1 | functio ... ys) {\\n} | -| tst.js:1:1:1:15 | function A() {} | -| tst.js:2:1:2:16 | function B(x) {} | -| tst.js:3:1:3:19 | function C(x, y) {} | -| tst.js:4:9:4:21 | function() {} | -| tst.js:5:2:5:15 | function(x) {} | -| tst.js:6:2:6:18 | function(x, y) {} | -| tst.js:7:9:7:23 | function h() {} | -| tst.js:9:1:9:24 | functio ... nts) {} | -| tst.js:10:1:10:31 | functio ... ents; } | -| tst.js:11:1:11:35 | functio ... ts; } } | -| tst.js:12:1:12:44 | functio ... s) {} } | -| tst.js:14:1:14:37 | functio ... s[0]; } | diff --git a/javascript/ql/test/library-tests/Functions/getScope.ql b/javascript/ql/test/library-tests/Functions/getScope.ql deleted file mode 100644 index d8a3ba764aed..000000000000 --- a/javascript/ql/test/library-tests/Functions/getScope.ql +++ /dev/null @@ -1,5 +0,0 @@ -import javascript - -from Function f -where exists(f.getScope()) -select f diff --git a/javascript/ql/test/library-tests/Functions/getScope.qll b/javascript/ql/test/library-tests/Functions/getScope.qll new file mode 100644 index 000000000000..47db2ac6b276 --- /dev/null +++ b/javascript/ql/test/library-tests/Functions/getScope.qll @@ -0,0 +1,3 @@ +import javascript + +query predicate test_getScope(Function f) { exists(f.getScope()) } diff --git a/javascript/ql/test/library-tests/Functions/getVariable.expected b/javascript/ql/test/library-tests/Functions/getVariable.expected deleted file mode 100644 index dcb8b34f2924..000000000000 --- a/javascript/ql/test/library-tests/Functions/getVariable.expected +++ /dev/null @@ -1,13 +0,0 @@ -| defaultargs.js:1:1:1:24 | functio ... +19) {} | -| generators.js:1:1:4:1 | functio ... i++;\\n} | -| generators.js:6:2:6:19 | function* bar() {} | -| restparms.js:1:1:2:1 | functio ... ys) {\\n} | -| tst.js:1:1:1:15 | function A() {} | -| tst.js:2:1:2:16 | function B(x) {} | -| tst.js:3:1:3:19 | function C(x, y) {} | -| tst.js:7:9:7:23 | function h() {} | -| tst.js:9:1:9:24 | functio ... nts) {} | -| tst.js:10:1:10:31 | functio ... ents; } | -| tst.js:11:1:11:35 | functio ... ts; } } | -| tst.js:12:1:12:44 | functio ... s) {} } | -| tst.js:14:1:14:37 | functio ... s[0]; } | diff --git a/javascript/ql/test/library-tests/Functions/getVariable.ql b/javascript/ql/test/library-tests/Functions/getVariable.ql deleted file mode 100644 index d06a8a2bdb4f..000000000000 --- a/javascript/ql/test/library-tests/Functions/getVariable.ql +++ /dev/null @@ -1,5 +0,0 @@ -import javascript - -from Function f -where exists(f.getVariable()) -select f diff --git a/javascript/ql/test/library-tests/Functions/getVariable.qll b/javascript/ql/test/library-tests/Functions/getVariable.qll new file mode 100644 index 000000000000..0639bbbbed45 --- /dev/null +++ b/javascript/ql/test/library-tests/Functions/getVariable.qll @@ -0,0 +1,3 @@ +import javascript + +query predicate test_getVariable(Function f) { exists(f.getVariable()) } diff --git a/javascript/ql/test/library-tests/Functions/hasRestParameter.expected b/javascript/ql/test/library-tests/Functions/hasRestParameter.expected deleted file mode 100644 index 5ea17e166739..000000000000 --- a/javascript/ql/test/library-tests/Functions/hasRestParameter.expected +++ /dev/null @@ -1 +0,0 @@ -| restparms.js:1:1:2:1 | functio ... ys) {\\n} | diff --git a/javascript/ql/test/library-tests/Functions/hasRestParameter.ql b/javascript/ql/test/library-tests/Functions/hasRestParameter.ql deleted file mode 100644 index 8da25b57fb1e..000000000000 --- a/javascript/ql/test/library-tests/Functions/hasRestParameter.ql +++ /dev/null @@ -1,5 +0,0 @@ -import javascript - -from Function f -where f.hasRestParameter() -select f diff --git a/javascript/ql/test/library-tests/Functions/hasRestParameter.qll b/javascript/ql/test/library-tests/Functions/hasRestParameter.qll new file mode 100644 index 000000000000..880acbba4cbc --- /dev/null +++ b/javascript/ql/test/library-tests/Functions/hasRestParameter.qll @@ -0,0 +1,3 @@ +import javascript + +query predicate test_hasRestParameter(Function f) { f.hasRestParameter() } diff --git a/javascript/ql/test/library-tests/Functions/isGenerator.expected b/javascript/ql/test/library-tests/Functions/isGenerator.expected deleted file mode 100644 index 65ccaa2b15a1..000000000000 --- a/javascript/ql/test/library-tests/Functions/isGenerator.expected +++ /dev/null @@ -1,2 +0,0 @@ -| generators.js:1:1:4:1 | functio ... i++;\\n} | -| generators.js:6:2:6:19 | function* bar() {} | diff --git a/javascript/ql/test/library-tests/Functions/isGenerator.ql b/javascript/ql/test/library-tests/Functions/isGenerator.ql deleted file mode 100644 index 9b10a7c48efb..000000000000 --- a/javascript/ql/test/library-tests/Functions/isGenerator.ql +++ /dev/null @@ -1,5 +0,0 @@ -import javascript - -from Function f -where f.isGenerator() -select f diff --git a/javascript/ql/test/library-tests/Functions/isGenerator.qll b/javascript/ql/test/library-tests/Functions/isGenerator.qll new file mode 100644 index 000000000000..44cb00f8d124 --- /dev/null +++ b/javascript/ql/test/library-tests/Functions/isGenerator.qll @@ -0,0 +1,3 @@ +import javascript + +query predicate test_isGenerator(Function f) { f.isGenerator() } diff --git a/javascript/ql/test/library-tests/Functions/isRestParameter.expected b/javascript/ql/test/library-tests/Functions/isRestParameter.expected deleted file mode 100644 index b9512061930d..000000000000 --- a/javascript/ql/test/library-tests/Functions/isRestParameter.expected +++ /dev/null @@ -1 +0,0 @@ -| restparms.js:1:18:1:19 | ys | diff --git a/javascript/ql/test/library-tests/Functions/isRestParameter.ql b/javascript/ql/test/library-tests/Functions/isRestParameter.ql deleted file mode 100644 index a1b2a1cec7eb..000000000000 --- a/javascript/ql/test/library-tests/Functions/isRestParameter.ql +++ /dev/null @@ -1,5 +0,0 @@ -import javascript - -from Parameter p -where p.isRestParameter() -select p diff --git a/javascript/ql/test/library-tests/Functions/isRestParameter.qll b/javascript/ql/test/library-tests/Functions/isRestParameter.qll new file mode 100644 index 000000000000..b26f84457939 --- /dev/null +++ b/javascript/ql/test/library-tests/Functions/isRestParameter.qll @@ -0,0 +1,3 @@ +import javascript + +query predicate test_isRestParameter(Parameter p) { p.isRestParameter() } diff --git a/javascript/ql/test/library-tests/Functions/tests.expected b/javascript/ql/test/library-tests/Functions/tests.expected new file mode 100644 index 000000000000..4161a7fa296f --- /dev/null +++ b/javascript/ql/test/library-tests/Functions/tests.expected @@ -0,0 +1,170 @@ +test_getVariable +| defaultargs.js:1:1:1:24 | functio ... +19) {} | +| generators.js:1:1:4:1 | functio ... i++;\\n} | +| generators.js:6:2:6:19 | function* bar() {} | +| restparms.js:1:1:2:1 | functio ... ys) {\\n} | +| tst.js:1:1:1:15 | function A() {} | +| tst.js:2:1:2:16 | function B(x) {} | +| tst.js:3:1:3:19 | function C(x, y) {} | +| tst.js:7:9:7:23 | function h() {} | +| tst.js:9:1:9:24 | functio ... nts) {} | +| tst.js:10:1:10:31 | functio ... ents; } | +| tst.js:11:1:11:35 | functio ... ts; } } | +| tst.js:12:1:12:44 | functio ... s) {} } | +| tst.js:14:1:14:37 | functio ... s[0]; } | +test_getScope +| arrowfns.js:1:24:1:36 | s => s.length | +| arrowfns.js:2:13:2:23 | () => ++cnt | +| arrowfns.js:3:12:3:41 | () => { ... "); ; } | +| defaultargs.js:1:1:1:24 | functio ... +19) {} | +| exprclosures.js:1:7:1:21 | function(x) x+1 | +| generators.js:1:1:4:1 | functio ... i++;\\n} | +| generators.js:6:2:6:19 | function* bar() {} | +| restparms.js:1:1:2:1 | functio ... ys) {\\n} | +| tst.js:1:1:1:15 | function A() {} | +| tst.js:2:1:2:16 | function B(x) {} | +| tst.js:3:1:3:19 | function C(x, y) {} | +| tst.js:4:9:4:21 | function() {} | +| tst.js:5:2:5:15 | function(x) {} | +| tst.js:6:2:6:18 | function(x, y) {} | +| tst.js:7:9:7:23 | function h() {} | +| tst.js:9:1:9:24 | functio ... nts) {} | +| tst.js:10:1:10:31 | functio ... ents; } | +| tst.js:11:1:11:35 | functio ... ts; } } | +| tst.js:12:1:12:44 | functio ... s) {} } | +| tst.js:14:1:14:37 | functio ... s[0]; } | +test_getParameter +| arrowfns.js:1:24:1:36 | s => s.length | 0 | arrowfns.js:1:24:1:24 | s | +| defaultargs.js:1:1:1:24 | functio ... +19) {} | 0 | defaultargs.js:1:12:1:12 | x | +| defaultargs.js:1:1:1:24 | functio ... +19) {} | 1 | defaultargs.js:1:15:1:15 | y | +| exprclosures.js:1:7:1:21 | function(x) x+1 | 0 | exprclosures.js:1:16:1:16 | x | +| restparms.js:1:1:2:1 | functio ... ys) {\\n} | 0 | restparms.js:1:12:1:12 | x | +| restparms.js:1:1:2:1 | functio ... ys) {\\n} | 1 | restparms.js:1:18:1:19 | ys | +| tst.js:2:1:2:16 | function B(x) {} | 0 | tst.js:2:12:2:12 | x | +| tst.js:3:1:3:19 | function C(x, y) {} | 0 | tst.js:3:12:3:12 | x | +| tst.js:3:1:3:19 | function C(x, y) {} | 1 | tst.js:3:15:3:15 | y | +| tst.js:5:2:5:15 | function(x) {} | 0 | tst.js:5:11:5:11 | x | +| tst.js:6:2:6:18 | function(x, y) {} | 0 | tst.js:6:11:6:11 | x | +| tst.js:6:2:6:18 | function(x, y) {} | 1 | tst.js:6:14:6:14 | y | +| tst.js:9:1:9:24 | functio ... nts) {} | 0 | tst.js:9:12:9:20 | arguments | +test_ReturnedExpression +| arrowfns.js:1:24:1:36 | s => s.length | arrowfns.js:1:29:1:36 | s.length | +| arrowfns.js:2:13:2:23 | () => ++cnt | arrowfns.js:2:19:2:23 | ++cnt | +| exprclosures.js:1:7:1:21 | function(x) x+1 | exprclosures.js:1:19:1:21 | x+1 | +| tst.js:14:1:14:37 | functio ... s[0]; } | tst.js:14:23:14:34 | arguments[0] | +test_getDefaultArguments +| defaultargs.js:1:15:1:15 | y | defaultargs.js:1:17:1:20 | x+19 | +test_Function +| arrowfns.js:1:24:1:36 | s => s.length | +| arrowfns.js:2:13:2:23 | () => ++cnt | +| arrowfns.js:3:12:3:41 | () => { ... "); ; } | +| defaultargs.js:1:1:1:24 | functio ... +19) {} | +| exprclosures.js:1:7:1:21 | function(x) x+1 | +| generators.js:1:1:4:1 | functio ... i++;\\n} | +| generators.js:6:2:6:19 | function* bar() {} | +| restparms.js:1:1:2:1 | functio ... ys) {\\n} | +| tst.js:1:1:1:15 | function A() {} | +| tst.js:2:1:2:16 | function B(x) {} | +| tst.js:3:1:3:19 | function C(x, y) {} | +| tst.js:4:9:4:21 | function() {} | +| tst.js:5:2:5:15 | function(x) {} | +| tst.js:6:2:6:18 | function(x, y) {} | +| tst.js:7:9:7:23 | function h() {} | +| tst.js:9:1:9:24 | functio ... nts) {} | +| tst.js:10:1:10:31 | functio ... ents; } | +| tst.js:11:1:11:35 | functio ... ts; } } | +| tst.js:12:1:12:44 | functio ... s) {} } | +| tst.js:14:1:14:37 | functio ... s[0]; } | +test_getBody +| arrowfns.js:1:24:1:36 | s => s.length | arrowfns.js:1:29:1:36 | s.length | +| arrowfns.js:2:13:2:23 | () => ++cnt | arrowfns.js:2:19:2:23 | ++cnt | +| arrowfns.js:3:12:3:41 | () => { ... "); ; } | arrowfns.js:3:18:3:41 | { alert ... "); ; } | +| defaultargs.js:1:1:1:24 | functio ... +19) {} | defaultargs.js:1:23:1:24 | {} | +| exprclosures.js:1:7:1:21 | function(x) x+1 | exprclosures.js:1:19:1:21 | x+1 | +| generators.js:1:1:4:1 | functio ... i++;\\n} | generators.js:1:16:4:1 | {\\n for ... i++;\\n} | +| generators.js:6:2:6:19 | function* bar() {} | generators.js:6:18:6:19 | {} | +| restparms.js:1:1:2:1 | functio ... ys) {\\n} | restparms.js:1:22:2:1 | {\\n} | +| tst.js:1:1:1:15 | function A() {} | tst.js:1:14:1:15 | {} | +| tst.js:2:1:2:16 | function B(x) {} | tst.js:2:15:2:16 | {} | +| tst.js:3:1:3:19 | function C(x, y) {} | tst.js:3:18:3:19 | {} | +| tst.js:4:9:4:21 | function() {} | tst.js:4:20:4:21 | {} | +| tst.js:5:2:5:15 | function(x) {} | tst.js:5:14:5:15 | {} | +| tst.js:6:2:6:18 | function(x, y) {} | tst.js:6:17:6:18 | {} | +| tst.js:7:9:7:23 | function h() {} | tst.js:7:22:7:23 | {} | +| tst.js:9:1:9:24 | functio ... nts) {} | tst.js:9:23:9:24 | {} | +| tst.js:10:1:10:31 | functio ... ents; } | tst.js:10:14:10:31 | { var arguments; } | +| tst.js:11:1:11:35 | functio ... ts; } } | tst.js:11:14:11:35 | { { var ... ts; } } | +| tst.js:12:1:12:44 | functio ... s) {} } | tst.js:12:14:12:44 | { try { ... s) {} } | +| tst.js:14:1:14:37 | functio ... s[0]; } | tst.js:14:14:14:37 | { retur ... s[0]; } | +test_getId +| defaultargs.js:1:1:1:24 | functio ... +19) {} | defaultargs.js:1:10:1:10 | f | f | +| generators.js:1:1:4:1 | functio ... i++;\\n} | generators.js:1:11:1:13 | foo | foo | +| generators.js:6:2:6:19 | function* bar() {} | generators.js:6:12:6:14 | bar | bar | +| restparms.js:1:1:2:1 | functio ... ys) {\\n} | restparms.js:1:10:1:10 | r | r | +| tst.js:1:1:1:15 | function A() {} | tst.js:1:10:1:10 | A | A | +| tst.js:2:1:2:16 | function B(x) {} | tst.js:2:10:2:10 | B | B | +| tst.js:3:1:3:19 | function C(x, y) {} | tst.js:3:10:3:10 | C | C | +| tst.js:7:9:7:23 | function h() {} | tst.js:7:18:7:18 | h | h | +| tst.js:9:1:9:24 | functio ... nts) {} | tst.js:9:10:9:10 | k | k | +| tst.js:10:1:10:31 | functio ... ents; } | tst.js:10:10:10:10 | l | l | +| tst.js:11:1:11:35 | functio ... ts; } } | tst.js:11:10:11:10 | m | m | +| tst.js:12:1:12:44 | functio ... s) {} } | tst.js:12:10:12:10 | n | n | +| tst.js:14:1:14:37 | functio ... s[0]; } | tst.js:14:10:14:10 | p | p | +test_hasRestParameter +| restparms.js:1:1:2:1 | functio ... ys) {\\n} | +test_getArgumentsVariable +| defaultargs.js:1:1:1:24 | functio ... +19) {} | +| exprclosures.js:1:7:1:21 | function(x) x+1 | +| generators.js:1:1:4:1 | functio ... i++;\\n} | +| generators.js:6:2:6:19 | function* bar() {} | +| restparms.js:1:1:2:1 | functio ... ys) {\\n} | +| tst.js:1:1:1:15 | function A() {} | +| tst.js:2:1:2:16 | function B(x) {} | +| tst.js:3:1:3:19 | function C(x, y) {} | +| tst.js:4:9:4:21 | function() {} | +| tst.js:5:2:5:15 | function(x) {} | +| tst.js:6:2:6:18 | function(x, y) {} | +| tst.js:7:9:7:23 | function h() {} | +| tst.js:9:1:9:24 | functio ... nts) {} | +| tst.js:10:1:10:31 | functio ... ents; } | +| tst.js:11:1:11:35 | functio ... ts; } } | +| tst.js:12:1:12:44 | functio ... s) {} } | +| tst.js:14:1:14:37 | functio ... s[0]; } | +test_getBodyStmt +| arrowfns.js:3:12:3:41 | () => { ... "); ; } | 0 | arrowfns.js:3:20:3:37 | alert("Wake up!"); | +| arrowfns.js:3:12:3:41 | () => { ... "); ; } | 1 | arrowfns.js:3:39:3:39 | ; | +| generators.js:1:1:4:1 | functio ... i++;\\n} | 0 | generators.js:2:3:3:14 | for (va ... ld i++; | +| tst.js:10:1:10:31 | functio ... ents; } | 0 | tst.js:10:16:10:29 | var arguments; | +| tst.js:11:1:11:35 | functio ... ts; } } | 0 | tst.js:11:16:11:33 | { var arguments; } | +| tst.js:12:1:12:44 | functio ... s) {} } | 0 | tst.js:12:16:12:42 | try { } ... nts) {} | +| tst.js:14:1:14:37 | functio ... s[0]; } | 0 | tst.js:14:16:14:35 | return arguments[0]; | +test_isGenerator +| generators.js:1:1:4:1 | functio ... i++;\\n} | +| generators.js:6:2:6:19 | function* bar() {} | +test_usesArgumentsObject +| tst.js:14:1:14:37 | functio ... s[0]; } | +test_getEnclosingStmt +| arrowfns.js:1:24:1:36 | s => s.length | arrowfns.js:1:1:1:38 | ["a", " ... ength); | +| arrowfns.js:2:13:2:23 | () => ++cnt | arrowfns.js:2:1:2:31 | setInte ... 1000); | +| arrowfns.js:3:12:3:41 | () => { ... "); ; } | arrowfns.js:3:1:3:50 | setTime ... 60000); | +| defaultargs.js:1:1:1:24 | functio ... +19) {} | defaultargs.js:1:1:1:24 | functio ... +19) {} | +| exprclosures.js:1:7:1:21 | function(x) x+1 | exprclosures.js:1:1:1:23 | a.map(f ... ) x+1); | +| generators.js:1:1:4:1 | functio ... i++;\\n} | generators.js:1:1:4:1 | functio ... i++;\\n} | +| generators.js:6:2:6:19 | function* bar() {} | generators.js:6:1:6:23 | (functi ... {})(); | +| restparms.js:1:1:2:1 | functio ... ys) {\\n} | restparms.js:1:1:2:1 | functio ... ys) {\\n} | +| tst.js:1:1:1:15 | function A() {} | tst.js:1:1:1:15 | function A() {} | +| tst.js:2:1:2:16 | function B(x) {} | tst.js:2:1:2:16 | function B(x) {} | +| tst.js:3:1:3:19 | function C(x, y) {} | tst.js:3:1:3:19 | function C(x, y) {} | +| tst.js:4:9:4:21 | function() {} | tst.js:4:1:4:22 | var f = ... n() {}; | +| tst.js:5:2:5:15 | function(x) {} | tst.js:5:1:5:16 | !function(x) {}; | +| tst.js:6:2:6:18 | function(x, y) {} | tst.js:6:1:6:20 | (function(x, y) {}); | +| tst.js:7:9:7:23 | function h() {} | tst.js:7:1:7:24 | var g = ... h() {}; | +| tst.js:9:1:9:24 | functio ... nts) {} | tst.js:9:1:9:24 | functio ... nts) {} | +| tst.js:10:1:10:31 | functio ... ents; } | tst.js:10:1:10:31 | functio ... ents; } | +| tst.js:11:1:11:35 | functio ... ts; } } | tst.js:11:1:11:35 | functio ... ts; } } | +| tst.js:12:1:12:44 | functio ... s) {} } | tst.js:12:1:12:44 | functio ... s) {} } | +| tst.js:14:1:14:37 | functio ... s[0]; } | tst.js:14:1:14:37 | functio ... s[0]; } | +test_isRestParameter +| restparms.js:1:18:1:19 | ys | +test_ReturnStmt +| tst.js:14:1:14:37 | functio ... s[0]; } | tst.js:14:16:14:35 | return arguments[0]; | diff --git a/javascript/ql/test/library-tests/Functions/tests.ql b/javascript/ql/test/library-tests/Functions/tests.ql new file mode 100644 index 000000000000..5a19806cd37d --- /dev/null +++ b/javascript/ql/test/library-tests/Functions/tests.ql @@ -0,0 +1,16 @@ +import getVariable +import getScope +import getParameter +import ReturnedExpression +import getDefaultArguments +import Function +import getBody +import getId +import hasRestParameter +import getArgumentsVariable +import getBodyStmt +import isGenerator +import usesArgumentsObject +import getEnclosingStmt +import isRestParameter +import ReturnStmt diff --git a/javascript/ql/test/library-tests/Functions/usesArgumentsObject.expected b/javascript/ql/test/library-tests/Functions/usesArgumentsObject.expected deleted file mode 100644 index 95025be93460..000000000000 --- a/javascript/ql/test/library-tests/Functions/usesArgumentsObject.expected +++ /dev/null @@ -1 +0,0 @@ -| tst.js:14:1:14:37 | functio ... s[0]; } | \ No newline at end of file diff --git a/javascript/ql/test/library-tests/Functions/usesArgumentsObject.ql b/javascript/ql/test/library-tests/Functions/usesArgumentsObject.ql deleted file mode 100644 index 908716e3f207..000000000000 --- a/javascript/ql/test/library-tests/Functions/usesArgumentsObject.ql +++ /dev/null @@ -1,5 +0,0 @@ -import javascript - -from Function f -where f.usesArgumentsObject() -select f diff --git a/javascript/ql/test/library-tests/Functions/usesArgumentsObject.qll b/javascript/ql/test/library-tests/Functions/usesArgumentsObject.qll new file mode 100644 index 000000000000..2aa6df596b42 --- /dev/null +++ b/javascript/ql/test/library-tests/Functions/usesArgumentsObject.qll @@ -0,0 +1,3 @@ +import javascript + +query predicate test_usesArgumentsObject(Function f) { f.usesArgumentsObject() } diff --git a/javascript/ql/test/library-tests/JSDoc/AssignExpr_getDocumentation.expected b/javascript/ql/test/library-tests/JSDoc/AssignExpr_getDocumentation.expected deleted file mode 100644 index 53e122c50798..000000000000 --- a/javascript/ql/test/library-tests/JSDoc/AssignExpr_getDocumentation.expected +++ /dev/null @@ -1,31 +0,0 @@ -| tst.js:12:1:12:29 | mynames ... 'stout' | tst.js:7:1:11:3 | /**\\n * ... ng}\\n */ | -| tst.js:14:15:14:39 | MyClass ... 'stout' | tst.js:14:1:14:13 | /** @const */ | -| tst.js:27:1:27:32 | goog.us ... = false | tst.js:26:1:26:24 | /** @de ... ean} */ | -| tst.js:36:1:37:1 | BN_Edit ... de) {\\n} | tst.js:29:1:35:3 | /**\\n * ... ().\\n */ | -| tst.js:55:1:59:1 | project ... BE: 0\\n} | tst.js:51:1:54:3 | /**\\n * ... er}\\n */ | -| tst.js:62:1:63:1 | foo.MyP ... n() {\\n} | tst.js:61:1:61:14 | /** @export */ | -| tst.js:70:1:71:1 | goog.ds ... n() {\\n} | tst.js:65:1:69:3 | /**\\n * ... st}\\n */ | -| tst.js:78:1:78:35 | sloth.M ... n() { } | tst.js:73:1:77:3 | /**\\n * ... tor\\n */ | -| tst.js:84:1:84:52 | sloth.M ... n() { } | tst.js:80:1:83:3 | /**\\n * ... nal\\n */ | -| tst.js:104:1:105:1 | project ... n() {\\n} | tst.js:101:1:103:17 | /**\\n * ... tDoc */ | -| tst.js:137:1:138:1 | goog.ne ... n() {\\n} | tst.js:131:1:136:3 | /**\\n * ... age\\n */ | -| tst.js:146:1:147:1 | goog.Ba ... rm) {\\n} | tst.js:140:1:145:3 | /**\\n * ... ng.\\n */ | -| tst.js:158:1:158:19 | this.handlers_ = [] | tst.js:153:1:157:3 | /**\\n * ... ate\\n */ | -| tst.js:166:1:167:1 | goog.ui ... nt) {\\n} | tst.js:160:1:165:3 | /**\\n * ... ted\\n */ | -| tst.js:173:1:175:1 | goog.Ba ... n id;\\n} | tst.js:169:1:172:3 | /**\\n * ... ID.\\n */ | -| tst.js:208:1:208:56 | DOMAppl ... n() { } | tst.js:205:1:207:3 | /**\\n * ... on}\\n */ | -| tst.js:220:1:221:1 | goog.re ... (x) {\\n} | tst.js:219:1:219:55 | /** @pa ... ing. */ | -| tst.js:253:1:253:53 | Foo.pro ... alue; } | tst.js:252:1:252:18 | /** @return {T} */ | -| tst.js:256:1:256:51 | Foo.pro ... = t; } | tst.js:255:1:255:19 | /** @param {T} t */ | -| tst.js:266:1:266:21 | Bar = f ... (t) { } | tst.js:261:1:265:3 | /**\\n * ... e T\\n */ | -| tst.js:280:1:280:18 | X = function() { } | tst.js:277:1:279:3 | /**\\n * ... tor\\n */ | -| tst.js:286:1:286:18 | Y = function() { } | tst.js:282:1:285:3 | /**\\n * ... tor\\n */ | -| tst.js:295:1:295:30 | takesFo ... oY) { } | tst.js:294:1:294:28 | /** @pa ... fooY */ | -| tst.js:304:1:304:18 | A = function() { } | tst.js:300:1:303:3 | /**\\n * ... e T\\n */ | -| tst.js:307:1:307:36 | A.proto ... (t) { } | tst.js:306:1:306:19 | /** @param {T} t */ | -| tst.js:313:1:313:18 | B = function() { } | tst.js:309:1:312:3 | /**\\n * ... g>}\\n */ | -| tst.js:320:1:320:18 | C = function() { } | tst.js:315:1:319:3 | /**\\n * ... U>}\\n */ | -| tst.js:326:1:326:19 | Foo = function() {} | tst.js:322:1:325:3 | /**\\n * ... e T\\n */ | -| tst.js:329:1:329:33 | Foo.pro ... on() {} | tst.js:328:1:328:18 | /** @return {T} */ | -| tst.js:336:1:336:24 | FooImpl ... n() { } | tst.js:331:1:335:3 | /**\\n * ... r>}\\n */ | -| tst.js:343:1:343:36 | identit ... rn a; } | tst.js:338:1:342:3 | /**\\n * ... e T\\n */ | diff --git a/javascript/ql/test/library-tests/JSDoc/AssignExpr_getDocumentation.ql b/javascript/ql/test/library-tests/JSDoc/AssignExpr_getDocumentation.ql deleted file mode 100644 index fabab0ad681f..000000000000 --- a/javascript/ql/test/library-tests/JSDoc/AssignExpr_getDocumentation.ql +++ /dev/null @@ -1,4 +0,0 @@ -import javascript - -from AssignExpr assgn -select assgn, assgn.getDocumentation() diff --git a/javascript/ql/test/library-tests/JSDoc/AssignExpr_getDocumentation.qll b/javascript/ql/test/library-tests/JSDoc/AssignExpr_getDocumentation.qll new file mode 100644 index 000000000000..15919d8530d6 --- /dev/null +++ b/javascript/ql/test/library-tests/JSDoc/AssignExpr_getDocumentation.qll @@ -0,0 +1,5 @@ +import javascript + +query predicate test_AssignExpr_getDocumentation(AssignExpr assgn, JSDoc res) { + res = assgn.getDocumentation() +} diff --git a/javascript/ql/test/library-tests/JSDoc/Function_getDocumentation.expected b/javascript/ql/test/library-tests/JSDoc/Function_getDocumentation.expected deleted file mode 100644 index e5670899761f..000000000000 --- a/javascript/ql/test/library-tests/JSDoc/Function_getDocumentation.expected +++ /dev/null @@ -1,43 +0,0 @@ -| tst.js:20:1:21:1 | functio ... t() {\\n} | tst.js:16:1:19:3 | /**\\n * ... tor\\n */ | -| tst.js:36:34:37:1 | function(node) {\\n} | tst.js:29:1:35:3 | /**\\n * ... ().\\n */ | -| tst.js:43:1:43:17 | function Foo() {} | tst.js:39:1:42:3 | /**\\n * ... ict\\n */ | -| tst.js:62:46:63:1 | function() {\\n} | tst.js:61:1:61:14 | /** @export */ | -| tst.js:70:25:71:1 | function() {\\n} | tst.js:65:1:69:3 | /**\\n * ... st}\\n */ | -| tst.js:78:22:78:35 | function() { } | tst.js:73:1:77:3 | /**\\n * ... tor\\n */ | -| tst.js:84:39:84:52 | function() { } | tst.js:80:1:83:3 | /**\\n * ... nal\\n */ | -| tst.js:90:1:90:19 | function Shape() {} | tst.js:86:1:89:3 | /**\\n * ... ace\\n */ | -| tst.js:97:1:97:20 | function Square() {} | tst.js:93:1:96:3 | /**\\n * ... pe}\\n */ | -| tst.js:104:39:105:1 | function() {\\n} | tst.js:101:1:103:17 | /**\\n * ... tDoc */ | -| tst.js:112:1:112:21 | functio ... on() {} | tst.js:107:1:111:3 | /**\\n * ... pe}\\n */ | -| tst.js:129:1:129:42 | functio ... n 42; } | tst.js:121:1:126:3 | /**\\n * ... sh:\\n */ | -| tst.js:129:1:129:42 | functio ... n 42; } | tst.js:128:1:128:21 | /** @no ... ects */ | -| tst.js:137:63:138:1 | function() {\\n} | tst.js:131:1:136:3 | /**\\n * ... age\\n */ | -| tst.js:146:28:147:1 | functio ... rm) {\\n} | tst.js:140:1:145:3 | /**\\n * ... ng.\\n */ | -| tst.js:166:50:167:1 | functio ... nt) {\\n} | tst.js:160:1:165:3 | /**\\n * ... ted\\n */ | -| tst.js:173:32:175:1 | functio ... n id;\\n} | tst.js:169:1:172:3 | /**\\n * ... ID.\\n */ | -| tst.js:183:1:185:1 | functio ... = x;\\n} | tst.js:179:1:182:3 | /**\\n * ... uct\\n */ | -| tst.js:201:9:203:9 | functio ... } | tst.js:196:9:200:11 | /**\\n ... */ | -| tst.js:208:43:208:56 | function() { } | tst.js:205:1:207:3 | /**\\n * ... on}\\n */ | -| tst.js:220:19:221:1 | function(x) {\\n} | tst.js:219:1:219:55 | /** @pa ... ing. */ | -| tst.js:250:11:250:43 | functio ... null; } | tst.js:246:1:249:3 | /**\\n * ... e T\\n */ | -| tst.js:253:21:253:53 | functio ... alue; } | tst.js:252:1:252:18 | /** @return {T} */ | -| tst.js:256:21:256:51 | functio ... = t; } | tst.js:255:1:255:19 | /** @param {T} t */ | -| tst.js:266:7:266:21 | function(t) { } | tst.js:261:1:265:3 | /**\\n * ... e T\\n */ | -| tst.js:273:13:273:26 | function() { } | tst.js:269:1:272:3 | /**\\n * ... Val\\n */ | -| tst.js:280:5:280:18 | function() { } | tst.js:277:1:279:3 | /**\\n * ... tor\\n */ | -| tst.js:286:5:286:18 | function() { } | tst.js:282:1:285:3 | /**\\n * ... tor\\n */ | -| tst.js:295:13:295:30 | function(fooY) { } | tst.js:294:1:294:28 | /** @pa ... fooY */ | -| tst.js:304:5:304:18 | function() { } | tst.js:300:1:303:3 | /**\\n * ... e T\\n */ | -| tst.js:307:22:307:36 | function(t) { } | tst.js:306:1:306:19 | /** @param {T} t */ | -| tst.js:313:5:313:18 | function() { } | tst.js:309:1:312:3 | /**\\n * ... g>}\\n */ | -| tst.js:320:5:320:18 | function() { } | tst.js:315:1:319:3 | /**\\n * ... U>}\\n */ | -| tst.js:326:7:326:19 | function() {} | tst.js:322:1:325:3 | /**\\n * ... e T\\n */ | -| tst.js:329:21:329:33 | function() {} | tst.js:328:1:328:18 | /** @return {T} */ | -| tst.js:336:11:336:24 | function() { } | tst.js:331:1:335:3 | /**\\n * ... r>}\\n */ | -| tst.js:343:12:343:36 | functio ... rn a; } | tst.js:338:1:342:3 | /**\\n * ... e T\\n */ | -| tst.js:354:1:354:16 | function f(x) {} | tst.js:351:1:353:3 | /**\\n * ... ger\\n */ | -| tst.js:360:1:360:27 | functio ... fn) {} | tst.js:356:1:359:3 | /**\\n * ... ion\\n */ | -| tst.js:366:18:366:31 | function(p) {} | tst.js:363:3:365:5 | /**\\n ... p\\n */ | -| tst.js:371:14:371:19 | (p) {} | tst.js:368:3:370:5 | /**\\n ... p\\n */ | -| tst.js:378:14:378:19 | (p) {} | tst.js:375:3:377:5 | /**\\n ... p\\n */ | -| tst.js:383:14:383:19 | (p) {} | tst.js:380:3:382:5 | /**\\n ... p\\n */ | diff --git a/javascript/ql/test/library-tests/JSDoc/Function_getDocumentation.ql b/javascript/ql/test/library-tests/JSDoc/Function_getDocumentation.ql deleted file mode 100644 index 4919ec748980..000000000000 --- a/javascript/ql/test/library-tests/JSDoc/Function_getDocumentation.ql +++ /dev/null @@ -1,4 +0,0 @@ -import javascript - -from Function f -select f, f.getDocumentation() diff --git a/javascript/ql/test/library-tests/JSDoc/Function_getDocumentation.qll b/javascript/ql/test/library-tests/JSDoc/Function_getDocumentation.qll new file mode 100644 index 000000000000..02633e818372 --- /dev/null +++ b/javascript/ql/test/library-tests/JSDoc/Function_getDocumentation.qll @@ -0,0 +1,3 @@ +import javascript + +query predicate test_Function_getDocumentation(Function f, JSDoc res) { res = f.getDocumentation() } diff --git a/javascript/ql/test/library-tests/JSDoc/JSDoc.expected b/javascript/ql/test/library-tests/JSDoc/JSDoc.expected deleted file mode 100644 index b4ceca936a5d..000000000000 --- a/javascript/ql/test/library-tests/JSDoc/JSDoc.expected +++ /dev/null @@ -1,71 +0,0 @@ -| tst.js:5:1:5:13 | /** @const */ | | tst.js:5:1:5:13 | /** @const */ | -| tst.js:7:1:11:3 | /**\\n * ... ng}\\n */ | My namespace's favorite kind of beer. | tst.js:7:1:11:3 | /**\\n * ... ng}\\n */ | -| tst.js:14:1:14:13 | /** @const */ | | tst.js:14:1:14:13 | /** @const */ | -| tst.js:16:1:19:3 | /**\\n * ... tor\\n */ | A rectangle. | tst.js:16:1:19:3 | /**\\n * ... tor\\n */ | -| tst.js:23:1:23:24 | /** @de ... ean} */ | | tst.js:23:1:23:24 | /** @de ... ean} */ | -| tst.js:26:1:26:24 | /** @de ... ean} */ | | tst.js:26:1:26:24 | /** @de ... ean} */ | -| tst.js:29:1:35:3 | /**\\n * ... ().\\n */ | Determines whether a node is a field. | tst.js:29:1:35:3 | /**\\n * ... ().\\n */ | -| tst.js:39:1:42:3 | /**\\n * ... ict\\n */ | | tst.js:39:1:42:3 | /**\\n * ... ict\\n */ | -| tst.js:48:12:48:23 | /** @dict */ | | tst.js:48:12:48:23 | /** @dict */ | -| tst.js:51:1:54:3 | /**\\n * ... er}\\n */ | Enum for tri-state values. | tst.js:51:1:54:3 | /**\\n * ... er}\\n */ | -| tst.js:61:1:61:14 | /** @export */ | | tst.js:61:1:61:14 | /** @export */ | -| tst.js:65:1:69:3 | /**\\n * ... st}\\n */ | Immutable empty node list. | tst.js:65:1:69:3 | /**\\n * ... st}\\n */ | -| tst.js:73:1:77:3 | /**\\n * ... tor\\n */ | A class that cannot be extended. | tst.js:73:1:77:3 | /**\\n * ... tor\\n */ | -| tst.js:80:1:83:3 | /**\\n * ... nal\\n */ | A method that cannot be overridden. | tst.js:80:1:83:3 | /**\\n * ... nal\\n */ | -| tst.js:86:1:89:3 | /**\\n * ... ace\\n */ | A shape. | tst.js:86:1:89:3 | /**\\n * ... ace\\n */ | -| tst.js:93:1:96:3 | /**\\n * ... pe}\\n */ | | tst.js:93:1:96:3 | /**\\n * ... pe}\\n */ | -| tst.js:101:1:103:17 | /**\\n * ... tDoc */ | | tst.js:101:1:103:17 | /**\\n * ... tDoc */ | -| tst.js:107:1:111:3 | /**\\n * ... pe}\\n */ | A polygon. | tst.js:107:1:111:3 | /**\\n * ... pe}\\n */ | -| tst.js:117:9:117:40 | /** @le ... ype} */ | | tst.js:117:9:117:40 | /** @le ... ype} */ | -| tst.js:121:1:126:3 | /**\\n * ... sh:\\n */ | | tst.js:121:1:126:3 | /**\\n * ... sh:\\n */ | -| tst.js:128:1:128:21 | /** @no ... ects */ | | tst.js:128:1:128:21 | /** @no ... ects */ | -| tst.js:131:1:136:3 | /**\\n * ... age\\n */ | Returns the window object the foreign document resides in. | tst.js:131:1:136:3 | /**\\n * ... age\\n */ | -| tst.js:140:1:145:3 | /**\\n * ... ng.\\n */ | Queries a Baz for items. | tst.js:140:1:145:3 | /**\\n * ... ng.\\n */ | -| tst.js:149:14:149:26 | /** number */ | number | tst.js:149:14:149:26 | /** number */ | -| tst.js:149:31:149:43 | /** number */ | number | tst.js:149:31:149:43 | /** number */ | -| tst.js:153:1:157:3 | /**\\n * ... ate\\n */ | Handlers that are listening to this logger. | tst.js:153:1:157:3 | /**\\n * ... ate\\n */ | -| tst.js:160:1:165:3 | /**\\n * ... ted\\n */ | Sets the component's root element to the given element.\nConsidered protected and final. | tst.js:160:1:165:3 | /**\\n * ... ted\\n */ | -| tst.js:169:1:172:3 | /**\\n * ... ID.\\n */ | Returns the ID of the last item. | tst.js:169:1:172:3 | /**\\n * ... ID.\\n */ | -| tst.js:177:10:177:22 | /** number */ | number | tst.js:177:10:177:22 | /** number */ | -| tst.js:179:1:182:3 | /**\\n * ... uct\\n */ | | tst.js:179:1:182:3 | /**\\n * ... uct\\n */ | -| tst.js:192:12:192:25 | /** @struct */ | | tst.js:192:12:192:25 | /** @struct */ | -| tst.js:196:9:200:11 | /**\\n ... */ | Returns the roster widget element. | tst.js:196:9:200:11 | /**\\n ... */ | -| tst.js:205:1:207:3 | /**\\n * ... on}\\n */ | | tst.js:205:1:207:3 | /**\\n * ... on}\\n */ | -| tst.js:210:1:213:3 | /**\\n * ... ng}\\n */ | The message hex ID. | tst.js:210:1:213:3 | /**\\n * ... ng}\\n */ | -| tst.js:216:1:216:33 | /** @ty ... er)} */ | | tst.js:216:1:216:33 | /** @ty ... er)} */ | -| tst.js:219:1:219:55 | /** @pa ... ing. */ | | tst.js:219:1:219:55 | /** @pa ... ing. */ | -| tst.js:223:1:223:40 | /** @ty ... ct}} */ | | tst.js:223:1:223:40 | /** @ty ... ct}} */ | -| tst.js:226:1:226:22 | /** @ty ... er?} */ | | tst.js:226:1:226:22 | /** @ty ... er?} */ | -| tst.js:229:1:229:22 | /** @ty ... ect} */ | | tst.js:229:1:229:22 | /** @ty ... ect} */ | -| tst.js:232:1:243:3 | /**\\n * ... p10\\n */ | | tst.js:232:1:243:3 | /**\\n * ... p10\\n */ | -| tst.js:246:1:249:3 | /**\\n * ... e T\\n */ | | tst.js:246:1:249:3 | /**\\n * ... e T\\n */ | -| tst.js:252:1:252:18 | /** @return {T} */ | | tst.js:252:1:252:18 | /** @return {T} */ | -| tst.js:255:1:255:19 | /** @param {T} t */ | | tst.js:255:1:255:19 | /** @param {T} t */ | -| tst.js:258:1:258:28 | /** @ty ... ng>} */ | | tst.js:258:1:258:28 | /** @ty ... ng>} */ | -| tst.js:259:11:259:38 | /** @ty ... ng>} */ | | tst.js:259:11:259:38 | /** @ty ... ng>} */ | -| tst.js:261:1:265:3 | /**\\n * ... e T\\n */ | | tst.js:261:1:265:3 | /**\\n * ... e T\\n */ | -| tst.js:269:1:272:3 | /**\\n * ... Val\\n */ | | tst.js:269:1:272:3 | /**\\n * ... Val\\n */ | -| tst.js:275:1:275:37 | /** @ty ... er>} */ | | tst.js:275:1:275:37 | /** @ty ... er>} */ | -| tst.js:277:1:279:3 | /**\\n * ... tor\\n */ | | tst.js:277:1:279:3 | /**\\n * ... tor\\n */ | -| tst.js:282:1:285:3 | /**\\n * ... tor\\n */ | | tst.js:282:1:285:3 | /**\\n * ... tor\\n */ | -| tst.js:288:1:288:22 | /** @ty ... } */ | | tst.js:288:1:288:22 | /** @ty ... } */ | -| tst.js:289:1:289:22 | /** @ty ... } */ | | tst.js:289:1:289:22 | /** @ty ... } */ | -| tst.js:294:1:294:28 | /** @pa ... fooY */ | | tst.js:294:1:294:28 | /** @pa ... fooY */ | -| tst.js:300:1:303:3 | /**\\n * ... e T\\n */ | | tst.js:300:1:303:3 | /**\\n * ... e T\\n */ | -| tst.js:306:1:306:19 | /** @param {T} t */ | | tst.js:306:1:306:19 | /** @param {T} t */ | -| tst.js:309:1:312:3 | /**\\n * ... g>}\\n */ | | tst.js:309:1:312:3 | /**\\n * ... g>}\\n */ | -| tst.js:315:1:319:3 | /**\\n * ... U>}\\n */ | | tst.js:315:1:319:3 | /**\\n * ... U>}\\n */ | -| tst.js:322:1:325:3 | /**\\n * ... e T\\n */ | | tst.js:322:1:325:3 | /**\\n * ... e T\\n */ | -| tst.js:328:1:328:18 | /** @return {T} */ | | tst.js:328:1:328:18 | /** @return {T} */ | -| tst.js:331:1:335:3 | /**\\n * ... r>}\\n */ | | tst.js:331:1:335:3 | /**\\n * ... r>}\\n */ | -| tst.js:338:1:342:3 | /**\\n * ... e T\\n */ | | tst.js:338:1:342:3 | /**\\n * ... e T\\n */ | -| tst.js:345:1:345:21 | /** @ty ... ing} */ | | tst.js:345:1:345:21 | /** @ty ... ing} */ | -| tst.js:346:1:346:21 | /** @ty ... ber} */ | | tst.js:346:1:346:21 | /** @ty ... ber} */ | -| tst.js:347:1:347:21 | /** @ty ... ber} */ | | tst.js:347:1:347:21 | /** @ty ... ber} */ | -| tst.js:349:1:349:31 | /** @ty ... ned} */ | | tst.js:349:1:349:31 | /** @ty ... ned} */ | -| tst.js:351:1:353:3 | /**\\n * ... ger\\n */ | | tst.js:351:1:353:3 | /**\\n * ... ger\\n */ | -| tst.js:356:1:359:3 | /**\\n * ... ion\\n */ | | tst.js:356:1:359:3 | /**\\n * ... ion\\n */ | -| tst.js:363:3:365:5 | /**\\n ... p\\n */ | | tst.js:363:3:365:5 | /**\\n ... p\\n */ | -| tst.js:368:3:370:5 | /**\\n ... p\\n */ | | tst.js:368:3:370:5 | /**\\n ... p\\n */ | -| tst.js:375:3:377:5 | /**\\n ... p\\n */ | | tst.js:375:3:377:5 | /**\\n ... p\\n */ | -| tst.js:380:3:382:5 | /**\\n ... p\\n */ | | tst.js:380:3:382:5 | /**\\n ... p\\n */ | diff --git a/javascript/ql/test/library-tests/JSDoc/JSDoc.ql b/javascript/ql/test/library-tests/JSDoc/JSDoc.ql deleted file mode 100644 index 3c772f03eee5..000000000000 --- a/javascript/ql/test/library-tests/JSDoc/JSDoc.ql +++ /dev/null @@ -1,4 +0,0 @@ -import semmle.javascript.JSDoc - -from JSDoc jsdoc -select jsdoc, jsdoc.getDescription(), jsdoc.getComment() diff --git a/javascript/ql/test/library-tests/JSDoc/JSDoc.qll b/javascript/ql/test/library-tests/JSDoc/JSDoc.qll new file mode 100644 index 000000000000..042323b84ea9 --- /dev/null +++ b/javascript/ql/test/library-tests/JSDoc/JSDoc.qll @@ -0,0 +1,5 @@ +import semmle.javascript.JSDoc + +query predicate test_JSDoc(JSDoc jsdoc, string res0, Comment res1) { + res0 = jsdoc.getDescription() and res1 = jsdoc.getComment() +} diff --git a/javascript/ql/test/library-tests/JSDoc/JSDocAppliedTypeExpr.expected b/javascript/ql/test/library-tests/JSDoc/JSDocAppliedTypeExpr.expected deleted file mode 100644 index 22949431030b..000000000000 --- a/javascript/ql/test/library-tests/JSDoc/JSDocAppliedTypeExpr.expected +++ /dev/null @@ -1,13 +0,0 @@ -| A. | A | 0 | U | -| A. | A | 0 | string | -| Array. | Array | 0 | Function | -| Array. | Array | 0 | number | -| Foo. | Foo | 0 | X | -| Foo. | Foo | 0 | Y | -| Foo. | Foo | 0 | Y | -| Foo. | Foo | 0 | number | -| Foo. | Foo | 0 | string | -| Foo. | Foo | 0 | string | -| Foo. | Foo | 0 | string | -| MyMap. | MyMap | 0 | string | -| MyMap. | MyMap | 1 | number | diff --git a/javascript/ql/test/library-tests/JSDoc/JSDocAppliedTypeExpr.ql b/javascript/ql/test/library-tests/JSDoc/JSDocAppliedTypeExpr.ql deleted file mode 100644 index 49d549c9b65b..000000000000 --- a/javascript/ql/test/library-tests/JSDoc/JSDocAppliedTypeExpr.ql +++ /dev/null @@ -1,4 +0,0 @@ -import semmle.javascript.JSDoc - -from JSDocAppliedTypeExpr jsdate, int idx -select jsdate, jsdate.getHead(), idx, jsdate.getArgument(idx) diff --git a/javascript/ql/test/library-tests/JSDoc/JSDocAppliedTypeExpr.qll b/javascript/ql/test/library-tests/JSDoc/JSDocAppliedTypeExpr.qll new file mode 100644 index 000000000000..25a9ed62cc28 --- /dev/null +++ b/javascript/ql/test/library-tests/JSDoc/JSDocAppliedTypeExpr.qll @@ -0,0 +1,7 @@ +import semmle.javascript.JSDoc + +query predicate test_JSDocAppliedTypeExpr( + JSDocAppliedTypeExpr jsdate, JSDocTypeExpr res0, int idx, JSDocTypeExpr res1 +) { + res0 = jsdate.getHead() and res1 = jsdate.getArgument(idx) +} diff --git a/javascript/ql/test/library-tests/JSDoc/JSDocArrayTypeExpr.expected b/javascript/ql/test/library-tests/JSDoc/JSDocArrayTypeExpr.expected deleted file mode 100644 index 2c4bf9bd913b..000000000000 --- a/javascript/ql/test/library-tests/JSDoc/JSDocArrayTypeExpr.expected +++ /dev/null @@ -1 +0,0 @@ -| [number] | 0 | number | diff --git a/javascript/ql/test/library-tests/JSDoc/JSDocArrayTypeExpr.ql b/javascript/ql/test/library-tests/JSDoc/JSDocArrayTypeExpr.ql deleted file mode 100644 index 1eaa735f270d..000000000000 --- a/javascript/ql/test/library-tests/JSDoc/JSDocArrayTypeExpr.ql +++ /dev/null @@ -1,4 +0,0 @@ -import semmle.javascript.JSDoc - -from JSDocArrayTypeExpr jsdate, int idx -select jsdate, idx, jsdate.getElementType(idx) diff --git a/javascript/ql/test/library-tests/JSDoc/JSDocArrayTypeExpr.qll b/javascript/ql/test/library-tests/JSDoc/JSDocArrayTypeExpr.qll new file mode 100644 index 000000000000..cf6181b730c0 --- /dev/null +++ b/javascript/ql/test/library-tests/JSDoc/JSDocArrayTypeExpr.qll @@ -0,0 +1,5 @@ +import semmle.javascript.JSDoc + +query predicate test_JSDocArrayTypeExpr(JSDocArrayTypeExpr jsdate, int idx, JSDocTypeExpr res) { + res = jsdate.getElementType(idx) +} diff --git a/javascript/ql/test/library-tests/JSDoc/JSDocFunctionTypeExpr.expected b/javascript/ql/test/library-tests/JSDoc/JSDocFunctionTypeExpr.expected deleted file mode 100644 index 7ea7ff2253a9..000000000000 --- a/javascript/ql/test/library-tests/JSDoc/JSDocFunctionTypeExpr.expected +++ /dev/null @@ -1,10 +0,0 @@ -| function (?string=, number=) | (none) | (none) | 0 | ?string= | no | -| function (?string=, number=) | (none) | (none) | 1 | number= | no | -| function (new: goog.ui.Menu, string) | (none) | goog.ui.Menu | 0 | string | yes | -| function (string, ...[number]): number | number | (none) | 0 | string | no | -| function (string, ...[number]): number | number | (none) | 1 | ...[number] | no | -| function (string, boolean) | (none) | (none) | 0 | string | no | -| function (string, boolean) | (none) | (none) | 1 | boolean | no | -| function (this: goog.ui.Menu, string) | (none) | goog.ui.Menu | 0 | string | no | -| function (x: !number, y: !number): number | number | (none) | 0 | !number | no | -| function (x: !number, y: !number): number | number | (none) | 1 | !number | no | diff --git a/javascript/ql/test/library-tests/JSDoc/JSDocFunctionTypeExpr.ql b/javascript/ql/test/library-tests/JSDoc/JSDocFunctionTypeExpr.ql deleted file mode 100644 index 356a4e6b2d0c..000000000000 --- a/javascript/ql/test/library-tests/JSDoc/JSDocFunctionTypeExpr.ql +++ /dev/null @@ -1,16 +0,0 @@ -import semmle.javascript.JSDoc - -from JSDocFunctionTypeExpr jsdfte, string ret, string recv, int idx, string isctor -where - ( - if exists(jsdfte.getResultType()) - then ret = jsdfte.getResultType().toString() - else ret = "(none)" - ) and - ( - if exists(jsdfte.getReceiverType()) - then recv = jsdfte.getReceiverType().toString() - else recv = "(none)" - ) and - (if jsdfte.isConstructorType() then isctor = "yes" else isctor = "no") -select jsdfte, ret, recv, idx, jsdfte.getParameterType(idx), isctor diff --git a/javascript/ql/test/library-tests/JSDoc/JSDocFunctionTypeExpr.qll b/javascript/ql/test/library-tests/JSDoc/JSDocFunctionTypeExpr.qll new file mode 100644 index 000000000000..10739e4b04a3 --- /dev/null +++ b/javascript/ql/test/library-tests/JSDoc/JSDocFunctionTypeExpr.qll @@ -0,0 +1,18 @@ +import semmle.javascript.JSDoc + +query predicate test_JSDocFunctionTypeExpr( + JSDocFunctionTypeExpr jsdfte, string ret, string recv, int idx, JSDocTypeExpr res, string isctor +) { + ( + if exists(jsdfte.getResultType()) + then ret = jsdfte.getResultType().toString() + else ret = "(none)" + ) and + ( + if exists(jsdfte.getReceiverType()) + then recv = jsdfte.getReceiverType().toString() + else recv = "(none)" + ) and + (if jsdfte.isConstructorType() then isctor = "yes" else isctor = "no") and + res = jsdfte.getParameterType(idx) +} diff --git a/javascript/ql/test/library-tests/JSDoc/JSDocNonNullableTypeExpr.expected b/javascript/ql/test/library-tests/JSDoc/JSDocNonNullableTypeExpr.expected deleted file mode 100644 index ed994dbcdeae..000000000000 --- a/javascript/ql/test/library-tests/JSDoc/JSDocNonNullableTypeExpr.expected +++ /dev/null @@ -1,5 +0,0 @@ -| !Foo. | Foo. | prefix | -| !Foo. | Foo. | prefix | -| !Object | Object | prefix | -| !number | number | prefix | -| !number | number | prefix | diff --git a/javascript/ql/test/library-tests/JSDoc/JSDocNonNullableTypeExpr.ql b/javascript/ql/test/library-tests/JSDoc/JSDocNonNullableTypeExpr.ql deleted file mode 100644 index b180c7e5a133..000000000000 --- a/javascript/ql/test/library-tests/JSDoc/JSDocNonNullableTypeExpr.ql +++ /dev/null @@ -1,5 +0,0 @@ -import semmle.javascript.JSDoc - -from JSDocNonNullableTypeExpr jsdnte, string fixity -where (if jsdnte.isPrefix() then fixity = "prefix" else fixity = "postfix") -select jsdnte, jsdnte.getTypeExpr(), fixity diff --git a/javascript/ql/test/library-tests/JSDoc/JSDocNonNullableTypeExpr.qll b/javascript/ql/test/library-tests/JSDoc/JSDocNonNullableTypeExpr.qll new file mode 100644 index 000000000000..67726f6b7054 --- /dev/null +++ b/javascript/ql/test/library-tests/JSDoc/JSDocNonNullableTypeExpr.qll @@ -0,0 +1,8 @@ +import semmle.javascript.JSDoc + +query predicate test_JSDocNonNullableTypeExpr( + JSDocNonNullableTypeExpr jsdnte, JSDocTypeExpr res, string fixity +) { + (if jsdnte.isPrefix() then fixity = "prefix" else fixity = "postfix") and + res = jsdnte.getTypeExpr() +} diff --git a/javascript/ql/test/library-tests/JSDoc/JSDocNullableTypeExpr.expected b/javascript/ql/test/library-tests/JSDoc/JSDocNullableTypeExpr.expected deleted file mode 100644 index d81f65f8209e..000000000000 --- a/javascript/ql/test/library-tests/JSDoc/JSDocNullableTypeExpr.expected +++ /dev/null @@ -1,2 +0,0 @@ -| ?string | string | prefix | -| number? | number | postfix | diff --git a/javascript/ql/test/library-tests/JSDoc/JSDocNullableTypeExpr.ql b/javascript/ql/test/library-tests/JSDoc/JSDocNullableTypeExpr.ql deleted file mode 100644 index ad9b67ca0fe3..000000000000 --- a/javascript/ql/test/library-tests/JSDoc/JSDocNullableTypeExpr.ql +++ /dev/null @@ -1,5 +0,0 @@ -import semmle.javascript.JSDoc - -from JSDocNullableTypeExpr jsdnte, string fixity -where (if jsdnte.isPrefix() then fixity = "prefix" else fixity = "postfix") -select jsdnte, jsdnte.getTypeExpr(), fixity diff --git a/javascript/ql/test/library-tests/JSDoc/JSDocNullableTypeExpr.qll b/javascript/ql/test/library-tests/JSDoc/JSDocNullableTypeExpr.qll new file mode 100644 index 000000000000..6391ac734ef7 --- /dev/null +++ b/javascript/ql/test/library-tests/JSDoc/JSDocNullableTypeExpr.qll @@ -0,0 +1,8 @@ +import semmle.javascript.JSDoc + +query predicate test_JSDocNullableTypeExpr( + JSDocNullableTypeExpr jsdnte, JSDocTypeExpr res, string fixity +) { + (if jsdnte.isPrefix() then fixity = "prefix" else fixity = "postfix") and + res = jsdnte.getTypeExpr() +} diff --git a/javascript/ql/test/library-tests/JSDoc/JSDocOptionalParameterTypeExpr.expected b/javascript/ql/test/library-tests/JSDoc/JSDocOptionalParameterTypeExpr.expected deleted file mode 100644 index 505d9d525576..000000000000 --- a/javascript/ql/test/library-tests/JSDoc/JSDocOptionalParameterTypeExpr.expected +++ /dev/null @@ -1,3 +0,0 @@ -| ?string= | ?string | -| number= | number | -| number= | number | diff --git a/javascript/ql/test/library-tests/JSDoc/JSDocOptionalParameterTypeExpr.ql b/javascript/ql/test/library-tests/JSDoc/JSDocOptionalParameterTypeExpr.ql deleted file mode 100644 index bd5153cf07b4..000000000000 --- a/javascript/ql/test/library-tests/JSDoc/JSDocOptionalParameterTypeExpr.ql +++ /dev/null @@ -1,4 +0,0 @@ -import semmle.javascript.JSDoc - -from JSDocOptionalParameterTypeExpr jsdopte -select jsdopte, jsdopte.getUnderlyingType() diff --git a/javascript/ql/test/library-tests/JSDoc/JSDocOptionalParameterTypeExpr.qll b/javascript/ql/test/library-tests/JSDoc/JSDocOptionalParameterTypeExpr.qll new file mode 100644 index 000000000000..e69f7cdfe7a1 --- /dev/null +++ b/javascript/ql/test/library-tests/JSDoc/JSDocOptionalParameterTypeExpr.qll @@ -0,0 +1,7 @@ +import semmle.javascript.JSDoc + +query predicate test_JSDocOptionalParameterTypeExpr( + JSDocOptionalParameterTypeExpr jsdopte, JSDocTypeExpr res +) { + res = jsdopte.getUnderlyingType() +} diff --git a/javascript/ql/test/library-tests/JSDoc/JSDocRecordTypeExpr.expected b/javascript/ql/test/library-tests/JSDoc/JSDocRecordTypeExpr.expected deleted file mode 100644 index bfd8297bc774..000000000000 --- a/javascript/ql/test/library-tests/JSDoc/JSDocRecordTypeExpr.expected +++ /dev/null @@ -1,2 +0,0 @@ -| {myNum: number, myObject} | myNum | number | -| {myNum: number, myObject} | myObject | (none) | diff --git a/javascript/ql/test/library-tests/JSDoc/JSDocRecordTypeExpr.ql b/javascript/ql/test/library-tests/JSDoc/JSDocRecordTypeExpr.ql deleted file mode 100644 index fe0be277a193..000000000000 --- a/javascript/ql/test/library-tests/JSDoc/JSDocRecordTypeExpr.ql +++ /dev/null @@ -1,11 +0,0 @@ -import semmle.javascript.JSDoc - -from JSDocRecordTypeExpr jsdrte, string name, string tp -where - name = jsdrte.getAFieldName() and - ( - if exists(jsdrte.getFieldTypeByName(name)) - then tp = jsdrte.getFieldTypeByName(name).toString() - else tp = "(none)" - ) -select jsdrte, name, tp diff --git a/javascript/ql/test/library-tests/JSDoc/JSDocRecordTypeExpr.qll b/javascript/ql/test/library-tests/JSDoc/JSDocRecordTypeExpr.qll new file mode 100644 index 000000000000..c8a82d52e017 --- /dev/null +++ b/javascript/ql/test/library-tests/JSDoc/JSDocRecordTypeExpr.qll @@ -0,0 +1,10 @@ +import semmle.javascript.JSDoc + +query predicate test_JSDocRecordTypeExpr(JSDocRecordTypeExpr jsdrte, string name, string tp) { + name = jsdrte.getAFieldName() and + ( + if exists(jsdrte.getFieldTypeByName(name)) + then tp = jsdrte.getFieldTypeByName(name).toString() + else tp = "(none)" + ) +} diff --git a/javascript/ql/test/library-tests/JSDoc/JSDocRestParameterTypeExpr.expected b/javascript/ql/test/library-tests/JSDoc/JSDocRestParameterTypeExpr.expected deleted file mode 100644 index e2ae6c8ecf28..000000000000 --- a/javascript/ql/test/library-tests/JSDoc/JSDocRestParameterTypeExpr.expected +++ /dev/null @@ -1,2 +0,0 @@ -| ...[number] | [number] | -| ...number | number | diff --git a/javascript/ql/test/library-tests/JSDoc/JSDocRestParameterTypeExpr.ql b/javascript/ql/test/library-tests/JSDoc/JSDocRestParameterTypeExpr.ql deleted file mode 100644 index 17093d93dd68..000000000000 --- a/javascript/ql/test/library-tests/JSDoc/JSDocRestParameterTypeExpr.ql +++ /dev/null @@ -1,4 +0,0 @@ -import semmle.javascript.JSDoc - -from JSDocRestParameterTypeExpr jsdopte -select jsdopte, jsdopte.getUnderlyingType() diff --git a/javascript/ql/test/library-tests/JSDoc/JSDocRestParameterTypeExpr.qll b/javascript/ql/test/library-tests/JSDoc/JSDocRestParameterTypeExpr.qll new file mode 100644 index 000000000000..42a07ccba7ef --- /dev/null +++ b/javascript/ql/test/library-tests/JSDoc/JSDocRestParameterTypeExpr.qll @@ -0,0 +1,7 @@ +import semmle.javascript.JSDoc + +query predicate test_JSDocRestParameterTypeExpr( + JSDocRestParameterTypeExpr jsdopte, JSDocTypeExpr res +) { + res = jsdopte.getUnderlyingType() +} diff --git a/javascript/ql/test/library-tests/JSDoc/JSDocTag.expected b/javascript/ql/test/library-tests/JSDoc/JSDocTag.expected deleted file mode 100644 index 1794aacbabd0..000000000000 --- a/javascript/ql/test/library-tests/JSDoc/JSDocTag.expected +++ /dev/null @@ -1,106 +0,0 @@ -| tst.js:5:5:5:10 | @const | const | tst.js:5:1:5:13 | /** @const */ | 0 | (none) | (none) | (none) | -| tst.js:9:4:9:9 | @const | const | tst.js:7:1:11:3 | /**\\n * ... ng}\\n */ | 0 | (none) | (none) | (none) | -| tst.js:10:4:10:8 | @type | type | tst.js:7:1:11:3 | /**\\n * ... ng}\\n */ | 1 | (none) | (none) | string | -| tst.js:14:5:14:10 | @const | const | tst.js:14:1:14:13 | /** @const */ | 0 | (none) | (none) | (none) | -| tst.js:18:4:18:15 | @constructor | constructor | tst.js:16:1:19:3 | /**\\n * ... tor\\n */ | 0 | (none) | (none) | (none) | -| tst.js:23:5:23:11 | @define | define | tst.js:23:1:23:24 | /** @de ... ean} */ | 0 | (none) | (none) | boolean | -| tst.js:26:5:26:11 | @define | define | tst.js:26:1:26:24 | /** @de ... ean} */ | 0 | (none) | (none) | boolean | -| tst.js:31:4:31:10 | @return | return | tst.js:29:1:35:3 | /**\\n * ... ().\\n */ | 0 | True if the contents of\nthe element are editable, but the element\nitself is not.\n | (none) | boolean | -| tst.js:34:4:34:14 | @deprecated | deprecated | tst.js:29:1:35:3 | /**\\n * ... ().\\n */ | 1 | Use isField(). | (none) | (none) | -| tst.js:40:4:40:15 | @constructor | constructor | tst.js:39:1:42:3 | /**\\n * ... ict\\n */ | 0 | (none) | (none) | (none) | -| tst.js:41:4:41:8 | @dict | dict | tst.js:39:1:42:3 | /**\\n * ... ict\\n */ | 1 | (none) | (none) | (none) | -| tst.js:48:16:48:20 | @dict | dict | tst.js:48:12:48:23 | /** @dict */ | 0 | (none) | (none) | (none) | -| tst.js:53:4:53:8 | @enum | enum | tst.js:51:1:54:3 | /**\\n * ... er}\\n */ | 0 | (none) | (none) | number | -| tst.js:61:5:61:11 | @export | export | tst.js:61:1:61:14 | /** @export */ | 0 | (none) | (none) | (none) | -| tst.js:67:4:67:15 | @constructor | constructor | tst.js:65:1:69:3 | /**\\n * ... st}\\n */ | 0 | (none) | (none) | (none) | -| tst.js:68:4:68:11 | @extends | extends | tst.js:65:1:69:3 | /**\\n * ... st}\\n */ | 1 | (none) | (none) | goog.ds.BasicNodeList | -| tst.js:75:4:75:9 | @final | final | tst.js:73:1:77:3 | /**\\n * ... tor\\n */ | 0 | (none) | (none) | (none) | -| tst.js:76:4:76:15 | @constructor | constructor | tst.js:73:1:77:3 | /**\\n * ... tor\\n */ | 1 | (none) | (none) | (none) | -| tst.js:82:4:82:9 | @final | final | tst.js:80:1:83:3 | /**\\n * ... nal\\n */ | 0 | (none) | (none) | (none) | -| tst.js:88:4:88:13 | @interface | interface | tst.js:86:1:89:3 | /**\\n * ... ace\\n */ | 0 | (none) | (none) | (none) | -| tst.js:94:4:94:15 | @constructor | constructor | tst.js:93:1:96:3 | /**\\n * ... pe}\\n */ | 0 | (none) | (none) | (none) | -| tst.js:95:4:95:14 | @implements | implements | tst.js:93:1:96:3 | /**\\n * ... pe}\\n */ | 1 | (none) | (none) | Shape | -| tst.js:102:4:102:12 | @override | override | tst.js:101:1:103:17 | /**\\n * ... tDoc */ | 0 | (none) | (none) | (none) | -| tst.js:103:4:103:14 | @inheritDoc | inheritDoc | tst.js:101:1:103:17 | /**\\n * ... tDoc */ | 1 | (none) | (none) | (none) | -| tst.js:109:4:109:13 | @interface | interface | tst.js:107:1:111:3 | /**\\n * ... pe}\\n */ | 0 | (none) | (none) | (none) | -| tst.js:110:4:110:11 | @extends | extends | tst.js:107:1:111:3 | /**\\n * ... pe}\\n */ | 1 | (none) | (none) | Shape | -| tst.js:117:13:117:18 | @lends | lends | tst.js:117:9:117:40 | /** @le ... ype} */ | 0 | {Button.prototype} | (none) | (none) | -| tst.js:122:4:122:12 | @preserve | preserve | tst.js:121:1:126:3 | /**\\n * ... sh:\\n */ | 0 | Copyright 2009 SomeThirdParty.\nHere is the full license text and copyright\nnotice for this file. Note that the notice can span several\nlines and is only terminated by the closing star and slash: | (none) | (none) | -| tst.js:128:5:128:18 | @nosideeffects | nosideeffects | tst.js:128:1:128:21 | /** @no ... ects */ | 0 | (none) | (none) | (none) | -| tst.js:134:4:134:10 | @return | return | tst.js:131:1:136:3 | /**\\n * ... age\\n */ | 0 | The window object of the peer.\n | (none) | Object | -| tst.js:135:4:135:11 | @package | package | tst.js:131:1:136:3 | /**\\n * ... age\\n */ | 1 | (none) | (none) | (none) | -| tst.js:142:4:142:9 | @param | param | tst.js:140:1:145:3 | /**\\n * ... ng.\\n */ | 0 | Subgroup id to query.\n | groupNum | number | -| tst.js:143:4:143:9 | @param | param | tst.js:140:1:145:3 | /**\\n * ... ng.\\n */ | 1 | An itemName,\nor itemId, or null to search everything. | term | (string\|number\|null) | -| tst.js:155:4:155:8 | @type | type | tst.js:153:1:157:3 | /**\\n * ... ate\\n */ | 0 | (none) | (none) | Array. | -| tst.js:156:4:156:11 | @private | private | tst.js:153:1:157:3 | /**\\n * ... ate\\n */ | 1 | (none) | (none) | (none) | -| tst.js:163:4:163:9 | @param | param | tst.js:160:1:165:3 | /**\\n * ... ted\\n */ | 0 | Root element for the component.\n | element | Element | -| tst.js:164:4:164:13 | @protected | protected | tst.js:160:1:165:3 | /**\\n * ... ted\\n */ | 1 | (none) | (none) | (none) | -| tst.js:171:4:171:10 | @return | return | tst.js:169:1:172:3 | /**\\n * ... ID.\\n */ | 0 | The hex ID. | (none) | string | -| tst.js:180:4:180:15 | @constructor | constructor | tst.js:179:1:182:3 | /**\\n * ... uct\\n */ | 0 | (none) | (none) | (none) | -| tst.js:181:4:181:10 | @struct | struct | tst.js:179:1:182:3 | /**\\n * ... uct\\n */ | 1 | (none) | (none) | (none) | -| tst.js:192:16:192:22 | @struct | struct | tst.js:192:12:192:25 | /** @struct */ | 0 | (none) | (none) | (none) | -| tst.js:198:12:198:16 | @this | this | tst.js:196:9:200:11 | /**\\n ... */ | 0 | (none) | (none) | (none) | -| tst.js:199:12:199:18 | @return | return | tst.js:196:9:200:11 | /**\\n ... */ | 1 | (none) | (none) | Element | -| tst.js:206:4:206:10 | @throws | throws | tst.js:205:1:207:3 | /**\\n * ... on}\\n */ | 0 | (none) | (none) | DOMException | -| tst.js:212:4:212:8 | @type | type | tst.js:210:1:213:3 | /**\\n * ... ng}\\n */ | 0 | (none) | (none) | string | -| tst.js:216:5:216:12 | @typedef | typedef | tst.js:216:1:216:33 | /** @ty ... er)} */ | 0 | (none) | (none) | (string\|number) | -| tst.js:219:5:219:10 | @param | param | tst.js:219:1:219:55 | /** @pa ... ing. */ | 0 | A number or a string. | x | goog.NumberLike | -| tst.js:223:5:223:9 | @type | type | tst.js:223:1:223:40 | /** @ty ... ct}} */ | 0 | (none) | (none) | {myNum: number, myObject} | -| tst.js:226:5:226:9 | @type | type | tst.js:226:1:226:22 | /** @ty ... er?} */ | 0 | (none) | (none) | number? | -| tst.js:229:5:229:9 | @type | type | tst.js:229:1:229:22 | /** @ty ... ect} */ | 0 | (none) | (none) | !Object | -| tst.js:233:4:233:9 | @param | param | tst.js:232:1:243:3 | /**\\n * ... p10\\n */ | 0 | (none) | p1 | function (string, boolean) | -| tst.js:234:4:234:9 | @param | param | tst.js:232:1:243:3 | /**\\n * ... p10\\n */ | 1 | (none) | p2 | function (): number | -| tst.js:235:4:235:9 | @param | param | tst.js:232:1:243:3 | /**\\n * ... p10\\n */ | 2 | (none) | p3 | function (this: goog.ui.Menu, string) | -| tst.js:236:4:236:9 | @param | param | tst.js:232:1:243:3 | /**\\n * ... p10\\n */ | 3 | (none) | p4 | function (new: goog.ui.Menu, string) | -| tst.js:237:4:237:9 | @param | param | tst.js:232:1:243:3 | /**\\n * ... p10\\n */ | 4 | (none) | p5 | function (string, ...[number]): number | -| tst.js:238:4:238:9 | @param | param | tst.js:232:1:243:3 | /**\\n * ... p10\\n */ | 5 | p6\n | var_args | ...number | -| tst.js:239:4:239:9 | @param | param | tst.js:232:1:243:3 | /**\\n * ... p10\\n */ | 6 | p7\n | opt_argument | number= | -| tst.js:240:4:240:9 | @param | param | tst.js:232:1:243:3 | /**\\n * ... p10\\n */ | 7 | (none) | p8 | function (?string=, number=) | -| tst.js:241:4:241:9 | @param | param | tst.js:232:1:243:3 | /**\\n * ... p10\\n */ | 8 | (none) | p9 | * | -| tst.js:242:4:242:9 | @param | param | tst.js:232:1:243:3 | /**\\n * ... p10\\n */ | 9 | (none) | p10 | ? | -| tst.js:247:4:247:15 | @constructor | constructor | tst.js:246:1:249:3 | /**\\n * ... e T\\n */ | 0 | (none) | (none) | (none) | -| tst.js:248:4:248:12 | @template | template | tst.js:246:1:249:3 | /**\\n * ... e T\\n */ | 1 | T | (none) | (none) | -| tst.js:252:5:252:11 | @return | return | tst.js:252:1:252:18 | /** @return {T} */ | 0 | (none) | (none) | T | -| tst.js:255:5:255:10 | @param | param | tst.js:255:1:255:19 | /** @param {T} t */ | 0 | (none) | t | T | -| tst.js:258:5:258:9 | @type | type | tst.js:258:1:258:28 | /** @ty ... ng>} */ | 0 | (none) | (none) | !Foo. | -| tst.js:259:15:259:19 | @type | type | tst.js:259:11:259:38 | /** @ty ... ng>} */ | 0 | (none) | (none) | !Foo. | -| tst.js:262:4:262:9 | @param | param | tst.js:261:1:265:3 | /**\\n * ... e T\\n */ | 0 | (none) | t | T | -| tst.js:263:4:263:15 | @constructor | constructor | tst.js:261:1:265:3 | /**\\n * ... e T\\n */ | 1 | (none) | (none) | (none) | -| tst.js:264:4:264:12 | @template | template | tst.js:261:1:265:3 | /**\\n * ... e T\\n */ | 2 | T | (none) | (none) | -| tst.js:270:4:270:15 | @constructor | constructor | tst.js:269:1:272:3 | /**\\n * ... Val\\n */ | 0 | (none) | (none) | (none) | -| tst.js:271:4:271:12 | @template | template | tst.js:269:1:272:3 | /**\\n * ... Val\\n */ | 1 | Key, Val | (none) | (none) | -| tst.js:275:5:275:9 | @type | type | tst.js:275:1:275:37 | /** @ty ... er>} */ | 0 | (none) | (none) | MyMap. | -| tst.js:278:4:278:15 | @constructor | constructor | tst.js:277:1:279:3 | /**\\n * ... tor\\n */ | 0 | (none) | (none) | (none) | -| tst.js:283:4:283:11 | @extends | extends | tst.js:282:1:285:3 | /**\\n * ... tor\\n */ | 0 | (none) | (none) | X | -| tst.js:284:4:284:15 | @constructor | constructor | tst.js:282:1:285:3 | /**\\n * ... tor\\n */ | 1 | (none) | (none) | (none) | -| tst.js:288:5:288:9 | @type | type | tst.js:288:1:288:22 | /** @ty ... } */ | 0 | (none) | (none) | Foo. | -| tst.js:289:5:289:9 | @type | type | tst.js:289:1:289:22 | /** @ty ... } */ | 0 | (none) | (none) | Foo. | -| tst.js:294:5:294:10 | @param | param | tst.js:294:1:294:28 | /** @pa ... fooY */ | 0 | (none) | fooY | Foo. | -| tst.js:301:4:301:15 | @constructor | constructor | tst.js:300:1:303:3 | /**\\n * ... e T\\n */ | 0 | (none) | (none) | (none) | -| tst.js:302:4:302:12 | @template | template | tst.js:300:1:303:3 | /**\\n * ... e T\\n */ | 1 | T | (none) | (none) | -| tst.js:306:5:306:10 | @param | param | tst.js:306:1:306:19 | /** @param {T} t */ | 0 | (none) | t | T | -| tst.js:310:4:310:15 | @constructor | constructor | tst.js:309:1:312:3 | /**\\n * ... g>}\\n */ | 0 | (none) | (none) | (none) | -| tst.js:311:4:311:11 | @extends | extends | tst.js:309:1:312:3 | /**\\n * ... g>}\\n */ | 1 | (none) | (none) | A. | -| tst.js:316:4:316:15 | @constructor | constructor | tst.js:315:1:319:3 | /**\\n * ... U>}\\n */ | 0 | (none) | (none) | (none) | -| tst.js:317:4:317:12 | @template | template | tst.js:315:1:319:3 | /**\\n * ... U>}\\n */ | 1 | U\n | (none) | (none) | -| tst.js:318:4:318:11 | @extends | extends | tst.js:315:1:319:3 | /**\\n * ... U>}\\n */ | 2 | (none) | (none) | A. | -| tst.js:323:4:323:13 | @interface | interface | tst.js:322:1:325:3 | /**\\n * ... e T\\n */ | 0 | (none) | (none) | (none) | -| tst.js:324:4:324:12 | @template | template | tst.js:322:1:325:3 | /**\\n * ... e T\\n */ | 1 | T | (none) | (none) | -| tst.js:328:5:328:11 | @return | return | tst.js:328:1:328:18 | /** @return {T} */ | 0 | (none) | (none) | T | -| tst.js:332:4:332:15 | @constructor | constructor | tst.js:331:1:335:3 | /**\\n * ... r>}\\n */ | 0 | (none) | (none) | (none) | -| tst.js:333:4:333:14 | @implements | implements | tst.js:331:1:335:3 | /**\\n * ... r>}\\n */ | 1 | (none) | (none) | Foo. | -| tst.js:334:4:334:14 | @implements | implements | tst.js:331:1:335:3 | /**\\n * ... r>}\\n */ | 2 | (none) | (none) | Foo. | -| tst.js:339:4:339:9 | @param | param | tst.js:338:1:342:3 | /**\\n * ... e T\\n */ | 0 | (none) | a | T | -| tst.js:340:4:340:10 | @return | return | tst.js:338:1:342:3 | /**\\n * ... e T\\n */ | 1 | (none) | (none) | T | -| tst.js:341:4:341:12 | @template | template | tst.js:338:1:342:3 | /**\\n * ... e T\\n */ | 2 | T | (none) | (none) | -| tst.js:345:5:345:9 | @type | type | tst.js:345:1:345:21 | /** @ty ... ing} */ | 0 | (none) | (none) | string | -| tst.js:346:5:346:9 | @type | type | tst.js:346:1:346:21 | /** @ty ... ber} */ | 0 | (none) | (none) | number | -| tst.js:347:5:347:9 | @type | type | tst.js:347:1:347:21 | /** @ty ... ber} */ | 0 | (none) | (none) | number | -| tst.js:349:5:349:9 | @type | type | tst.js:349:1:349:31 | /** @ty ... ned} */ | 0 | (none) | (none) | (string\|undefined) | -| tst.js:352:4:352:9 | @param | param | tst.js:351:1:353:3 | /**\\n * ... ger\\n */ | 0 | [int] an integer | (none) | (none) | -| tst.js:357:4:357:9 | @param | param | tst.js:356:1:359:3 | /**\\n * ... ion\\n */ | 0 | the array to sort\n | array | Array. | -| tst.js:358:4:358:9 | @param | param | tst.js:356:1:359:3 | /**\\n * ... ion\\n */ | 1 | the comparator function | fn | function (x: !number, y: !number): number | -| tst.js:364:6:364:11 | @param | param | tst.js:363:3:365:5 | /**\\n ... p\\n */ | 0 | (none) | p | T1 | -| tst.js:369:6:369:11 | @param | param | tst.js:368:3:370:5 | /**\\n ... p\\n */ | 0 | (none) | p | T2 | -| tst.js:376:6:376:11 | @param | param | tst.js:375:3:377:5 | /**\\n ... p\\n */ | 0 | (none) | p | T3 | -| tst.js:381:6:381:11 | @param | param | tst.js:380:3:382:5 | /**\\n ... p\\n */ | 0 | (none) | p | T4 | diff --git a/javascript/ql/test/library-tests/JSDoc/JSDocTag.ql b/javascript/ql/test/library-tests/JSDoc/JSDocTag.ql deleted file mode 100644 index 095b9d6723d1..000000000000 --- a/javascript/ql/test/library-tests/JSDoc/JSDocTag.ql +++ /dev/null @@ -1,8 +0,0 @@ -import semmle.javascript.JSDoc - -from JSDocTag jsdt, string descr, string name, string tp -where - (if exists(jsdt.getDescription()) then descr = jsdt.getDescription() else descr = "(none)") and - (if exists(jsdt.getName()) then name = jsdt.getName() else name = "(none)") and - (if exists(jsdt.getType()) then tp = jsdt.getType().toString() else tp = "(none)") -select jsdt, jsdt.getTitle(), jsdt.getParent(), jsdt.getIndex(), descr, name, tp diff --git a/javascript/ql/test/library-tests/JSDoc/JSDocTag.qll b/javascript/ql/test/library-tests/JSDoc/JSDocTag.qll new file mode 100644 index 000000000000..e416e352617d --- /dev/null +++ b/javascript/ql/test/library-tests/JSDoc/JSDocTag.qll @@ -0,0 +1,12 @@ +import semmle.javascript.JSDoc + +query predicate test_JSDocTag( + JSDocTag jsdt, string res0, JSDoc res1, int res2, string descr, string name, string tp +) { + (if exists(jsdt.getDescription()) then descr = jsdt.getDescription() else descr = "(none)") and + (if exists(jsdt.getName()) then name = jsdt.getName() else name = "(none)") and + (if exists(jsdt.getType()) then tp = jsdt.getType().toString() else tp = "(none)") and + res0 = jsdt.getTitle() and + res1 = jsdt.getParent() and + res2 = jsdt.getIndex() +} diff --git a/javascript/ql/test/library-tests/JSDoc/JSDocTypeExpr.expected b/javascript/ql/test/library-tests/JSDoc/JSDocTypeExpr.expected deleted file mode 100644 index 63a6565397ff..000000000000 --- a/javascript/ql/test/library-tests/JSDoc/JSDocTypeExpr.expected +++ /dev/null @@ -1,121 +0,0 @@ -| !Foo. | @type | 0 | -| !Foo. | @type | 0 | -| !Object | @type | 0 | -| !number | function (x: !number, y: !number): number | 0 | -| !number | function (x: !number, y: !number): number | 1 | -| (string\|number) | @typedef | 0 | -| (string\|number\|null) | @param | 0 | -| (string\|undefined) | @type | 0 | -| * | @param | 0 | -| ...[number] | function (string, ...[number]): number | 1 | -| ...number | @param | 0 | -| ? | @param | 0 | -| ?string | ?string= | 0 | -| ?string= | function (?string=, number=) | 0 | -| A | A. | -1 | -| A | A. | -1 | -| A. | @extends | 0 | -| A. | @extends | 0 | -| Array | Array. | -1 | -| Array | Array. | -1 | -| Array. | @type | 0 | -| Array. | @param | 0 | -| DOMException | @throws | 0 | -| Element | @param | 0 | -| Element | @return | 0 | -| Foo | Foo. | -1 | -| Foo | Foo. | -1 | -| Foo | Foo. | -1 | -| Foo | Foo. | -1 | -| Foo | Foo. | -1 | -| Foo | Foo. | -1 | -| Foo | Foo. | -1 | -| Foo. | @type | 0 | -| Foo. | @param | 0 | -| Foo. | @type | 0 | -| Foo. | @implements | 0 | -| Foo. | !Foo. | 0 | -| Foo. | !Foo. | 0 | -| Foo. | @implements | 0 | -| Function | Array. | 0 | -| MyMap | MyMap. | -1 | -| MyMap. | @type | 0 | -| Object | !Object | 0 | -| Object | @return | 0 | -| Shape | @extends | 0 | -| Shape | @implements | 0 | -| T | @param | 0 | -| T | @param | 0 | -| T | @param | 0 | -| T | @param | 0 | -| T | @return | 0 | -| T | @return | 0 | -| T | @return | 0 | -| T1 | @param | 0 | -| T2 | @param | 0 | -| T3 | @param | 0 | -| T4 | @param | 0 | -| U | A. | 0 | -| X | @extends | 0 | -| X | Foo. | 0 | -| Y | Foo. | 0 | -| Y | Foo. | 0 | -| [number] | ...[number] | 0 | -| boolean | @define | 0 | -| boolean | @define | 0 | -| boolean | @return | 0 | -| boolean | function (string, boolean) | 1 | -| function (): number | @param | 0 | -| function (?string=, number=) | @param | 0 | -| function (new: goog.ui.Menu, string) | @param | 0 | -| function (string, ...[number]): number | @param | 0 | -| function (string, boolean) | @param | 0 | -| function (this: goog.ui.Menu, string) | @param | 0 | -| function (x: !number, y: !number): number | @param | 0 | -| goog.NumberLike | @param | 0 | -| goog.ds.BasicNodeList | @extends | 0 | -| goog.ui.Menu | function (new: goog.ui.Menu, string) | -2 | -| goog.ui.Menu | function (this: goog.ui.Menu, string) | -2 | -| null | (string\|number\|null) | 2 | -| number | !number | 0 | -| number | !number | 0 | -| number | (string\|number) | 1 | -| number | (string\|number\|null) | 1 | -| number | ...number | 0 | -| number | @enum | 0 | -| number | @param | 0 | -| number | @type | 0 | -| number | @type | 0 | -| number | Array. | 0 | -| number | Foo. | 0 | -| number | MyMap. | 1 | -| number | [number] | 0 | -| number | function (): number | -1 | -| number | function (string, ...[number]): number | -1 | -| number | function (x: !number, y: !number): number | -1 | -| number | number= | 0 | -| number | number= | 0 | -| number | number? | 0 | -| number | {myNum: number, myObject} | 0 | -| number= | @param | 0 | -| number= | function (?string=, number=) | 1 | -| number? | @type | 0 | -| string | (string\|number) | 0 | -| string | (string\|number\|null) | 0 | -| string | (string\|undefined) | 0 | -| string | ?string | 0 | -| string | @return | 0 | -| string | @type | 0 | -| string | @type | 0 | -| string | @type | 0 | -| string | A. | 0 | -| string | Foo. | 0 | -| string | Foo. | 0 | -| string | Foo. | 0 | -| string | MyMap. | 0 | -| string | function (new: goog.ui.Menu, string) | 0 | -| string | function (string, ...[number]): number | 0 | -| string | function (string, boolean) | 0 | -| string | function (this: goog.ui.Menu, string) | 0 | -| undefined | (string\|undefined) | 1 | -| {myNum: number, myObject} | @type | 0 | diff --git a/javascript/ql/test/library-tests/JSDoc/JSDocTypeExpr.ql b/javascript/ql/test/library-tests/JSDoc/JSDocTypeExpr.ql deleted file mode 100644 index 3ee0c428d492..000000000000 --- a/javascript/ql/test/library-tests/JSDoc/JSDocTypeExpr.ql +++ /dev/null @@ -1,4 +0,0 @@ -import semmle.javascript.JSDoc - -from JSDocTypeExpr jsdte -select jsdte, jsdte.getParent(), jsdte.getIndex() diff --git a/javascript/ql/test/library-tests/JSDoc/JSDocTypeExpr.qll b/javascript/ql/test/library-tests/JSDoc/JSDocTypeExpr.qll new file mode 100644 index 000000000000..83403df68d48 --- /dev/null +++ b/javascript/ql/test/library-tests/JSDoc/JSDocTypeExpr.qll @@ -0,0 +1,5 @@ +import semmle.javascript.JSDoc + +query predicate test_JSDocTypeExpr(JSDocTypeExpr jsdte, JSDocTypeExprParent res0, int res1) { + res0 = jsdte.getParent() and res1 = jsdte.getIndex() +} diff --git a/javascript/ql/test/library-tests/JSDoc/JSDocUnionTypeExpr.expected b/javascript/ql/test/library-tests/JSDoc/JSDocUnionTypeExpr.expected deleted file mode 100644 index 06a107228755..000000000000 --- a/javascript/ql/test/library-tests/JSDoc/JSDocUnionTypeExpr.expected +++ /dev/null @@ -1,7 +0,0 @@ -| (string\|number) | number | -| (string\|number) | string | -| (string\|number\|null) | null | -| (string\|number\|null) | number | -| (string\|number\|null) | string | -| (string\|undefined) | string | -| (string\|undefined) | undefined | diff --git a/javascript/ql/test/library-tests/JSDoc/JSDocUnionTypeExpr.ql b/javascript/ql/test/library-tests/JSDoc/JSDocUnionTypeExpr.ql deleted file mode 100644 index 0f7c3b62f047..000000000000 --- a/javascript/ql/test/library-tests/JSDoc/JSDocUnionTypeExpr.ql +++ /dev/null @@ -1,4 +0,0 @@ -import semmle.javascript.JSDoc - -from JSDocUnionTypeExpr jsdute -select jsdute, jsdute.getAnAlternative() diff --git a/javascript/ql/test/library-tests/JSDoc/JSDocUnionTypeExpr.qll b/javascript/ql/test/library-tests/JSDoc/JSDocUnionTypeExpr.qll new file mode 100644 index 000000000000..132cb1f54818 --- /dev/null +++ b/javascript/ql/test/library-tests/JSDoc/JSDocUnionTypeExpr.qll @@ -0,0 +1,5 @@ +import semmle.javascript.JSDoc + +query predicate test_JSDocUnionTypeExpr(JSDocUnionTypeExpr jsdute, JSDocTypeExpr res) { + res = jsdute.getAnAlternative() +} diff --git a/javascript/ql/test/library-tests/JSDoc/ObjectExpr_getDocumentation.expected b/javascript/ql/test/library-tests/JSDoc/ObjectExpr_getDocumentation.expected deleted file mode 100644 index bd5fd3db7d40..000000000000 --- a/javascript/ql/test/library-tests/JSDoc/ObjectExpr_getDocumentation.expected +++ /dev/null @@ -1,4 +0,0 @@ -| tst.js:48:25:48:36 | { 'x': 321 } | tst.js:48:12:48:23 | /** @dict */ | -| tst.js:55:20:59:1 | {\\n TRU ... BE: 0\\n} | tst.js:51:1:54:3 | /**\\n * ... er}\\n */ | -| tst.js:117:43:119:9 | {\\n ... } | tst.js:117:9:117:40 | /** @le ... ype} */ | -| tst.js:192:27:192:36 | { x: 321 } | tst.js:192:12:192:25 | /** @struct */ | diff --git a/javascript/ql/test/library-tests/JSDoc/ObjectExpr_getDocumentation.ql b/javascript/ql/test/library-tests/JSDoc/ObjectExpr_getDocumentation.ql deleted file mode 100644 index fcac671516fa..000000000000 --- a/javascript/ql/test/library-tests/JSDoc/ObjectExpr_getDocumentation.ql +++ /dev/null @@ -1,4 +0,0 @@ -import javascript - -from ObjectExpr oe -select oe, oe.getDocumentation() diff --git a/javascript/ql/test/library-tests/JSDoc/ObjectExpr_getDocumentation.qll b/javascript/ql/test/library-tests/JSDoc/ObjectExpr_getDocumentation.qll new file mode 100644 index 000000000000..eae90b364f12 --- /dev/null +++ b/javascript/ql/test/library-tests/JSDoc/ObjectExpr_getDocumentation.qll @@ -0,0 +1,5 @@ +import javascript + +query predicate test_ObjectExpr_getDocumentation(ObjectExpr oe, JSDoc res) { + res = oe.getDocumentation() +} diff --git a/javascript/ql/test/library-tests/JSDoc/ParExpr_getDocumentation.expected b/javascript/ql/test/library-tests/JSDoc/ParExpr_getDocumentation.expected deleted file mode 100644 index 26d20cfe2835..000000000000 --- a/javascript/ql/test/library-tests/JSDoc/ParExpr_getDocumentation.expected +++ /dev/null @@ -1,2 +0,0 @@ -| tst.js:117:42:119:10 | ({\\n ... }) | tst.js:117:9:117:40 | /** @le ... ype} */ | -| tst.js:259:40:259:50 | (new Foo()) | tst.js:259:11:259:38 | /** @ty ... ng>} */ | diff --git a/javascript/ql/test/library-tests/JSDoc/ParExpr_getDocumentation.ql b/javascript/ql/test/library-tests/JSDoc/ParExpr_getDocumentation.ql deleted file mode 100644 index c6dc81b259e1..000000000000 --- a/javascript/ql/test/library-tests/JSDoc/ParExpr_getDocumentation.ql +++ /dev/null @@ -1,4 +0,0 @@ -import javascript - -from ParExpr pe -select pe, pe.getDocumentation() diff --git a/javascript/ql/test/library-tests/JSDoc/ParExpr_getDocumentation.qll b/javascript/ql/test/library-tests/JSDoc/ParExpr_getDocumentation.qll new file mode 100644 index 000000000000..e2f63af6b2e8 --- /dev/null +++ b/javascript/ql/test/library-tests/JSDoc/ParExpr_getDocumentation.qll @@ -0,0 +1,3 @@ +import javascript + +query predicate test_ParExpr_getDocumentation(ParExpr pe, JSDoc res) { res = pe.getDocumentation() } diff --git a/javascript/ql/test/library-tests/JSDoc/Parameter_getDocumentation.expected b/javascript/ql/test/library-tests/JSDoc/Parameter_getDocumentation.expected deleted file mode 100644 index d33a6edd94e0..000000000000 --- a/javascript/ql/test/library-tests/JSDoc/Parameter_getDocumentation.expected +++ /dev/null @@ -1,2 +0,0 @@ -| tst.js:149:28:149:28 | a | tst.js:149:14:149:26 | /** number */ | -| tst.js:149:45:149:45 | b | tst.js:149:31:149:43 | /** number */ | diff --git a/javascript/ql/test/library-tests/JSDoc/Parameter_getDocumentation.ql b/javascript/ql/test/library-tests/JSDoc/Parameter_getDocumentation.ql deleted file mode 100644 index d06c69a015c8..000000000000 --- a/javascript/ql/test/library-tests/JSDoc/Parameter_getDocumentation.ql +++ /dev/null @@ -1,4 +0,0 @@ -import javascript - -from Parameter p -select p, p.getDocumentation() diff --git a/javascript/ql/test/library-tests/JSDoc/Parameter_getDocumentation.qll b/javascript/ql/test/library-tests/JSDoc/Parameter_getDocumentation.qll new file mode 100644 index 000000000000..55932cda9ff3 --- /dev/null +++ b/javascript/ql/test/library-tests/JSDoc/Parameter_getDocumentation.qll @@ -0,0 +1,5 @@ +import javascript + +query predicate test_Parameter_getDocumentation(Parameter p, JSDoc res) { + res = p.getDocumentation() +} diff --git a/javascript/ql/test/library-tests/JSDoc/VarDeclStmt_getDocumentation.expected b/javascript/ql/test/library-tests/JSDoc/VarDeclStmt_getDocumentation.expected deleted file mode 100644 index 3d9213c65467..000000000000 --- a/javascript/ql/test/library-tests/JSDoc/VarDeclStmt_getDocumentation.expected +++ /dev/null @@ -1,17 +0,0 @@ -| tst.js:5:15:5:36 | var MY_ ... stout'; | tst.js:5:1:5:13 | /** @const */ | -| tst.js:24:1:24:24 | var ENA ... = true; | tst.js:23:1:23:24 | /** @de ... ean} */ | -| tst.js:214:1:214:18 | var hexId = hexId; | tst.js:210:1:213:3 | /**\\n * ... ng}\\n */ | -| tst.js:224:1:224:6 | var o; | tst.js:223:1:223:40 | /** @ty ... ct}} */ | -| tst.js:227:1:227:6 | var x; | tst.js:226:1:226:22 | /** @ty ... er?} */ | -| tst.js:230:1:230:6 | var y; | tst.js:229:1:229:22 | /** @ty ... ect} */ | -| tst.js:244:1:244:6 | var f; | tst.js:232:1:243:3 | /**\\n * ... p10\\n */ | -| tst.js:250:1:250:44 | var Foo ... ull; }; | tst.js:246:1:249:3 | /**\\n * ... e T\\n */ | -| tst.js:258:30:258:49 | var foo = new Foo(); | tst.js:258:1:258:28 | /** @ty ... ng>} */ | -| tst.js:273:1:273:27 | var MyM ... () { }; | tst.js:269:1:272:3 | /**\\n * ... Val\\n */ | -| tst.js:275:39:275:46 | var map; | tst.js:275:1:275:37 | /** @ty ... er>} */ | -| tst.js:288:24:288:32 | var fooX; | tst.js:288:1:288:22 | /** @ty ... } */ | -| tst.js:289:24:289:32 | var fooY; | tst.js:289:1:289:22 | /** @ty ... } */ | -| tst.js:345:23:345:70 | var msg ... orld"); | tst.js:345:1:345:21 | /** @ty ... ing} */ | -| tst.js:346:23:346:58 | var sum ... ity(2); | tst.js:346:1:346:21 | /** @ty ... ber} */ | -| tst.js:347:23:347:60 | var sum ... y("2"); | tst.js:347:1:347:21 | /** @ty ... ber} */ | -| tst.js:349:33:349:52 | var string_or_undef; | tst.js:349:1:349:31 | /** @ty ... ned} */ | diff --git a/javascript/ql/test/library-tests/JSDoc/VarDeclStmt_getDocumentation.ql b/javascript/ql/test/library-tests/JSDoc/VarDeclStmt_getDocumentation.ql deleted file mode 100644 index 42ee6044a81d..000000000000 --- a/javascript/ql/test/library-tests/JSDoc/VarDeclStmt_getDocumentation.ql +++ /dev/null @@ -1,4 +0,0 @@ -import javascript - -from VarDeclStmt vds -select vds, vds.getDocumentation() diff --git a/javascript/ql/test/library-tests/JSDoc/VarDeclStmt_getDocumentation.qll b/javascript/ql/test/library-tests/JSDoc/VarDeclStmt_getDocumentation.qll new file mode 100644 index 000000000000..299987af604a --- /dev/null +++ b/javascript/ql/test/library-tests/JSDoc/VarDeclStmt_getDocumentation.qll @@ -0,0 +1,5 @@ +import javascript + +query predicate test_VarDeclStmt_getDocumentation(VarDeclStmt vds, JSDoc res) { + res = vds.getDocumentation() +} diff --git a/javascript/ql/test/library-tests/JSDoc/getParameterTag.expected b/javascript/ql/test/library-tests/JSDoc/getParameterTag.expected deleted file mode 100644 index fb0f9b14daa2..000000000000 --- a/javascript/ql/test/library-tests/JSDoc/getParameterTag.expected +++ /dev/null @@ -1,15 +0,0 @@ -| tst.js:146:37:146:44 | groupNum | groupNum | tst.js:142:4:142:9 | @param | groupNum | number | -| tst.js:146:47:146:50 | term | term | tst.js:143:4:143:9 | @param | term | (string\|number\|null) | -| tst.js:166:59:166:65 | element | element | tst.js:163:4:163:9 | @param | element | Element | -| tst.js:220:28:220:28 | x | x | tst.js:219:5:219:10 | @param | x | goog.NumberLike | -| tst.js:256:30:256:30 | t | t | tst.js:255:5:255:10 | @param | t | T | -| tst.js:266:16:266:16 | t | t | tst.js:262:4:262:9 | @param | t | T | -| tst.js:295:22:295:25 | fooY | fooY | tst.js:294:5:294:10 | @param | fooY | Foo. | -| tst.js:307:31:307:31 | t | t | tst.js:306:5:306:10 | @param | t | T | -| tst.js:343:21:343:21 | a | a | tst.js:339:4:339:9 | @param | a | T | -| tst.js:360:15:360:19 | array | array | tst.js:357:4:357:9 | @param | array | Array. | -| tst.js:360:22:360:23 | fn | fn | tst.js:358:4:358:9 | @param | fn | function (x: !number, y: !number): number | -| tst.js:366:27:366:27 | p | p | tst.js:364:6:364:11 | @param | p | T1 | -| tst.js:371:15:371:15 | p | p | tst.js:369:6:369:11 | @param | p | T2 | -| tst.js:378:15:378:15 | p | p | tst.js:376:6:376:11 | @param | p | T3 | -| tst.js:383:15:383:15 | p | p | tst.js:381:6:381:11 | @param | p | T4 | diff --git a/javascript/ql/test/library-tests/JSDoc/getParameterTag.ql b/javascript/ql/test/library-tests/JSDoc/getParameterTag.ql deleted file mode 100644 index ea8a14dcecbe..000000000000 --- a/javascript/ql/test/library-tests/JSDoc/getParameterTag.ql +++ /dev/null @@ -1,5 +0,0 @@ -import javascript - -from Parameter param, JSDocTag tag -where tag = param.getJSDocTag() -select param, param.getName(), tag, tag.getName(), tag.getType() diff --git a/javascript/ql/test/library-tests/JSDoc/getParameterTag.qll b/javascript/ql/test/library-tests/JSDoc/getParameterTag.qll new file mode 100644 index 000000000000..f1497769120d --- /dev/null +++ b/javascript/ql/test/library-tests/JSDoc/getParameterTag.qll @@ -0,0 +1,10 @@ +import javascript + +query predicate test_getParameterTag( + Parameter param, string res0, JSDocTag tag, string res1, JSDocTypeExpr res2 +) { + tag = param.getJSDocTag() and + res0 = param.getName() and + res1 = tag.getName() and + res2 = tag.getType() +} diff --git a/javascript/ql/test/library-tests/JSDoc/next_token.expected b/javascript/ql/test/library-tests/JSDoc/next_token.expected deleted file mode 100644 index fa1034f79dae..000000000000 --- a/javascript/ql/test/library-tests/JSDoc/next_token.expected +++ /dev/null @@ -1,91 +0,0 @@ -| tst.js:1:1:1:117 | // Test ... mpiler, | tst.js:5:15:5:17 | var | -| tst.js:2:1:2:118 | // whic ... se 2.0; | tst.js:5:15:5:17 | var | -| tst.js:3:1:3:20 | // see file COPYING. | tst.js:5:15:5:17 | var | -| tst.js:5:1:5:13 | /** @const */ | tst.js:5:15:5:17 | var | -| tst.js:7:1:11:3 | /**\\n * ... ng}\\n */ | tst.js:12:1:12:11 | mynamespace | -| tst.js:14:1:14:13 | /** @const */ | tst.js:14:15:14:21 | MyClass | -| tst.js:16:1:19:3 | /**\\n * ... tor\\n */ | tst.js:20:1:20:8 | function | -| tst.js:23:1:23:24 | /** @de ... ean} */ | tst.js:24:1:24:3 | var | -| tst.js:26:1:26:24 | /** @de ... ean} */ | tst.js:27:1:27:4 | goog | -| tst.js:29:1:35:3 | /**\\n * ... ().\\n */ | tst.js:36:1:36:11 | BN_EditUtil | -| tst.js:39:1:42:3 | /**\\n * ... ict\\n */ | tst.js:43:1:43:8 | function | -| tst.js:46:16:46:25 | // warning | tst.js:48:1:48:3 | var | -| tst.js:48:12:48:23 | /** @dict */ | tst.js:48:25:48:25 | { | -| tst.js:49:16:49:25 | // warning | tst.js:55:1:55:7 | project | -| tst.js:51:1:54:3 | /**\\n * ... er}\\n */ | tst.js:55:1:55:7 | project | -| tst.js:61:1:61:14 | /** @export */ | tst.js:62:1:62:3 | foo | -| tst.js:65:1:69:3 | /**\\n * ... st}\\n */ | tst.js:70:1:70:4 | goog | -| tst.js:73:1:77:3 | /**\\n * ... tor\\n */ | tst.js:78:1:78:5 | sloth | -| tst.js:80:1:83:3 | /**\\n * ... nal\\n */ | tst.js:84:1:84:5 | sloth | -| tst.js:86:1:89:3 | /**\\n * ... ace\\n */ | tst.js:90:1:90:8 | function | -| tst.js:93:1:96:3 | /**\\n * ... pe}\\n */ | tst.js:97:1:97:8 | function | -| tst.js:101:1:103:17 | /**\\n * ... tDoc */ | tst.js:104:1:104:7 | project | -| tst.js:107:1:111:3 | /**\\n * ... pe}\\n */ | tst.js:112:1:112:8 | function | -| tst.js:117:9:117:40 | /** @le ... ype} */ | tst.js:117:42:117:42 | ( | -| tst.js:121:1:126:3 | /**\\n * ... sh:\\n */ | tst.js:129:1:129:8 | function | -| tst.js:128:1:128:21 | /** @no ... ects */ | tst.js:129:1:129:8 | function | -| tst.js:131:1:136:3 | /**\\n * ... age\\n */ | tst.js:137:1:137:4 | goog | -| tst.js:140:1:145:3 | /**\\n * ... ng.\\n */ | tst.js:146:1:146:4 | goog | -| tst.js:149:14:149:26 | /** number */ | tst.js:149:28:149:28 | a | -| tst.js:149:31:149:43 | /** number */ | tst.js:149:45:149:45 | b | -| tst.js:153:1:157:3 | /**\\n * ... ate\\n */ | tst.js:158:1:158:4 | this | -| tst.js:160:1:165:3 | /**\\n * ... ted\\n */ | tst.js:166:1:166:4 | goog | -| tst.js:169:1:172:3 | /**\\n * ... ID.\\n */ | tst.js:173:1:173:4 | goog | -| tst.js:177:10:177:22 | /** number */ | tst.js:177:24:177:26 | foo | -| tst.js:179:1:182:3 | /**\\n * ... uct\\n */ | tst.js:183:1:183:8 | function | -| tst.js:187:24:187:28 | // OK | tst.js:188:1:188:4 | obj1 | -| tst.js:188:21:188:25 | // OK | tst.js:189:1:189:4 | obj1 | -| tst.js:189:22:189:31 | // warning | tst.js:190:1:190:4 | obj1 | -| tst.js:190:14:190:23 | // warning | tst.js:192:1:192:3 | var | -| tst.js:192:12:192:25 | /** @struct */ | tst.js:192:27:192:27 | { | -| tst.js:193:19:193:28 | // warning | tst.js:195:1:195:4 | chat | -| tst.js:196:9:200:11 | /**\\n ... */ | tst.js:201:9:201:16 | function | -| tst.js:205:1:207:3 | /**\\n * ... on}\\n */ | tst.js:208:1:208:19 | DOMApplicationCache | -| tst.js:210:1:213:3 | /**\\n * ... ng}\\n */ | tst.js:214:1:214:3 | var | -| tst.js:216:1:216:33 | /** @ty ... er)} */ | tst.js:217:1:217:4 | goog | -| tst.js:219:1:219:55 | /** @pa ... ing. */ | tst.js:220:1:220:4 | goog | -| tst.js:223:1:223:40 | /** @ty ... ct}} */ | tst.js:224:1:224:3 | var | -| tst.js:226:1:226:22 | /** @ty ... er?} */ | tst.js:227:1:227:3 | var | -| tst.js:229:1:229:22 | /** @ty ... ect} */ | tst.js:230:1:230:3 | var | -| tst.js:232:1:243:3 | /**\\n * ... p10\\n */ | tst.js:244:1:244:3 | var | -| tst.js:246:1:249:3 | /**\\n * ... e T\\n */ | tst.js:250:1:250:3 | var | -| tst.js:252:1:252:18 | /** @return {T} */ | tst.js:253:1:253:3 | Foo | -| tst.js:255:1:255:19 | /** @param {T} t */ | tst.js:256:1:256:3 | Foo | -| tst.js:258:1:258:28 | /** @ty ... ng>} */ | tst.js:258:30:258:32 | var | -| tst.js:259:11:259:38 | /** @ty ... ng>} */ | tst.js:259:40:259:40 | ( | -| tst.js:261:1:265:3 | /**\\n * ... e T\\n */ | tst.js:266:1:266:3 | Bar | -| tst.js:267:29:267:52 | // bar ... string> | tst.js:273:1:273:3 | var | -| tst.js:269:1:272:3 | /**\\n * ... Val\\n */ | tst.js:273:1:273:3 | var | -| tst.js:275:1:275:37 | /** @ty ... er>} */ | tst.js:275:39:275:41 | var | -| tst.js:275:48:275:77 | // Key ... number. | tst.js:280:1:280:1 | X | -| tst.js:277:1:279:3 | /**\\n * ... tor\\n */ | tst.js:280:1:280:1 | X | -| tst.js:282:1:285:3 | /**\\n * ... tor\\n */ | tst.js:286:1:286:1 | Y | -| tst.js:288:1:288:22 | /** @ty ... } */ | tst.js:288:24:288:26 | var | -| tst.js:289:1:289:22 | /** @ty ... } */ | tst.js:289:24:289:26 | var | -| tst.js:291:14:291:21 | // Error | tst.js:292:1:292:4 | fooY | -| tst.js:292:14:292:21 | // Error | tst.js:295:1:295:9 | takesFooY | -| tst.js:294:1:294:28 | /** @pa ... fooY */ | tst.js:295:1:295:9 | takesFooY | -| tst.js:297:18:297:23 | // OK. | tst.js:298:1:298:9 | takesFooY | -| tst.js:298:18:298:25 | // Error | tst.js:304:1:304:1 | A | -| tst.js:300:1:303:3 | /**\\n * ... e T\\n */ | tst.js:304:1:304:1 | A | -| tst.js:306:1:306:19 | /** @param {T} t */ | tst.js:307:1:307:1 | A | -| tst.js:309:1:312:3 | /**\\n * ... g>}\\n */ | tst.js:313:1:313:1 | B | -| tst.js:315:1:319:3 | /**\\n * ... U>}\\n */ | tst.js:320:1:320:1 | C | -| tst.js:322:1:325:3 | /**\\n * ... e T\\n */ | tst.js:326:1:326:3 | Foo | -| tst.js:328:1:328:18 | /** @return {T} */ | tst.js:329:1:329:3 | Foo | -| tst.js:331:1:335:3 | /**\\n * ... r>}\\n */ | tst.js:336:1:336:7 | FooImpl | -| tst.js:336:27:336:72 | // Erro ... e twice | tst.js:343:1:343:8 | identity | -| tst.js:338:1:342:3 | /**\\n * ... e T\\n */ | tst.js:343:1:343:8 | identity | -| tst.js:345:1:345:21 | /** @ty ... ing} */ | tst.js:345:23:345:25 | var | -| tst.js:345:72:345:76 | // OK | tst.js:346:23:346:25 | var | -| tst.js:346:1:346:21 | /** @ty ... ber} */ | tst.js:346:23:346:25 | var | -| tst.js:346:60:346:64 | // OK | tst.js:347:23:347:25 | var | -| tst.js:347:1:347:21 | /** @ty ... ber} */ | tst.js:347:23:347:25 | var | -| tst.js:347:62:347:77 | // Type mismatch | tst.js:349:33:349:35 | var | -| tst.js:349:1:349:31 | /** @ty ... ned} */ | tst.js:349:33:349:35 | var | -| tst.js:351:1:353:3 | /**\\n * ... ger\\n */ | tst.js:354:1:354:8 | function | -| tst.js:356:1:359:3 | /**\\n * ... ion\\n */ | tst.js:360:1:360:8 | function | -| tst.js:363:3:365:5 | /**\\n ... p\\n */ | tst.js:366:3:366:15 | classicMethod | -| tst.js:368:3:370:5 | /**\\n ... p\\n */ | tst.js:371:3:371:13 | fancyMethod | -| tst.js:375:3:377:5 | /**\\n ... p\\n */ | tst.js:378:3:378:13 | constructor | -| tst.js:380:3:382:5 | /**\\n ... p\\n */ | tst.js:383:3:383:13 | classMethod | diff --git a/javascript/ql/test/library-tests/JSDoc/next_token.ql b/javascript/ql/test/library-tests/JSDoc/next_token.ql deleted file mode 100644 index 85d37bbbdcbc..000000000000 --- a/javascript/ql/test/library-tests/JSDoc/next_token.ql +++ /dev/null @@ -1,4 +0,0 @@ -import javascript - -from Comment c -select c, c.getNextToken() diff --git a/javascript/ql/test/library-tests/JSDoc/next_token.qll b/javascript/ql/test/library-tests/JSDoc/next_token.qll new file mode 100644 index 000000000000..defe9da6f4dc --- /dev/null +++ b/javascript/ql/test/library-tests/JSDoc/next_token.qll @@ -0,0 +1,3 @@ +import javascript + +query predicate test_next_token(Comment c, Token res) { res = c.getNextToken() } diff --git a/javascript/ql/test/library-tests/JSDoc/tests.expected b/javascript/ql/test/library-tests/JSDoc/tests.expected new file mode 100644 index 000000000000..b7d0c2124802 --- /dev/null +++ b/javascript/ql/test/library-tests/JSDoc/tests.expected @@ -0,0 +1,568 @@ +test_JSDocUnionTypeExpr +| (string\|number) | number | +| (string\|number) | string | +| (string\|number\|null) | null | +| (string\|number\|null) | number | +| (string\|number\|null) | string | +| (string\|undefined) | string | +| (string\|undefined) | undefined | +test_JSDocArrayTypeExpr +| [number] | 0 | number | +test_Parameter_getDocumentation +| tst.js:149:28:149:28 | a | tst.js:149:14:149:26 | /** number */ | +| tst.js:149:45:149:45 | b | tst.js:149:31:149:43 | /** number */ | +test_JSDocRestParameterTypeExpr +| ...[number] | [number] | +| ...number | number | +test_AssignExpr_getDocumentation +| tst.js:12:1:12:29 | mynames ... 'stout' | tst.js:7:1:11:3 | /**\\n * ... ng}\\n */ | +| tst.js:14:15:14:39 | MyClass ... 'stout' | tst.js:14:1:14:13 | /** @const */ | +| tst.js:27:1:27:32 | goog.us ... = false | tst.js:26:1:26:24 | /** @de ... ean} */ | +| tst.js:36:1:37:1 | BN_Edit ... de) {\\n} | tst.js:29:1:35:3 | /**\\n * ... ().\\n */ | +| tst.js:55:1:59:1 | project ... BE: 0\\n} | tst.js:51:1:54:3 | /**\\n * ... er}\\n */ | +| tst.js:62:1:63:1 | foo.MyP ... n() {\\n} | tst.js:61:1:61:14 | /** @export */ | +| tst.js:70:1:71:1 | goog.ds ... n() {\\n} | tst.js:65:1:69:3 | /**\\n * ... st}\\n */ | +| tst.js:78:1:78:35 | sloth.M ... n() { } | tst.js:73:1:77:3 | /**\\n * ... tor\\n */ | +| tst.js:84:1:84:52 | sloth.M ... n() { } | tst.js:80:1:83:3 | /**\\n * ... nal\\n */ | +| tst.js:104:1:105:1 | project ... n() {\\n} | tst.js:101:1:103:17 | /**\\n * ... tDoc */ | +| tst.js:137:1:138:1 | goog.ne ... n() {\\n} | tst.js:131:1:136:3 | /**\\n * ... age\\n */ | +| tst.js:146:1:147:1 | goog.Ba ... rm) {\\n} | tst.js:140:1:145:3 | /**\\n * ... ng.\\n */ | +| tst.js:158:1:158:19 | this.handlers_ = [] | tst.js:153:1:157:3 | /**\\n * ... ate\\n */ | +| tst.js:166:1:167:1 | goog.ui ... nt) {\\n} | tst.js:160:1:165:3 | /**\\n * ... ted\\n */ | +| tst.js:173:1:175:1 | goog.Ba ... n id;\\n} | tst.js:169:1:172:3 | /**\\n * ... ID.\\n */ | +| tst.js:208:1:208:56 | DOMAppl ... n() { } | tst.js:205:1:207:3 | /**\\n * ... on}\\n */ | +| tst.js:220:1:221:1 | goog.re ... (x) {\\n} | tst.js:219:1:219:55 | /** @pa ... ing. */ | +| tst.js:253:1:253:53 | Foo.pro ... alue; } | tst.js:252:1:252:18 | /** @return {T} */ | +| tst.js:256:1:256:51 | Foo.pro ... = t; } | tst.js:255:1:255:19 | /** @param {T} t */ | +| tst.js:266:1:266:21 | Bar = f ... (t) { } | tst.js:261:1:265:3 | /**\\n * ... e T\\n */ | +| tst.js:280:1:280:18 | X = function() { } | tst.js:277:1:279:3 | /**\\n * ... tor\\n */ | +| tst.js:286:1:286:18 | Y = function() { } | tst.js:282:1:285:3 | /**\\n * ... tor\\n */ | +| tst.js:295:1:295:30 | takesFo ... oY) { } | tst.js:294:1:294:28 | /** @pa ... fooY */ | +| tst.js:304:1:304:18 | A = function() { } | tst.js:300:1:303:3 | /**\\n * ... e T\\n */ | +| tst.js:307:1:307:36 | A.proto ... (t) { } | tst.js:306:1:306:19 | /** @param {T} t */ | +| tst.js:313:1:313:18 | B = function() { } | tst.js:309:1:312:3 | /**\\n * ... g>}\\n */ | +| tst.js:320:1:320:18 | C = function() { } | tst.js:315:1:319:3 | /**\\n * ... U>}\\n */ | +| tst.js:326:1:326:19 | Foo = function() {} | tst.js:322:1:325:3 | /**\\n * ... e T\\n */ | +| tst.js:329:1:329:33 | Foo.pro ... on() {} | tst.js:328:1:328:18 | /** @return {T} */ | +| tst.js:336:1:336:24 | FooImpl ... n() { } | tst.js:331:1:335:3 | /**\\n * ... r>}\\n */ | +| tst.js:343:1:343:36 | identit ... rn a; } | tst.js:338:1:342:3 | /**\\n * ... e T\\n */ | +test_JSDocRecordTypeExpr +| {myNum: number, myObject} | myNum | number | +| {myNum: number, myObject} | myObject | (none) | +test_JSDoc +| tst.js:5:1:5:13 | /** @const */ | | tst.js:5:1:5:13 | /** @const */ | +| tst.js:7:1:11:3 | /**\\n * ... ng}\\n */ | My namespace's favorite kind of beer. | tst.js:7:1:11:3 | /**\\n * ... ng}\\n */ | +| tst.js:14:1:14:13 | /** @const */ | | tst.js:14:1:14:13 | /** @const */ | +| tst.js:16:1:19:3 | /**\\n * ... tor\\n */ | A rectangle. | tst.js:16:1:19:3 | /**\\n * ... tor\\n */ | +| tst.js:23:1:23:24 | /** @de ... ean} */ | | tst.js:23:1:23:24 | /** @de ... ean} */ | +| tst.js:26:1:26:24 | /** @de ... ean} */ | | tst.js:26:1:26:24 | /** @de ... ean} */ | +| tst.js:29:1:35:3 | /**\\n * ... ().\\n */ | Determines whether a node is a field. | tst.js:29:1:35:3 | /**\\n * ... ().\\n */ | +| tst.js:39:1:42:3 | /**\\n * ... ict\\n */ | | tst.js:39:1:42:3 | /**\\n * ... ict\\n */ | +| tst.js:48:12:48:23 | /** @dict */ | | tst.js:48:12:48:23 | /** @dict */ | +| tst.js:51:1:54:3 | /**\\n * ... er}\\n */ | Enum for tri-state values. | tst.js:51:1:54:3 | /**\\n * ... er}\\n */ | +| tst.js:61:1:61:14 | /** @export */ | | tst.js:61:1:61:14 | /** @export */ | +| tst.js:65:1:69:3 | /**\\n * ... st}\\n */ | Immutable empty node list. | tst.js:65:1:69:3 | /**\\n * ... st}\\n */ | +| tst.js:73:1:77:3 | /**\\n * ... tor\\n */ | A class that cannot be extended. | tst.js:73:1:77:3 | /**\\n * ... tor\\n */ | +| tst.js:80:1:83:3 | /**\\n * ... nal\\n */ | A method that cannot be overridden. | tst.js:80:1:83:3 | /**\\n * ... nal\\n */ | +| tst.js:86:1:89:3 | /**\\n * ... ace\\n */ | A shape. | tst.js:86:1:89:3 | /**\\n * ... ace\\n */ | +| tst.js:93:1:96:3 | /**\\n * ... pe}\\n */ | | tst.js:93:1:96:3 | /**\\n * ... pe}\\n */ | +| tst.js:101:1:103:17 | /**\\n * ... tDoc */ | | tst.js:101:1:103:17 | /**\\n * ... tDoc */ | +| tst.js:107:1:111:3 | /**\\n * ... pe}\\n */ | A polygon. | tst.js:107:1:111:3 | /**\\n * ... pe}\\n */ | +| tst.js:117:9:117:40 | /** @le ... ype} */ | | tst.js:117:9:117:40 | /** @le ... ype} */ | +| tst.js:121:1:126:3 | /**\\n * ... sh:\\n */ | | tst.js:121:1:126:3 | /**\\n * ... sh:\\n */ | +| tst.js:128:1:128:21 | /** @no ... ects */ | | tst.js:128:1:128:21 | /** @no ... ects */ | +| tst.js:131:1:136:3 | /**\\n * ... age\\n */ | Returns the window object the foreign document resides in. | tst.js:131:1:136:3 | /**\\n * ... age\\n */ | +| tst.js:140:1:145:3 | /**\\n * ... ng.\\n */ | Queries a Baz for items. | tst.js:140:1:145:3 | /**\\n * ... ng.\\n */ | +| tst.js:149:14:149:26 | /** number */ | number | tst.js:149:14:149:26 | /** number */ | +| tst.js:149:31:149:43 | /** number */ | number | tst.js:149:31:149:43 | /** number */ | +| tst.js:153:1:157:3 | /**\\n * ... ate\\n */ | Handlers that are listening to this logger. | tst.js:153:1:157:3 | /**\\n * ... ate\\n */ | +| tst.js:160:1:165:3 | /**\\n * ... ted\\n */ | Sets the component's root element to the given element.\nConsidered protected and final. | tst.js:160:1:165:3 | /**\\n * ... ted\\n */ | +| tst.js:169:1:172:3 | /**\\n * ... ID.\\n */ | Returns the ID of the last item. | tst.js:169:1:172:3 | /**\\n * ... ID.\\n */ | +| tst.js:177:10:177:22 | /** number */ | number | tst.js:177:10:177:22 | /** number */ | +| tst.js:179:1:182:3 | /**\\n * ... uct\\n */ | | tst.js:179:1:182:3 | /**\\n * ... uct\\n */ | +| tst.js:192:12:192:25 | /** @struct */ | | tst.js:192:12:192:25 | /** @struct */ | +| tst.js:196:9:200:11 | /**\\n ... */ | Returns the roster widget element. | tst.js:196:9:200:11 | /**\\n ... */ | +| tst.js:205:1:207:3 | /**\\n * ... on}\\n */ | | tst.js:205:1:207:3 | /**\\n * ... on}\\n */ | +| tst.js:210:1:213:3 | /**\\n * ... ng}\\n */ | The message hex ID. | tst.js:210:1:213:3 | /**\\n * ... ng}\\n */ | +| tst.js:216:1:216:33 | /** @ty ... er)} */ | | tst.js:216:1:216:33 | /** @ty ... er)} */ | +| tst.js:219:1:219:55 | /** @pa ... ing. */ | | tst.js:219:1:219:55 | /** @pa ... ing. */ | +| tst.js:223:1:223:40 | /** @ty ... ct}} */ | | tst.js:223:1:223:40 | /** @ty ... ct}} */ | +| tst.js:226:1:226:22 | /** @ty ... er?} */ | | tst.js:226:1:226:22 | /** @ty ... er?} */ | +| tst.js:229:1:229:22 | /** @ty ... ect} */ | | tst.js:229:1:229:22 | /** @ty ... ect} */ | +| tst.js:232:1:243:3 | /**\\n * ... p10\\n */ | | tst.js:232:1:243:3 | /**\\n * ... p10\\n */ | +| tst.js:246:1:249:3 | /**\\n * ... e T\\n */ | | tst.js:246:1:249:3 | /**\\n * ... e T\\n */ | +| tst.js:252:1:252:18 | /** @return {T} */ | | tst.js:252:1:252:18 | /** @return {T} */ | +| tst.js:255:1:255:19 | /** @param {T} t */ | | tst.js:255:1:255:19 | /** @param {T} t */ | +| tst.js:258:1:258:28 | /** @ty ... ng>} */ | | tst.js:258:1:258:28 | /** @ty ... ng>} */ | +| tst.js:259:11:259:38 | /** @ty ... ng>} */ | | tst.js:259:11:259:38 | /** @ty ... ng>} */ | +| tst.js:261:1:265:3 | /**\\n * ... e T\\n */ | | tst.js:261:1:265:3 | /**\\n * ... e T\\n */ | +| tst.js:269:1:272:3 | /**\\n * ... Val\\n */ | | tst.js:269:1:272:3 | /**\\n * ... Val\\n */ | +| tst.js:275:1:275:37 | /** @ty ... er>} */ | | tst.js:275:1:275:37 | /** @ty ... er>} */ | +| tst.js:277:1:279:3 | /**\\n * ... tor\\n */ | | tst.js:277:1:279:3 | /**\\n * ... tor\\n */ | +| tst.js:282:1:285:3 | /**\\n * ... tor\\n */ | | tst.js:282:1:285:3 | /**\\n * ... tor\\n */ | +| tst.js:288:1:288:22 | /** @ty ... } */ | | tst.js:288:1:288:22 | /** @ty ... } */ | +| tst.js:289:1:289:22 | /** @ty ... } */ | | tst.js:289:1:289:22 | /** @ty ... } */ | +| tst.js:294:1:294:28 | /** @pa ... fooY */ | | tst.js:294:1:294:28 | /** @pa ... fooY */ | +| tst.js:300:1:303:3 | /**\\n * ... e T\\n */ | | tst.js:300:1:303:3 | /**\\n * ... e T\\n */ | +| tst.js:306:1:306:19 | /** @param {T} t */ | | tst.js:306:1:306:19 | /** @param {T} t */ | +| tst.js:309:1:312:3 | /**\\n * ... g>}\\n */ | | tst.js:309:1:312:3 | /**\\n * ... g>}\\n */ | +| tst.js:315:1:319:3 | /**\\n * ... U>}\\n */ | | tst.js:315:1:319:3 | /**\\n * ... U>}\\n */ | +| tst.js:322:1:325:3 | /**\\n * ... e T\\n */ | | tst.js:322:1:325:3 | /**\\n * ... e T\\n */ | +| tst.js:328:1:328:18 | /** @return {T} */ | | tst.js:328:1:328:18 | /** @return {T} */ | +| tst.js:331:1:335:3 | /**\\n * ... r>}\\n */ | | tst.js:331:1:335:3 | /**\\n * ... r>}\\n */ | +| tst.js:338:1:342:3 | /**\\n * ... e T\\n */ | | tst.js:338:1:342:3 | /**\\n * ... e T\\n */ | +| tst.js:345:1:345:21 | /** @ty ... ing} */ | | tst.js:345:1:345:21 | /** @ty ... ing} */ | +| tst.js:346:1:346:21 | /** @ty ... ber} */ | | tst.js:346:1:346:21 | /** @ty ... ber} */ | +| tst.js:347:1:347:21 | /** @ty ... ber} */ | | tst.js:347:1:347:21 | /** @ty ... ber} */ | +| tst.js:349:1:349:31 | /** @ty ... ned} */ | | tst.js:349:1:349:31 | /** @ty ... ned} */ | +| tst.js:351:1:353:3 | /**\\n * ... ger\\n */ | | tst.js:351:1:353:3 | /**\\n * ... ger\\n */ | +| tst.js:356:1:359:3 | /**\\n * ... ion\\n */ | | tst.js:356:1:359:3 | /**\\n * ... ion\\n */ | +| tst.js:363:3:365:5 | /**\\n ... p\\n */ | | tst.js:363:3:365:5 | /**\\n ... p\\n */ | +| tst.js:368:3:370:5 | /**\\n ... p\\n */ | | tst.js:368:3:370:5 | /**\\n ... p\\n */ | +| tst.js:375:3:377:5 | /**\\n ... p\\n */ | | tst.js:375:3:377:5 | /**\\n ... p\\n */ | +| tst.js:380:3:382:5 | /**\\n ... p\\n */ | | tst.js:380:3:382:5 | /**\\n ... p\\n */ | +test_JSDocTag +| tst.js:5:5:5:10 | @const | const | tst.js:5:1:5:13 | /** @const */ | 0 | (none) | (none) | (none) | +| tst.js:9:4:9:9 | @const | const | tst.js:7:1:11:3 | /**\\n * ... ng}\\n */ | 0 | (none) | (none) | (none) | +| tst.js:10:4:10:8 | @type | type | tst.js:7:1:11:3 | /**\\n * ... ng}\\n */ | 1 | (none) | (none) | string | +| tst.js:14:5:14:10 | @const | const | tst.js:14:1:14:13 | /** @const */ | 0 | (none) | (none) | (none) | +| tst.js:18:4:18:15 | @constructor | constructor | tst.js:16:1:19:3 | /**\\n * ... tor\\n */ | 0 | (none) | (none) | (none) | +| tst.js:23:5:23:11 | @define | define | tst.js:23:1:23:24 | /** @de ... ean} */ | 0 | (none) | (none) | boolean | +| tst.js:26:5:26:11 | @define | define | tst.js:26:1:26:24 | /** @de ... ean} */ | 0 | (none) | (none) | boolean | +| tst.js:31:4:31:10 | @return | return | tst.js:29:1:35:3 | /**\\n * ... ().\\n */ | 0 | True if the contents of\nthe element are editable, but the element\nitself is not.\n | (none) | boolean | +| tst.js:34:4:34:14 | @deprecated | deprecated | tst.js:29:1:35:3 | /**\\n * ... ().\\n */ | 1 | Use isField(). | (none) | (none) | +| tst.js:40:4:40:15 | @constructor | constructor | tst.js:39:1:42:3 | /**\\n * ... ict\\n */ | 0 | (none) | (none) | (none) | +| tst.js:41:4:41:8 | @dict | dict | tst.js:39:1:42:3 | /**\\n * ... ict\\n */ | 1 | (none) | (none) | (none) | +| tst.js:48:16:48:20 | @dict | dict | tst.js:48:12:48:23 | /** @dict */ | 0 | (none) | (none) | (none) | +| tst.js:53:4:53:8 | @enum | enum | tst.js:51:1:54:3 | /**\\n * ... er}\\n */ | 0 | (none) | (none) | number | +| tst.js:61:5:61:11 | @export | export | tst.js:61:1:61:14 | /** @export */ | 0 | (none) | (none) | (none) | +| tst.js:67:4:67:15 | @constructor | constructor | tst.js:65:1:69:3 | /**\\n * ... st}\\n */ | 0 | (none) | (none) | (none) | +| tst.js:68:4:68:11 | @extends | extends | tst.js:65:1:69:3 | /**\\n * ... st}\\n */ | 1 | (none) | (none) | goog.ds.BasicNodeList | +| tst.js:75:4:75:9 | @final | final | tst.js:73:1:77:3 | /**\\n * ... tor\\n */ | 0 | (none) | (none) | (none) | +| tst.js:76:4:76:15 | @constructor | constructor | tst.js:73:1:77:3 | /**\\n * ... tor\\n */ | 1 | (none) | (none) | (none) | +| tst.js:82:4:82:9 | @final | final | tst.js:80:1:83:3 | /**\\n * ... nal\\n */ | 0 | (none) | (none) | (none) | +| tst.js:88:4:88:13 | @interface | interface | tst.js:86:1:89:3 | /**\\n * ... ace\\n */ | 0 | (none) | (none) | (none) | +| tst.js:94:4:94:15 | @constructor | constructor | tst.js:93:1:96:3 | /**\\n * ... pe}\\n */ | 0 | (none) | (none) | (none) | +| tst.js:95:4:95:14 | @implements | implements | tst.js:93:1:96:3 | /**\\n * ... pe}\\n */ | 1 | (none) | (none) | Shape | +| tst.js:102:4:102:12 | @override | override | tst.js:101:1:103:17 | /**\\n * ... tDoc */ | 0 | (none) | (none) | (none) | +| tst.js:103:4:103:14 | @inheritDoc | inheritDoc | tst.js:101:1:103:17 | /**\\n * ... tDoc */ | 1 | (none) | (none) | (none) | +| tst.js:109:4:109:13 | @interface | interface | tst.js:107:1:111:3 | /**\\n * ... pe}\\n */ | 0 | (none) | (none) | (none) | +| tst.js:110:4:110:11 | @extends | extends | tst.js:107:1:111:3 | /**\\n * ... pe}\\n */ | 1 | (none) | (none) | Shape | +| tst.js:117:13:117:18 | @lends | lends | tst.js:117:9:117:40 | /** @le ... ype} */ | 0 | {Button.prototype} | (none) | (none) | +| tst.js:122:4:122:12 | @preserve | preserve | tst.js:121:1:126:3 | /**\\n * ... sh:\\n */ | 0 | Copyright 2009 SomeThirdParty.\nHere is the full license text and copyright\nnotice for this file. Note that the notice can span several\nlines and is only terminated by the closing star and slash: | (none) | (none) | +| tst.js:128:5:128:18 | @nosideeffects | nosideeffects | tst.js:128:1:128:21 | /** @no ... ects */ | 0 | (none) | (none) | (none) | +| tst.js:134:4:134:10 | @return | return | tst.js:131:1:136:3 | /**\\n * ... age\\n */ | 0 | The window object of the peer.\n | (none) | Object | +| tst.js:135:4:135:11 | @package | package | tst.js:131:1:136:3 | /**\\n * ... age\\n */ | 1 | (none) | (none) | (none) | +| tst.js:142:4:142:9 | @param | param | tst.js:140:1:145:3 | /**\\n * ... ng.\\n */ | 0 | Subgroup id to query.\n | groupNum | number | +| tst.js:143:4:143:9 | @param | param | tst.js:140:1:145:3 | /**\\n * ... ng.\\n */ | 1 | An itemName,\nor itemId, or null to search everything. | term | (string\|number\|null) | +| tst.js:155:4:155:8 | @type | type | tst.js:153:1:157:3 | /**\\n * ... ate\\n */ | 0 | (none) | (none) | Array. | +| tst.js:156:4:156:11 | @private | private | tst.js:153:1:157:3 | /**\\n * ... ate\\n */ | 1 | (none) | (none) | (none) | +| tst.js:163:4:163:9 | @param | param | tst.js:160:1:165:3 | /**\\n * ... ted\\n */ | 0 | Root element for the component.\n | element | Element | +| tst.js:164:4:164:13 | @protected | protected | tst.js:160:1:165:3 | /**\\n * ... ted\\n */ | 1 | (none) | (none) | (none) | +| tst.js:171:4:171:10 | @return | return | tst.js:169:1:172:3 | /**\\n * ... ID.\\n */ | 0 | The hex ID. | (none) | string | +| tst.js:180:4:180:15 | @constructor | constructor | tst.js:179:1:182:3 | /**\\n * ... uct\\n */ | 0 | (none) | (none) | (none) | +| tst.js:181:4:181:10 | @struct | struct | tst.js:179:1:182:3 | /**\\n * ... uct\\n */ | 1 | (none) | (none) | (none) | +| tst.js:192:16:192:22 | @struct | struct | tst.js:192:12:192:25 | /** @struct */ | 0 | (none) | (none) | (none) | +| tst.js:198:12:198:16 | @this | this | tst.js:196:9:200:11 | /**\\n ... */ | 0 | (none) | (none) | (none) | +| tst.js:199:12:199:18 | @return | return | tst.js:196:9:200:11 | /**\\n ... */ | 1 | (none) | (none) | Element | +| tst.js:206:4:206:10 | @throws | throws | tst.js:205:1:207:3 | /**\\n * ... on}\\n */ | 0 | (none) | (none) | DOMException | +| tst.js:212:4:212:8 | @type | type | tst.js:210:1:213:3 | /**\\n * ... ng}\\n */ | 0 | (none) | (none) | string | +| tst.js:216:5:216:12 | @typedef | typedef | tst.js:216:1:216:33 | /** @ty ... er)} */ | 0 | (none) | (none) | (string\|number) | +| tst.js:219:5:219:10 | @param | param | tst.js:219:1:219:55 | /** @pa ... ing. */ | 0 | A number or a string. | x | goog.NumberLike | +| tst.js:223:5:223:9 | @type | type | tst.js:223:1:223:40 | /** @ty ... ct}} */ | 0 | (none) | (none) | {myNum: number, myObject} | +| tst.js:226:5:226:9 | @type | type | tst.js:226:1:226:22 | /** @ty ... er?} */ | 0 | (none) | (none) | number? | +| tst.js:229:5:229:9 | @type | type | tst.js:229:1:229:22 | /** @ty ... ect} */ | 0 | (none) | (none) | !Object | +| tst.js:233:4:233:9 | @param | param | tst.js:232:1:243:3 | /**\\n * ... p10\\n */ | 0 | (none) | p1 | function (string, boolean) | +| tst.js:234:4:234:9 | @param | param | tst.js:232:1:243:3 | /**\\n * ... p10\\n */ | 1 | (none) | p2 | function (): number | +| tst.js:235:4:235:9 | @param | param | tst.js:232:1:243:3 | /**\\n * ... p10\\n */ | 2 | (none) | p3 | function (this: goog.ui.Menu, string) | +| tst.js:236:4:236:9 | @param | param | tst.js:232:1:243:3 | /**\\n * ... p10\\n */ | 3 | (none) | p4 | function (new: goog.ui.Menu, string) | +| tst.js:237:4:237:9 | @param | param | tst.js:232:1:243:3 | /**\\n * ... p10\\n */ | 4 | (none) | p5 | function (string, ...[number]): number | +| tst.js:238:4:238:9 | @param | param | tst.js:232:1:243:3 | /**\\n * ... p10\\n */ | 5 | p6\n | var_args | ...number | +| tst.js:239:4:239:9 | @param | param | tst.js:232:1:243:3 | /**\\n * ... p10\\n */ | 6 | p7\n | opt_argument | number= | +| tst.js:240:4:240:9 | @param | param | tst.js:232:1:243:3 | /**\\n * ... p10\\n */ | 7 | (none) | p8 | function (?string=, number=) | +| tst.js:241:4:241:9 | @param | param | tst.js:232:1:243:3 | /**\\n * ... p10\\n */ | 8 | (none) | p9 | * | +| tst.js:242:4:242:9 | @param | param | tst.js:232:1:243:3 | /**\\n * ... p10\\n */ | 9 | (none) | p10 | ? | +| tst.js:247:4:247:15 | @constructor | constructor | tst.js:246:1:249:3 | /**\\n * ... e T\\n */ | 0 | (none) | (none) | (none) | +| tst.js:248:4:248:12 | @template | template | tst.js:246:1:249:3 | /**\\n * ... e T\\n */ | 1 | T | (none) | (none) | +| tst.js:252:5:252:11 | @return | return | tst.js:252:1:252:18 | /** @return {T} */ | 0 | (none) | (none) | T | +| tst.js:255:5:255:10 | @param | param | tst.js:255:1:255:19 | /** @param {T} t */ | 0 | (none) | t | T | +| tst.js:258:5:258:9 | @type | type | tst.js:258:1:258:28 | /** @ty ... ng>} */ | 0 | (none) | (none) | !Foo. | +| tst.js:259:15:259:19 | @type | type | tst.js:259:11:259:38 | /** @ty ... ng>} */ | 0 | (none) | (none) | !Foo. | +| tst.js:262:4:262:9 | @param | param | tst.js:261:1:265:3 | /**\\n * ... e T\\n */ | 0 | (none) | t | T | +| tst.js:263:4:263:15 | @constructor | constructor | tst.js:261:1:265:3 | /**\\n * ... e T\\n */ | 1 | (none) | (none) | (none) | +| tst.js:264:4:264:12 | @template | template | tst.js:261:1:265:3 | /**\\n * ... e T\\n */ | 2 | T | (none) | (none) | +| tst.js:270:4:270:15 | @constructor | constructor | tst.js:269:1:272:3 | /**\\n * ... Val\\n */ | 0 | (none) | (none) | (none) | +| tst.js:271:4:271:12 | @template | template | tst.js:269:1:272:3 | /**\\n * ... Val\\n */ | 1 | Key, Val | (none) | (none) | +| tst.js:275:5:275:9 | @type | type | tst.js:275:1:275:37 | /** @ty ... er>} */ | 0 | (none) | (none) | MyMap. | +| tst.js:278:4:278:15 | @constructor | constructor | tst.js:277:1:279:3 | /**\\n * ... tor\\n */ | 0 | (none) | (none) | (none) | +| tst.js:283:4:283:11 | @extends | extends | tst.js:282:1:285:3 | /**\\n * ... tor\\n */ | 0 | (none) | (none) | X | +| tst.js:284:4:284:15 | @constructor | constructor | tst.js:282:1:285:3 | /**\\n * ... tor\\n */ | 1 | (none) | (none) | (none) | +| tst.js:288:5:288:9 | @type | type | tst.js:288:1:288:22 | /** @ty ... } */ | 0 | (none) | (none) | Foo. | +| tst.js:289:5:289:9 | @type | type | tst.js:289:1:289:22 | /** @ty ... } */ | 0 | (none) | (none) | Foo. | +| tst.js:294:5:294:10 | @param | param | tst.js:294:1:294:28 | /** @pa ... fooY */ | 0 | (none) | fooY | Foo. | +| tst.js:301:4:301:15 | @constructor | constructor | tst.js:300:1:303:3 | /**\\n * ... e T\\n */ | 0 | (none) | (none) | (none) | +| tst.js:302:4:302:12 | @template | template | tst.js:300:1:303:3 | /**\\n * ... e T\\n */ | 1 | T | (none) | (none) | +| tst.js:306:5:306:10 | @param | param | tst.js:306:1:306:19 | /** @param {T} t */ | 0 | (none) | t | T | +| tst.js:310:4:310:15 | @constructor | constructor | tst.js:309:1:312:3 | /**\\n * ... g>}\\n */ | 0 | (none) | (none) | (none) | +| tst.js:311:4:311:11 | @extends | extends | tst.js:309:1:312:3 | /**\\n * ... g>}\\n */ | 1 | (none) | (none) | A. | +| tst.js:316:4:316:15 | @constructor | constructor | tst.js:315:1:319:3 | /**\\n * ... U>}\\n */ | 0 | (none) | (none) | (none) | +| tst.js:317:4:317:12 | @template | template | tst.js:315:1:319:3 | /**\\n * ... U>}\\n */ | 1 | U\n | (none) | (none) | +| tst.js:318:4:318:11 | @extends | extends | tst.js:315:1:319:3 | /**\\n * ... U>}\\n */ | 2 | (none) | (none) | A. | +| tst.js:323:4:323:13 | @interface | interface | tst.js:322:1:325:3 | /**\\n * ... e T\\n */ | 0 | (none) | (none) | (none) | +| tst.js:324:4:324:12 | @template | template | tst.js:322:1:325:3 | /**\\n * ... e T\\n */ | 1 | T | (none) | (none) | +| tst.js:328:5:328:11 | @return | return | tst.js:328:1:328:18 | /** @return {T} */ | 0 | (none) | (none) | T | +| tst.js:332:4:332:15 | @constructor | constructor | tst.js:331:1:335:3 | /**\\n * ... r>}\\n */ | 0 | (none) | (none) | (none) | +| tst.js:333:4:333:14 | @implements | implements | tst.js:331:1:335:3 | /**\\n * ... r>}\\n */ | 1 | (none) | (none) | Foo. | +| tst.js:334:4:334:14 | @implements | implements | tst.js:331:1:335:3 | /**\\n * ... r>}\\n */ | 2 | (none) | (none) | Foo. | +| tst.js:339:4:339:9 | @param | param | tst.js:338:1:342:3 | /**\\n * ... e T\\n */ | 0 | (none) | a | T | +| tst.js:340:4:340:10 | @return | return | tst.js:338:1:342:3 | /**\\n * ... e T\\n */ | 1 | (none) | (none) | T | +| tst.js:341:4:341:12 | @template | template | tst.js:338:1:342:3 | /**\\n * ... e T\\n */ | 2 | T | (none) | (none) | +| tst.js:345:5:345:9 | @type | type | tst.js:345:1:345:21 | /** @ty ... ing} */ | 0 | (none) | (none) | string | +| tst.js:346:5:346:9 | @type | type | tst.js:346:1:346:21 | /** @ty ... ber} */ | 0 | (none) | (none) | number | +| tst.js:347:5:347:9 | @type | type | tst.js:347:1:347:21 | /** @ty ... ber} */ | 0 | (none) | (none) | number | +| tst.js:349:5:349:9 | @type | type | tst.js:349:1:349:31 | /** @ty ... ned} */ | 0 | (none) | (none) | (string\|undefined) | +| tst.js:352:4:352:9 | @param | param | tst.js:351:1:353:3 | /**\\n * ... ger\\n */ | 0 | [int] an integer | (none) | (none) | +| tst.js:357:4:357:9 | @param | param | tst.js:356:1:359:3 | /**\\n * ... ion\\n */ | 0 | the array to sort\n | array | Array. | +| tst.js:358:4:358:9 | @param | param | tst.js:356:1:359:3 | /**\\n * ... ion\\n */ | 1 | the comparator function | fn | function (x: !number, y: !number): number | +| tst.js:364:6:364:11 | @param | param | tst.js:363:3:365:5 | /**\\n ... p\\n */ | 0 | (none) | p | T1 | +| tst.js:369:6:369:11 | @param | param | tst.js:368:3:370:5 | /**\\n ... p\\n */ | 0 | (none) | p | T2 | +| tst.js:376:6:376:11 | @param | param | tst.js:375:3:377:5 | /**\\n ... p\\n */ | 0 | (none) | p | T3 | +| tst.js:381:6:381:11 | @param | param | tst.js:380:3:382:5 | /**\\n ... p\\n */ | 0 | (none) | p | T4 | +test_ObjectExpr_getDocumentation +| tst.js:48:25:48:36 | { 'x': 321 } | tst.js:48:12:48:23 | /** @dict */ | +| tst.js:55:20:59:1 | {\\n TRU ... BE: 0\\n} | tst.js:51:1:54:3 | /**\\n * ... er}\\n */ | +| tst.js:117:43:119:9 | {\\n ... } | tst.js:117:9:117:40 | /** @le ... ype} */ | +| tst.js:192:27:192:36 | { x: 321 } | tst.js:192:12:192:25 | /** @struct */ | +test_JSDocFunctionTypeExpr +| function (?string=, number=) | (none) | (none) | 0 | ?string= | no | +| function (?string=, number=) | (none) | (none) | 1 | number= | no | +| function (new: goog.ui.Menu, string) | (none) | goog.ui.Menu | 0 | string | yes | +| function (string, ...[number]): number | number | (none) | 0 | string | no | +| function (string, ...[number]): number | number | (none) | 1 | ...[number] | no | +| function (string, boolean) | (none) | (none) | 0 | string | no | +| function (string, boolean) | (none) | (none) | 1 | boolean | no | +| function (this: goog.ui.Menu, string) | (none) | goog.ui.Menu | 0 | string | no | +| function (x: !number, y: !number): number | number | (none) | 0 | !number | no | +| function (x: !number, y: !number): number | number | (none) | 1 | !number | no | +test_JSDocNullableTypeExpr +| ?string | string | prefix | +| number? | number | postfix | +test_next_token +| tst.js:1:1:1:117 | // Test ... mpiler, | tst.js:5:15:5:17 | var | +| tst.js:2:1:2:118 | // whic ... se 2.0; | tst.js:5:15:5:17 | var | +| tst.js:3:1:3:20 | // see file COPYING. | tst.js:5:15:5:17 | var | +| tst.js:5:1:5:13 | /** @const */ | tst.js:5:15:5:17 | var | +| tst.js:7:1:11:3 | /**\\n * ... ng}\\n */ | tst.js:12:1:12:11 | mynamespace | +| tst.js:14:1:14:13 | /** @const */ | tst.js:14:15:14:21 | MyClass | +| tst.js:16:1:19:3 | /**\\n * ... tor\\n */ | tst.js:20:1:20:8 | function | +| tst.js:23:1:23:24 | /** @de ... ean} */ | tst.js:24:1:24:3 | var | +| tst.js:26:1:26:24 | /** @de ... ean} */ | tst.js:27:1:27:4 | goog | +| tst.js:29:1:35:3 | /**\\n * ... ().\\n */ | tst.js:36:1:36:11 | BN_EditUtil | +| tst.js:39:1:42:3 | /**\\n * ... ict\\n */ | tst.js:43:1:43:8 | function | +| tst.js:46:16:46:25 | // warning | tst.js:48:1:48:3 | var | +| tst.js:48:12:48:23 | /** @dict */ | tst.js:48:25:48:25 | { | +| tst.js:49:16:49:25 | // warning | tst.js:55:1:55:7 | project | +| tst.js:51:1:54:3 | /**\\n * ... er}\\n */ | tst.js:55:1:55:7 | project | +| tst.js:61:1:61:14 | /** @export */ | tst.js:62:1:62:3 | foo | +| tst.js:65:1:69:3 | /**\\n * ... st}\\n */ | tst.js:70:1:70:4 | goog | +| tst.js:73:1:77:3 | /**\\n * ... tor\\n */ | tst.js:78:1:78:5 | sloth | +| tst.js:80:1:83:3 | /**\\n * ... nal\\n */ | tst.js:84:1:84:5 | sloth | +| tst.js:86:1:89:3 | /**\\n * ... ace\\n */ | tst.js:90:1:90:8 | function | +| tst.js:93:1:96:3 | /**\\n * ... pe}\\n */ | tst.js:97:1:97:8 | function | +| tst.js:101:1:103:17 | /**\\n * ... tDoc */ | tst.js:104:1:104:7 | project | +| tst.js:107:1:111:3 | /**\\n * ... pe}\\n */ | tst.js:112:1:112:8 | function | +| tst.js:117:9:117:40 | /** @le ... ype} */ | tst.js:117:42:117:42 | ( | +| tst.js:121:1:126:3 | /**\\n * ... sh:\\n */ | tst.js:129:1:129:8 | function | +| tst.js:128:1:128:21 | /** @no ... ects */ | tst.js:129:1:129:8 | function | +| tst.js:131:1:136:3 | /**\\n * ... age\\n */ | tst.js:137:1:137:4 | goog | +| tst.js:140:1:145:3 | /**\\n * ... ng.\\n */ | tst.js:146:1:146:4 | goog | +| tst.js:149:14:149:26 | /** number */ | tst.js:149:28:149:28 | a | +| tst.js:149:31:149:43 | /** number */ | tst.js:149:45:149:45 | b | +| tst.js:153:1:157:3 | /**\\n * ... ate\\n */ | tst.js:158:1:158:4 | this | +| tst.js:160:1:165:3 | /**\\n * ... ted\\n */ | tst.js:166:1:166:4 | goog | +| tst.js:169:1:172:3 | /**\\n * ... ID.\\n */ | tst.js:173:1:173:4 | goog | +| tst.js:177:10:177:22 | /** number */ | tst.js:177:24:177:26 | foo | +| tst.js:179:1:182:3 | /**\\n * ... uct\\n */ | tst.js:183:1:183:8 | function | +| tst.js:187:24:187:28 | // OK | tst.js:188:1:188:4 | obj1 | +| tst.js:188:21:188:25 | // OK | tst.js:189:1:189:4 | obj1 | +| tst.js:189:22:189:31 | // warning | tst.js:190:1:190:4 | obj1 | +| tst.js:190:14:190:23 | // warning | tst.js:192:1:192:3 | var | +| tst.js:192:12:192:25 | /** @struct */ | tst.js:192:27:192:27 | { | +| tst.js:193:19:193:28 | // warning | tst.js:195:1:195:4 | chat | +| tst.js:196:9:200:11 | /**\\n ... */ | tst.js:201:9:201:16 | function | +| tst.js:205:1:207:3 | /**\\n * ... on}\\n */ | tst.js:208:1:208:19 | DOMApplicationCache | +| tst.js:210:1:213:3 | /**\\n * ... ng}\\n */ | tst.js:214:1:214:3 | var | +| tst.js:216:1:216:33 | /** @ty ... er)} */ | tst.js:217:1:217:4 | goog | +| tst.js:219:1:219:55 | /** @pa ... ing. */ | tst.js:220:1:220:4 | goog | +| tst.js:223:1:223:40 | /** @ty ... ct}} */ | tst.js:224:1:224:3 | var | +| tst.js:226:1:226:22 | /** @ty ... er?} */ | tst.js:227:1:227:3 | var | +| tst.js:229:1:229:22 | /** @ty ... ect} */ | tst.js:230:1:230:3 | var | +| tst.js:232:1:243:3 | /**\\n * ... p10\\n */ | tst.js:244:1:244:3 | var | +| tst.js:246:1:249:3 | /**\\n * ... e T\\n */ | tst.js:250:1:250:3 | var | +| tst.js:252:1:252:18 | /** @return {T} */ | tst.js:253:1:253:3 | Foo | +| tst.js:255:1:255:19 | /** @param {T} t */ | tst.js:256:1:256:3 | Foo | +| tst.js:258:1:258:28 | /** @ty ... ng>} */ | tst.js:258:30:258:32 | var | +| tst.js:259:11:259:38 | /** @ty ... ng>} */ | tst.js:259:40:259:40 | ( | +| tst.js:261:1:265:3 | /**\\n * ... e T\\n */ | tst.js:266:1:266:3 | Bar | +| tst.js:267:29:267:52 | // bar ... string> | tst.js:273:1:273:3 | var | +| tst.js:269:1:272:3 | /**\\n * ... Val\\n */ | tst.js:273:1:273:3 | var | +| tst.js:275:1:275:37 | /** @ty ... er>} */ | tst.js:275:39:275:41 | var | +| tst.js:275:48:275:77 | // Key ... number. | tst.js:280:1:280:1 | X | +| tst.js:277:1:279:3 | /**\\n * ... tor\\n */ | tst.js:280:1:280:1 | X | +| tst.js:282:1:285:3 | /**\\n * ... tor\\n */ | tst.js:286:1:286:1 | Y | +| tst.js:288:1:288:22 | /** @ty ... } */ | tst.js:288:24:288:26 | var | +| tst.js:289:1:289:22 | /** @ty ... } */ | tst.js:289:24:289:26 | var | +| tst.js:291:14:291:21 | // Error | tst.js:292:1:292:4 | fooY | +| tst.js:292:14:292:21 | // Error | tst.js:295:1:295:9 | takesFooY | +| tst.js:294:1:294:28 | /** @pa ... fooY */ | tst.js:295:1:295:9 | takesFooY | +| tst.js:297:18:297:23 | // OK. | tst.js:298:1:298:9 | takesFooY | +| tst.js:298:18:298:25 | // Error | tst.js:304:1:304:1 | A | +| tst.js:300:1:303:3 | /**\\n * ... e T\\n */ | tst.js:304:1:304:1 | A | +| tst.js:306:1:306:19 | /** @param {T} t */ | tst.js:307:1:307:1 | A | +| tst.js:309:1:312:3 | /**\\n * ... g>}\\n */ | tst.js:313:1:313:1 | B | +| tst.js:315:1:319:3 | /**\\n * ... U>}\\n */ | tst.js:320:1:320:1 | C | +| tst.js:322:1:325:3 | /**\\n * ... e T\\n */ | tst.js:326:1:326:3 | Foo | +| tst.js:328:1:328:18 | /** @return {T} */ | tst.js:329:1:329:3 | Foo | +| tst.js:331:1:335:3 | /**\\n * ... r>}\\n */ | tst.js:336:1:336:7 | FooImpl | +| tst.js:336:27:336:72 | // Erro ... e twice | tst.js:343:1:343:8 | identity | +| tst.js:338:1:342:3 | /**\\n * ... e T\\n */ | tst.js:343:1:343:8 | identity | +| tst.js:345:1:345:21 | /** @ty ... ing} */ | tst.js:345:23:345:25 | var | +| tst.js:345:72:345:76 | // OK | tst.js:346:23:346:25 | var | +| tst.js:346:1:346:21 | /** @ty ... ber} */ | tst.js:346:23:346:25 | var | +| tst.js:346:60:346:64 | // OK | tst.js:347:23:347:25 | var | +| tst.js:347:1:347:21 | /** @ty ... ber} */ | tst.js:347:23:347:25 | var | +| tst.js:347:62:347:77 | // Type mismatch | tst.js:349:33:349:35 | var | +| tst.js:349:1:349:31 | /** @ty ... ned} */ | tst.js:349:33:349:35 | var | +| tst.js:351:1:353:3 | /**\\n * ... ger\\n */ | tst.js:354:1:354:8 | function | +| tst.js:356:1:359:3 | /**\\n * ... ion\\n */ | tst.js:360:1:360:8 | function | +| tst.js:363:3:365:5 | /**\\n ... p\\n */ | tst.js:366:3:366:15 | classicMethod | +| tst.js:368:3:370:5 | /**\\n ... p\\n */ | tst.js:371:3:371:13 | fancyMethod | +| tst.js:375:3:377:5 | /**\\n ... p\\n */ | tst.js:378:3:378:13 | constructor | +| tst.js:380:3:382:5 | /**\\n ... p\\n */ | tst.js:383:3:383:13 | classMethod | +test_JSDocTypeExpr +| !Foo. | @type | 0 | +| !Foo. | @type | 0 | +| !Object | @type | 0 | +| !number | function (x: !number, y: !number): number | 0 | +| !number | function (x: !number, y: !number): number | 1 | +| (string\|number) | @typedef | 0 | +| (string\|number\|null) | @param | 0 | +| (string\|undefined) | @type | 0 | +| * | @param | 0 | +| ...[number] | function (string, ...[number]): number | 1 | +| ...number | @param | 0 | +| ? | @param | 0 | +| ?string | ?string= | 0 | +| ?string= | function (?string=, number=) | 0 | +| A | A. | -1 | +| A | A. | -1 | +| A. | @extends | 0 | +| A. | @extends | 0 | +| Array | Array. | -1 | +| Array | Array. | -1 | +| Array. | @type | 0 | +| Array. | @param | 0 | +| DOMException | @throws | 0 | +| Element | @param | 0 | +| Element | @return | 0 | +| Foo | Foo. | -1 | +| Foo | Foo. | -1 | +| Foo | Foo. | -1 | +| Foo | Foo. | -1 | +| Foo | Foo. | -1 | +| Foo | Foo. | -1 | +| Foo | Foo. | -1 | +| Foo. | @type | 0 | +| Foo. | @param | 0 | +| Foo. | @type | 0 | +| Foo. | @implements | 0 | +| Foo. | !Foo. | 0 | +| Foo. | !Foo. | 0 | +| Foo. | @implements | 0 | +| Function | Array. | 0 | +| MyMap | MyMap. | -1 | +| MyMap. | @type | 0 | +| Object | !Object | 0 | +| Object | @return | 0 | +| Shape | @extends | 0 | +| Shape | @implements | 0 | +| T | @param | 0 | +| T | @param | 0 | +| T | @param | 0 | +| T | @param | 0 | +| T | @return | 0 | +| T | @return | 0 | +| T | @return | 0 | +| T1 | @param | 0 | +| T2 | @param | 0 | +| T3 | @param | 0 | +| T4 | @param | 0 | +| U | A. | 0 | +| X | @extends | 0 | +| X | Foo. | 0 | +| Y | Foo. | 0 | +| Y | Foo. | 0 | +| [number] | ...[number] | 0 | +| boolean | @define | 0 | +| boolean | @define | 0 | +| boolean | @return | 0 | +| boolean | function (string, boolean) | 1 | +| function (): number | @param | 0 | +| function (?string=, number=) | @param | 0 | +| function (new: goog.ui.Menu, string) | @param | 0 | +| function (string, ...[number]): number | @param | 0 | +| function (string, boolean) | @param | 0 | +| function (this: goog.ui.Menu, string) | @param | 0 | +| function (x: !number, y: !number): number | @param | 0 | +| goog.NumberLike | @param | 0 | +| goog.ds.BasicNodeList | @extends | 0 | +| goog.ui.Menu | function (new: goog.ui.Menu, string) | -2 | +| goog.ui.Menu | function (this: goog.ui.Menu, string) | -2 | +| null | (string\|number\|null) | 2 | +| number | !number | 0 | +| number | !number | 0 | +| number | (string\|number) | 1 | +| number | (string\|number\|null) | 1 | +| number | ...number | 0 | +| number | @enum | 0 | +| number | @param | 0 | +| number | @type | 0 | +| number | @type | 0 | +| number | Array. | 0 | +| number | Foo. | 0 | +| number | MyMap. | 1 | +| number | [number] | 0 | +| number | function (): number | -1 | +| number | function (string, ...[number]): number | -1 | +| number | function (x: !number, y: !number): number | -1 | +| number | number= | 0 | +| number | number= | 0 | +| number | number? | 0 | +| number | {myNum: number, myObject} | 0 | +| number= | @param | 0 | +| number= | function (?string=, number=) | 1 | +| number? | @type | 0 | +| string | (string\|number) | 0 | +| string | (string\|number\|null) | 0 | +| string | (string\|undefined) | 0 | +| string | ?string | 0 | +| string | @return | 0 | +| string | @type | 0 | +| string | @type | 0 | +| string | @type | 0 | +| string | A. | 0 | +| string | Foo. | 0 | +| string | Foo. | 0 | +| string | Foo. | 0 | +| string | MyMap. | 0 | +| string | function (new: goog.ui.Menu, string) | 0 | +| string | function (string, ...[number]): number | 0 | +| string | function (string, boolean) | 0 | +| string | function (this: goog.ui.Menu, string) | 0 | +| undefined | (string\|undefined) | 1 | +| {myNum: number, myObject} | @type | 0 | +test_Function_getDocumentation +| tst.js:20:1:21:1 | functio ... t() {\\n} | tst.js:16:1:19:3 | /**\\n * ... tor\\n */ | +| tst.js:36:34:37:1 | function(node) {\\n} | tst.js:29:1:35:3 | /**\\n * ... ().\\n */ | +| tst.js:43:1:43:17 | function Foo() {} | tst.js:39:1:42:3 | /**\\n * ... ict\\n */ | +| tst.js:62:46:63:1 | function() {\\n} | tst.js:61:1:61:14 | /** @export */ | +| tst.js:70:25:71:1 | function() {\\n} | tst.js:65:1:69:3 | /**\\n * ... st}\\n */ | +| tst.js:78:22:78:35 | function() { } | tst.js:73:1:77:3 | /**\\n * ... tor\\n */ | +| tst.js:84:39:84:52 | function() { } | tst.js:80:1:83:3 | /**\\n * ... nal\\n */ | +| tst.js:90:1:90:19 | function Shape() {} | tst.js:86:1:89:3 | /**\\n * ... ace\\n */ | +| tst.js:97:1:97:20 | function Square() {} | tst.js:93:1:96:3 | /**\\n * ... pe}\\n */ | +| tst.js:104:39:105:1 | function() {\\n} | tst.js:101:1:103:17 | /**\\n * ... tDoc */ | +| tst.js:112:1:112:21 | functio ... on() {} | tst.js:107:1:111:3 | /**\\n * ... pe}\\n */ | +| tst.js:129:1:129:42 | functio ... n 42; } | tst.js:121:1:126:3 | /**\\n * ... sh:\\n */ | +| tst.js:129:1:129:42 | functio ... n 42; } | tst.js:128:1:128:21 | /** @no ... ects */ | +| tst.js:137:63:138:1 | function() {\\n} | tst.js:131:1:136:3 | /**\\n * ... age\\n */ | +| tst.js:146:28:147:1 | functio ... rm) {\\n} | tst.js:140:1:145:3 | /**\\n * ... ng.\\n */ | +| tst.js:166:50:167:1 | functio ... nt) {\\n} | tst.js:160:1:165:3 | /**\\n * ... ted\\n */ | +| tst.js:173:32:175:1 | functio ... n id;\\n} | tst.js:169:1:172:3 | /**\\n * ... ID.\\n */ | +| tst.js:183:1:185:1 | functio ... = x;\\n} | tst.js:179:1:182:3 | /**\\n * ... uct\\n */ | +| tst.js:201:9:203:9 | functio ... } | tst.js:196:9:200:11 | /**\\n ... */ | +| tst.js:208:43:208:56 | function() { } | tst.js:205:1:207:3 | /**\\n * ... on}\\n */ | +| tst.js:220:19:221:1 | function(x) {\\n} | tst.js:219:1:219:55 | /** @pa ... ing. */ | +| tst.js:250:11:250:43 | functio ... null; } | tst.js:246:1:249:3 | /**\\n * ... e T\\n */ | +| tst.js:253:21:253:53 | functio ... alue; } | tst.js:252:1:252:18 | /** @return {T} */ | +| tst.js:256:21:256:51 | functio ... = t; } | tst.js:255:1:255:19 | /** @param {T} t */ | +| tst.js:266:7:266:21 | function(t) { } | tst.js:261:1:265:3 | /**\\n * ... e T\\n */ | +| tst.js:273:13:273:26 | function() { } | tst.js:269:1:272:3 | /**\\n * ... Val\\n */ | +| tst.js:280:5:280:18 | function() { } | tst.js:277:1:279:3 | /**\\n * ... tor\\n */ | +| tst.js:286:5:286:18 | function() { } | tst.js:282:1:285:3 | /**\\n * ... tor\\n */ | +| tst.js:295:13:295:30 | function(fooY) { } | tst.js:294:1:294:28 | /** @pa ... fooY */ | +| tst.js:304:5:304:18 | function() { } | tst.js:300:1:303:3 | /**\\n * ... e T\\n */ | +| tst.js:307:22:307:36 | function(t) { } | tst.js:306:1:306:19 | /** @param {T} t */ | +| tst.js:313:5:313:18 | function() { } | tst.js:309:1:312:3 | /**\\n * ... g>}\\n */ | +| tst.js:320:5:320:18 | function() { } | tst.js:315:1:319:3 | /**\\n * ... U>}\\n */ | +| tst.js:326:7:326:19 | function() {} | tst.js:322:1:325:3 | /**\\n * ... e T\\n */ | +| tst.js:329:21:329:33 | function() {} | tst.js:328:1:328:18 | /** @return {T} */ | +| tst.js:336:11:336:24 | function() { } | tst.js:331:1:335:3 | /**\\n * ... r>}\\n */ | +| tst.js:343:12:343:36 | functio ... rn a; } | tst.js:338:1:342:3 | /**\\n * ... e T\\n */ | +| tst.js:354:1:354:16 | function f(x) {} | tst.js:351:1:353:3 | /**\\n * ... ger\\n */ | +| tst.js:360:1:360:27 | functio ... fn) {} | tst.js:356:1:359:3 | /**\\n * ... ion\\n */ | +| tst.js:366:18:366:31 | function(p) {} | tst.js:363:3:365:5 | /**\\n ... p\\n */ | +| tst.js:371:14:371:19 | (p) {} | tst.js:368:3:370:5 | /**\\n ... p\\n */ | +| tst.js:378:14:378:19 | (p) {} | tst.js:375:3:377:5 | /**\\n ... p\\n */ | +| tst.js:383:14:383:19 | (p) {} | tst.js:380:3:382:5 | /**\\n ... p\\n */ | +test_JSDocOptionalParameterTypeExpr +| ?string= | ?string | +| number= | number | +| number= | number | +test_getParameterTag +| tst.js:146:37:146:44 | groupNum | groupNum | tst.js:142:4:142:9 | @param | groupNum | number | +| tst.js:146:47:146:50 | term | term | tst.js:143:4:143:9 | @param | term | (string\|number\|null) | +| tst.js:166:59:166:65 | element | element | tst.js:163:4:163:9 | @param | element | Element | +| tst.js:220:28:220:28 | x | x | tst.js:219:5:219:10 | @param | x | goog.NumberLike | +| tst.js:256:30:256:30 | t | t | tst.js:255:5:255:10 | @param | t | T | +| tst.js:266:16:266:16 | t | t | tst.js:262:4:262:9 | @param | t | T | +| tst.js:295:22:295:25 | fooY | fooY | tst.js:294:5:294:10 | @param | fooY | Foo. | +| tst.js:307:31:307:31 | t | t | tst.js:306:5:306:10 | @param | t | T | +| tst.js:343:21:343:21 | a | a | tst.js:339:4:339:9 | @param | a | T | +| tst.js:360:15:360:19 | array | array | tst.js:357:4:357:9 | @param | array | Array. | +| tst.js:360:22:360:23 | fn | fn | tst.js:358:4:358:9 | @param | fn | function (x: !number, y: !number): number | +| tst.js:366:27:366:27 | p | p | tst.js:364:6:364:11 | @param | p | T1 | +| tst.js:371:15:371:15 | p | p | tst.js:369:6:369:11 | @param | p | T2 | +| tst.js:378:15:378:15 | p | p | tst.js:376:6:376:11 | @param | p | T3 | +| tst.js:383:15:383:15 | p | p | tst.js:381:6:381:11 | @param | p | T4 | +test_VarDeclStmt_getDocumentation +| tst.js:5:15:5:36 | var MY_ ... stout'; | tst.js:5:1:5:13 | /** @const */ | +| tst.js:24:1:24:24 | var ENA ... = true; | tst.js:23:1:23:24 | /** @de ... ean} */ | +| tst.js:214:1:214:18 | var hexId = hexId; | tst.js:210:1:213:3 | /**\\n * ... ng}\\n */ | +| tst.js:224:1:224:6 | var o; | tst.js:223:1:223:40 | /** @ty ... ct}} */ | +| tst.js:227:1:227:6 | var x; | tst.js:226:1:226:22 | /** @ty ... er?} */ | +| tst.js:230:1:230:6 | var y; | tst.js:229:1:229:22 | /** @ty ... ect} */ | +| tst.js:244:1:244:6 | var f; | tst.js:232:1:243:3 | /**\\n * ... p10\\n */ | +| tst.js:250:1:250:44 | var Foo ... ull; }; | tst.js:246:1:249:3 | /**\\n * ... e T\\n */ | +| tst.js:258:30:258:49 | var foo = new Foo(); | tst.js:258:1:258:28 | /** @ty ... ng>} */ | +| tst.js:273:1:273:27 | var MyM ... () { }; | tst.js:269:1:272:3 | /**\\n * ... Val\\n */ | +| tst.js:275:39:275:46 | var map; | tst.js:275:1:275:37 | /** @ty ... er>} */ | +| tst.js:288:24:288:32 | var fooX; | tst.js:288:1:288:22 | /** @ty ... } */ | +| tst.js:289:24:289:32 | var fooY; | tst.js:289:1:289:22 | /** @ty ... } */ | +| tst.js:345:23:345:70 | var msg ... orld"); | tst.js:345:1:345:21 | /** @ty ... ing} */ | +| tst.js:346:23:346:58 | var sum ... ity(2); | tst.js:346:1:346:21 | /** @ty ... ber} */ | +| tst.js:347:23:347:60 | var sum ... y("2"); | tst.js:347:1:347:21 | /** @ty ... ber} */ | +| tst.js:349:33:349:52 | var string_or_undef; | tst.js:349:1:349:31 | /** @ty ... ned} */ | +test_JSDocAppliedTypeExpr +| A. | A | 0 | U | +| A. | A | 0 | string | +| Array. | Array | 0 | Function | +| Array. | Array | 0 | number | +| Foo. | Foo | 0 | X | +| Foo. | Foo | 0 | Y | +| Foo. | Foo | 0 | Y | +| Foo. | Foo | 0 | number | +| Foo. | Foo | 0 | string | +| Foo. | Foo | 0 | string | +| Foo. | Foo | 0 | string | +| MyMap. | MyMap | 0 | string | +| MyMap. | MyMap | 1 | number | +test_JSDocNonNullableTypeExpr +| !Foo. | Foo. | prefix | +| !Foo. | Foo. | prefix | +| !Object | Object | prefix | +| !number | number | prefix | +| !number | number | prefix | +test_ParExpr_getDocumentation +| tst.js:117:42:119:10 | ({\\n ... }) | tst.js:117:9:117:40 | /** @le ... ype} */ | +| tst.js:259:40:259:50 | (new Foo()) | tst.js:259:11:259:38 | /** @ty ... ng>} */ | diff --git a/javascript/ql/test/library-tests/JSDoc/tests.ql b/javascript/ql/test/library-tests/JSDoc/tests.ql new file mode 100644 index 000000000000..4662d0d0d1d1 --- /dev/null +++ b/javascript/ql/test/library-tests/JSDoc/tests.ql @@ -0,0 +1,20 @@ +import JSDocUnionTypeExpr +import JSDocArrayTypeExpr +import Parameter_getDocumentation +import JSDocRestParameterTypeExpr +import AssignExpr_getDocumentation +import JSDocRecordTypeExpr +import JSDoc +import JSDocTag +import ObjectExpr_getDocumentation +import JSDocFunctionTypeExpr +import JSDocNullableTypeExpr +import next_token +import JSDocTypeExpr +import Function_getDocumentation +import JSDocOptionalParameterTypeExpr +import getParameterTag +import VarDeclStmt_getDocumentation +import JSDocAppliedTypeExpr +import JSDocNonNullableTypeExpr +import ParExpr_getDocumentation diff --git a/javascript/ql/test/library-tests/ModuleImportNodes/ModuleImportNode.expected b/javascript/ql/test/library-tests/ModuleImportNodes/ModuleImportNode.expected deleted file mode 100644 index 4292a5bde632..000000000000 --- a/javascript/ql/test/library-tests/ModuleImportNodes/ModuleImportNode.expected +++ /dev/null @@ -1,14 +0,0 @@ -| amd1.js:1:25:1:26 | fs | fs | amd1.js:2:3:2:4 | fs | fs | -| amd2.js:2:12:2:24 | require('fs') | fs | amd2.js:3:3:3:4 | fs | fs | -| instanceThroughDefaultImport.js:1:8:1:42 | myDefaultImportedModuleInstanceName | myDefaultImportedModuleInstance | instanceThroughDefaultImport.js:2:1:2:35 | myDefau ... nceName | myDefaultImportedModuleInstanceName | -| instanceThroughDefaultImport.js:1:8:1:42 | myDefaultImportedModuleInstanceName | myDefaultImportedModuleInstance | instanceThroughDefaultImport.js:4:5:4:39 | myDefau ... nceName | myDefaultImportedModuleInstanceName | -| instanceThroughNamespaceImport.js:1:8:1:49 | myNamespaceImportedModuleInstanceName | myNamespaceImportedModuleInstance | instanceThroughNamespaceImport.js:2:1:2:37 | myNames ... nceName | myNamespaceImportedModuleInstanceName | -| instanceThroughNamespaceImport.js:1:8:1:49 | myNamespaceImportedModuleInstanceName | myNamespaceImportedModuleInstance | instanceThroughNamespaceImport.js:4:5:4:41 | myNames ... nceName | myNamespaceImportedModuleInstanceName | -| instanceThroughRequire.js:1:36:1:70 | require ... tance') | myRequiredModuleInstance | instanceThroughRequire.js:2:1:2:28 | myRequi ... nceName | myRequiredModuleInstanceName | -| instanceThroughRequire.js:1:36:1:70 | require ... tance') | myRequiredModuleInstance | instanceThroughRequire.js:4:5:4:32 | myRequi ... nceName | myRequiredModuleInstanceName | -| moduleUses.js:1:11:1:24 | require('mod') | mod | moduleUses.js:3:1:3:3 | mod | mod | -| moduleUses.js:1:11:1:24 | require('mod') | mod | moduleUses.js:5:9:5:11 | mod | mod | -| moduleUses.js:1:11:1:24 | require('mod') | mod | moduleUses.js:8:9:8:11 | mod | mod | -| moduleUses.js:1:11:1:24 | require('mod') | mod | moduleUses.js:11:1:11:3 | mod | mod | -| moduleUses.js:1:11:1:24 | require('mod') | mod | moduleUses.js:13:1:13:3 | mod | mod | -| moduleUses.js:1:11:1:24 | require('mod') | mod | moduleUses.js:15:5:15:7 | mod | mod | diff --git a/javascript/ql/test/library-tests/ModuleImportNodes/ModuleImportNode.ql b/javascript/ql/test/library-tests/ModuleImportNodes/ModuleImportNode.ql deleted file mode 100644 index 21190b166a61..000000000000 --- a/javascript/ql/test/library-tests/ModuleImportNodes/ModuleImportNode.ql +++ /dev/null @@ -1,5 +0,0 @@ -import javascript - -from DataFlow::ModuleImportNode m, Identifier use -where m.flowsToExpr(use) -select m, m.getPath(), use, use.getName() diff --git a/javascript/ql/test/library-tests/ModuleImportNodes/ModuleImportNode.qll b/javascript/ql/test/library-tests/ModuleImportNodes/ModuleImportNode.qll new file mode 100644 index 000000000000..1bd9ccf00391 --- /dev/null +++ b/javascript/ql/test/library-tests/ModuleImportNodes/ModuleImportNode.qll @@ -0,0 +1,7 @@ +import javascript + +query predicate test_ModuleImportNode( + DataFlow::ModuleImportNode m, string res0, Identifier use, string res1 +) { + m.flowsToExpr(use) and res0 = m.getPath() and res1 = use.getName() +} diff --git a/javascript/ql/test/library-tests/ModuleImportNodes/ModuleImportNode_getAConstructorInvocation.expected b/javascript/ql/test/library-tests/ModuleImportNodes/ModuleImportNode_getAConstructorInvocation.expected deleted file mode 100644 index 65c907d416e5..000000000000 --- a/javascript/ql/test/library-tests/ModuleImportNodes/ModuleImportNode_getAConstructorInvocation.expected +++ /dev/null @@ -1,3 +0,0 @@ -| destructuringES6.js:1:1:1:41 | import ... ctron'; | destructuringES6.js:2:1:2:19 | new BrowserWindow() | -| destructuringRequire.js:1:27:1:45 | require('electron') | destructuringRequire.js:2:1:2:19 | new BrowserWindow() | -| moduleUses.js:1:11:1:24 | require('mod') | moduleUses.js:9:1:9:7 | new K() | diff --git a/javascript/ql/test/library-tests/ModuleImportNodes/ModuleImportNode_getAConstructorInvocation.ql b/javascript/ql/test/library-tests/ModuleImportNodes/ModuleImportNode_getAConstructorInvocation.ql deleted file mode 100644 index 523d74d14dc2..000000000000 --- a/javascript/ql/test/library-tests/ModuleImportNodes/ModuleImportNode_getAConstructorInvocation.ql +++ /dev/null @@ -1,4 +0,0 @@ -import javascript - -from DataFlow::ModuleImportNode m -select m, m.getAConstructorInvocation(_) diff --git a/javascript/ql/test/library-tests/ModuleImportNodes/ModuleImportNode_getAConstructorInvocation.qll b/javascript/ql/test/library-tests/ModuleImportNodes/ModuleImportNode_getAConstructorInvocation.qll new file mode 100644 index 000000000000..afaa61042e61 --- /dev/null +++ b/javascript/ql/test/library-tests/ModuleImportNodes/ModuleImportNode_getAConstructorInvocation.qll @@ -0,0 +1,7 @@ +import javascript + +query predicate test_ModuleImportNode_getAConstructorInvocation( + DataFlow::ModuleImportNode m, DataFlow::NewNode res +) { + res = m.getAConstructorInvocation(_) +} diff --git a/javascript/ql/test/library-tests/ModuleImportNodes/ModuleImportNode_getAMemberCall.expected b/javascript/ql/test/library-tests/ModuleImportNodes/ModuleImportNode_getAMemberCall.expected deleted file mode 100644 index 27fe096edfa4..000000000000 --- a/javascript/ql/test/library-tests/ModuleImportNodes/ModuleImportNode_getAMemberCall.expected +++ /dev/null @@ -1,4 +0,0 @@ -| amd1.js:1:25:1:26 | fs | amd1.js:2:3:2:29 | fs.read ... a.txt") | -| amd2.js:2:12:2:24 | require('fs') | amd2.js:3:3:3:29 | fs.read ... a.txt") | -| moduleUses.js:1:11:1:24 | require('mod') | moduleUses.js:3:1:3:18 | mod.moduleMethod() | -| moduleUses.js:1:11:1:24 | require('mod') | moduleUses.js:6:1:6:3 | f() | diff --git a/javascript/ql/test/library-tests/ModuleImportNodes/ModuleImportNode_getAMemberCall.ql b/javascript/ql/test/library-tests/ModuleImportNodes/ModuleImportNode_getAMemberCall.ql deleted file mode 100644 index c5be6db6a673..000000000000 --- a/javascript/ql/test/library-tests/ModuleImportNodes/ModuleImportNode_getAMemberCall.ql +++ /dev/null @@ -1,4 +0,0 @@ -import javascript - -from DataFlow::ModuleImportNode m -select m, m.getAMemberCall(_) diff --git a/javascript/ql/test/library-tests/ModuleImportNodes/ModuleImportNode_getAMemberCall.qll b/javascript/ql/test/library-tests/ModuleImportNodes/ModuleImportNode_getAMemberCall.qll new file mode 100644 index 000000000000..afccbc30fc5e --- /dev/null +++ b/javascript/ql/test/library-tests/ModuleImportNodes/ModuleImportNode_getAMemberCall.qll @@ -0,0 +1,7 @@ +import javascript + +query predicate test_ModuleImportNode_getAMemberCall( + DataFlow::ModuleImportNode m, DataFlow::CallNode res +) { + res = m.getAMemberCall(_) +} diff --git a/javascript/ql/test/library-tests/ModuleImportNodes/ModuleImportNode_getAMemberInvocation.expected b/javascript/ql/test/library-tests/ModuleImportNodes/ModuleImportNode_getAMemberInvocation.expected deleted file mode 100644 index 00019acba5d4..000000000000 --- a/javascript/ql/test/library-tests/ModuleImportNodes/ModuleImportNode_getAMemberInvocation.expected +++ /dev/null @@ -1,7 +0,0 @@ -| amd1.js:1:25:1:26 | fs | amd1.js:2:3:2:29 | fs.read ... a.txt") | -| amd2.js:2:12:2:24 | require('fs') | amd2.js:3:3:3:29 | fs.read ... a.txt") | -| destructuringES6.js:1:1:1:41 | import ... ctron'; | destructuringES6.js:2:1:2:19 | new BrowserWindow() | -| destructuringRequire.js:1:27:1:45 | require('electron') | destructuringRequire.js:2:1:2:19 | new BrowserWindow() | -| moduleUses.js:1:11:1:24 | require('mod') | moduleUses.js:3:1:3:18 | mod.moduleMethod() | -| moduleUses.js:1:11:1:24 | require('mod') | moduleUses.js:6:1:6:3 | f() | -| moduleUses.js:1:11:1:24 | require('mod') | moduleUses.js:9:1:9:7 | new K() | diff --git a/javascript/ql/test/library-tests/ModuleImportNodes/ModuleImportNode_getAMemberInvocation.ql b/javascript/ql/test/library-tests/ModuleImportNodes/ModuleImportNode_getAMemberInvocation.ql deleted file mode 100644 index 8b9e1d6d7c6e..000000000000 --- a/javascript/ql/test/library-tests/ModuleImportNodes/ModuleImportNode_getAMemberInvocation.ql +++ /dev/null @@ -1,4 +0,0 @@ -import javascript - -from DataFlow::ModuleImportNode m -select m, m.getAMemberInvocation(_) diff --git a/javascript/ql/test/library-tests/ModuleImportNodes/ModuleImportNode_getAMemberInvocation.qll b/javascript/ql/test/library-tests/ModuleImportNodes/ModuleImportNode_getAMemberInvocation.qll new file mode 100644 index 000000000000..c94cb7959488 --- /dev/null +++ b/javascript/ql/test/library-tests/ModuleImportNodes/ModuleImportNode_getAMemberInvocation.qll @@ -0,0 +1,7 @@ +import javascript + +query predicate test_ModuleImportNode_getAMemberInvocation( + DataFlow::ModuleImportNode m, DataFlow::InvokeNode res +) { + res = m.getAMemberInvocation(_) +} diff --git a/javascript/ql/test/library-tests/ModuleImportNodes/ModuleImportNode_getAMethodCall.expected b/javascript/ql/test/library-tests/ModuleImportNodes/ModuleImportNode_getAMethodCall.expected deleted file mode 100644 index 3f4e89ea7360..000000000000 --- a/javascript/ql/test/library-tests/ModuleImportNodes/ModuleImportNode_getAMethodCall.expected +++ /dev/null @@ -1,3 +0,0 @@ -| amd1.js:1:25:1:26 | fs | amd1.js:2:3:2:29 | fs.read ... a.txt") | -| amd2.js:2:12:2:24 | require('fs') | amd2.js:3:3:3:29 | fs.read ... a.txt") | -| moduleUses.js:1:11:1:24 | require('mod') | moduleUses.js:3:1:3:18 | mod.moduleMethod() | diff --git a/javascript/ql/test/library-tests/ModuleImportNodes/ModuleImportNode_getAMethodCall.ql b/javascript/ql/test/library-tests/ModuleImportNodes/ModuleImportNode_getAMethodCall.ql deleted file mode 100644 index 5259971552aa..000000000000 --- a/javascript/ql/test/library-tests/ModuleImportNodes/ModuleImportNode_getAMethodCall.ql +++ /dev/null @@ -1,4 +0,0 @@ -import javascript - -from DataFlow::ModuleImportNode m -select m, m.getAMethodCall(_) diff --git a/javascript/ql/test/library-tests/ModuleImportNodes/ModuleImportNode_getAMethodCall.qll b/javascript/ql/test/library-tests/ModuleImportNodes/ModuleImportNode_getAMethodCall.qll new file mode 100644 index 000000000000..b3ed3485de4e --- /dev/null +++ b/javascript/ql/test/library-tests/ModuleImportNodes/ModuleImportNode_getAMethodCall.qll @@ -0,0 +1,7 @@ +import javascript + +query predicate test_ModuleImportNode_getAMethodCall( + DataFlow::ModuleImportNode m, DataFlow::CallNode res +) { + res = m.getAMethodCall(_) +} diff --git a/javascript/ql/test/library-tests/ModuleImportNodes/ModuleImportNode_getAPropertyRead.expected b/javascript/ql/test/library-tests/ModuleImportNodes/ModuleImportNode_getAPropertyRead.expected deleted file mode 100644 index 27e475a39629..000000000000 --- a/javascript/ql/test/library-tests/ModuleImportNodes/ModuleImportNode_getAPropertyRead.expected +++ /dev/null @@ -1,9 +0,0 @@ -| amd1.js:1:25:1:26 | fs | amd1.js:2:3:2:17 | fs.readFileSync | -| amd2.js:2:12:2:24 | require('fs') | amd2.js:3:3:3:17 | fs.readFileSync | -| destructuringES6.js:1:1:1:41 | import ... ctron'; | destructuringES6.js:1:10:1:22 | BrowserWindow | -| destructuringRequire.js:1:27:1:45 | require('electron') | destructuringRequire.js:1:9:1:21 | BrowserWindow | -| instanceThroughDefaultImport.js:1:1:1:82 | import ... tance'; | instanceThroughDefaultImport.js:1:8:1:42 | myDefaultImportedModuleInstanceName | -| moduleUses.js:1:11:1:24 | require('mod') | moduleUses.js:3:1:3:16 | mod.moduleMethod | -| moduleUses.js:1:11:1:24 | require('mod') | moduleUses.js:5:9:5:26 | mod.moduleFunction | -| moduleUses.js:1:11:1:24 | require('mod') | moduleUses.js:8:9:8:31 | mod.con ... unction | -| moduleUses.js:1:11:1:24 | require('mod') | moduleUses.js:11:1:11:15 | mod.moduleField | diff --git a/javascript/ql/test/library-tests/ModuleImportNodes/ModuleImportNode_getAPropertyRead.ql b/javascript/ql/test/library-tests/ModuleImportNodes/ModuleImportNode_getAPropertyRead.ql deleted file mode 100644 index 1981fc36f492..000000000000 --- a/javascript/ql/test/library-tests/ModuleImportNodes/ModuleImportNode_getAPropertyRead.ql +++ /dev/null @@ -1,4 +0,0 @@ -import javascript - -from DataFlow::ModuleImportNode m -select m, m.getAPropertyRead(_) diff --git a/javascript/ql/test/library-tests/ModuleImportNodes/ModuleImportNode_getAPropertyRead.qll b/javascript/ql/test/library-tests/ModuleImportNodes/ModuleImportNode_getAPropertyRead.qll new file mode 100644 index 000000000000..6109e71507b7 --- /dev/null +++ b/javascript/ql/test/library-tests/ModuleImportNodes/ModuleImportNode_getAPropertyRead.qll @@ -0,0 +1,7 @@ +import javascript + +query predicate test_ModuleImportNode_getAPropertyRead( + DataFlow::ModuleImportNode m, DataFlow::PropRead res +) { + res = m.getAPropertyRead(_) +} diff --git a/javascript/ql/test/library-tests/ModuleImportNodes/ModuleImportNode_getPath.expected b/javascript/ql/test/library-tests/ModuleImportNodes/ModuleImportNode_getPath.expected deleted file mode 100644 index 8b43838302a3..000000000000 --- a/javascript/ql/test/library-tests/ModuleImportNodes/ModuleImportNode_getPath.expected +++ /dev/null @@ -1,9 +0,0 @@ -| amd1.js:1:25:1:26 | fs | fs | -| amd2.js:2:12:2:24 | require('fs') | fs | -| destructuringES6.js:1:1:1:41 | import ... ctron'; | electron | -| destructuringRequire.js:1:27:1:45 | require('electron') | electron | -| instanceThroughDefaultImport.js:1:1:1:82 | import ... tance'; | myDefaultImportedModuleInstance | -| instanceThroughDefaultImport.js:1:8:1:42 | myDefaultImportedModuleInstanceName | myDefaultImportedModuleInstance | -| instanceThroughNamespaceImport.js:1:8:1:49 | myNamespaceImportedModuleInstanceName | myNamespaceImportedModuleInstance | -| instanceThroughRequire.js:1:36:1:70 | require ... tance') | myRequiredModuleInstance | -| moduleUses.js:1:11:1:24 | require('mod') | mod | diff --git a/javascript/ql/test/library-tests/ModuleImportNodes/ModuleImportNode_getPath.ql b/javascript/ql/test/library-tests/ModuleImportNodes/ModuleImportNode_getPath.ql deleted file mode 100644 index 699b2b3efffb..000000000000 --- a/javascript/ql/test/library-tests/ModuleImportNodes/ModuleImportNode_getPath.ql +++ /dev/null @@ -1,4 +0,0 @@ -import javascript - -from DataFlow::ModuleImportNode m -select m, m.getPath() diff --git a/javascript/ql/test/library-tests/ModuleImportNodes/ModuleImportNode_getPath.qll b/javascript/ql/test/library-tests/ModuleImportNodes/ModuleImportNode_getPath.qll new file mode 100644 index 000000000000..212bdffcbade --- /dev/null +++ b/javascript/ql/test/library-tests/ModuleImportNodes/ModuleImportNode_getPath.qll @@ -0,0 +1,5 @@ +import javascript + +query predicate test_ModuleImportNode_getPath(DataFlow::ModuleImportNode m, string res) { + res = m.getPath() +} diff --git a/javascript/ql/test/library-tests/ModuleImportNodes/moduleImport.expected b/javascript/ql/test/library-tests/ModuleImportNodes/moduleImport.expected deleted file mode 100644 index 283bb966624e..000000000000 --- a/javascript/ql/test/library-tests/ModuleImportNodes/moduleImport.expected +++ /dev/null @@ -1,9 +0,0 @@ -| electron | destructuringES6.js:1:1:1:41 | import ... ctron'; | -| electron | destructuringRequire.js:1:27:1:45 | require('electron') | -| fs | amd1.js:1:25:1:26 | fs | -| fs | amd2.js:2:12:2:24 | require('fs') | -| mod | moduleUses.js:1:11:1:24 | require('mod') | -| myDefaultImportedModuleInstance | instanceThroughDefaultImport.js:1:1:1:82 | import ... tance'; | -| myDefaultImportedModuleInstance | instanceThroughDefaultImport.js:1:8:1:42 | myDefaultImportedModuleInstanceName | -| myNamespaceImportedModuleInstance | instanceThroughNamespaceImport.js:1:8:1:49 | myNamespaceImportedModuleInstanceName | -| myRequiredModuleInstance | instanceThroughRequire.js:1:36:1:70 | require ... tance') | diff --git a/javascript/ql/test/library-tests/ModuleImportNodes/moduleImport.ql b/javascript/ql/test/library-tests/ModuleImportNodes/moduleImport.ql deleted file mode 100644 index a60c45a2b0c8..000000000000 --- a/javascript/ql/test/library-tests/ModuleImportNodes/moduleImport.ql +++ /dev/null @@ -1,4 +0,0 @@ -import javascript - -from string path -select path, DataFlow::moduleImport(path) diff --git a/javascript/ql/test/library-tests/ModuleImportNodes/moduleImport.qll b/javascript/ql/test/library-tests/ModuleImportNodes/moduleImport.qll new file mode 100644 index 000000000000..65977c5a93a3 --- /dev/null +++ b/javascript/ql/test/library-tests/ModuleImportNodes/moduleImport.qll @@ -0,0 +1,5 @@ +import javascript + +query predicate test_moduleImport(string path, DataFlow::ModuleImportNode res) { + res = DataFlow::moduleImport(path) +} diff --git a/javascript/ql/test/library-tests/ModuleImportNodes/moduleImportProp.expected b/javascript/ql/test/library-tests/ModuleImportNodes/moduleImportProp.expected deleted file mode 100644 index 22b320cb3524..000000000000 --- a/javascript/ql/test/library-tests/ModuleImportNodes/moduleImportProp.expected +++ /dev/null @@ -1,9 +0,0 @@ -| electron | BrowserWindow | destructuringES6.js:1:10:1:22 | BrowserWindow | -| electron | BrowserWindow | destructuringRequire.js:1:9:1:21 | BrowserWindow | -| fs | readFileSync | amd1.js:2:3:2:17 | fs.readFileSync | -| fs | readFileSync | amd2.js:3:3:3:17 | fs.readFileSync | -| mod | constructorFunction | moduleUses.js:8:9:8:31 | mod.con ... unction | -| mod | moduleField | moduleUses.js:11:1:11:15 | mod.moduleField | -| mod | moduleFunction | moduleUses.js:5:9:5:26 | mod.moduleFunction | -| mod | moduleMethod | moduleUses.js:3:1:3:16 | mod.moduleMethod | -| myDefaultImportedModuleInstance | default | instanceThroughDefaultImport.js:1:8:1:42 | myDefaultImportedModuleInstanceName | diff --git a/javascript/ql/test/library-tests/ModuleImportNodes/moduleImportProp.ql b/javascript/ql/test/library-tests/ModuleImportNodes/moduleImportProp.ql deleted file mode 100644 index 46e1938e85b7..000000000000 --- a/javascript/ql/test/library-tests/ModuleImportNodes/moduleImportProp.ql +++ /dev/null @@ -1,4 +0,0 @@ -import javascript - -from string path, string prop -select path, prop, DataFlow::moduleImport(path).getAPropertyRead(prop) diff --git a/javascript/ql/test/library-tests/ModuleImportNodes/moduleImportProp.qll b/javascript/ql/test/library-tests/ModuleImportNodes/moduleImportProp.qll new file mode 100644 index 000000000000..f0508e1eff38 --- /dev/null +++ b/javascript/ql/test/library-tests/ModuleImportNodes/moduleImportProp.qll @@ -0,0 +1,5 @@ +import javascript + +query predicate test_moduleImportProp(string path, string prop, DataFlow::PropRead res) { + res = DataFlow::moduleImport(path).getAPropertyRead(prop) +} diff --git a/javascript/ql/test/library-tests/ModuleImportNodes/moduleMember.expected b/javascript/ql/test/library-tests/ModuleImportNodes/moduleMember.expected deleted file mode 100644 index 22b320cb3524..000000000000 --- a/javascript/ql/test/library-tests/ModuleImportNodes/moduleMember.expected +++ /dev/null @@ -1,9 +0,0 @@ -| electron | BrowserWindow | destructuringES6.js:1:10:1:22 | BrowserWindow | -| electron | BrowserWindow | destructuringRequire.js:1:9:1:21 | BrowserWindow | -| fs | readFileSync | amd1.js:2:3:2:17 | fs.readFileSync | -| fs | readFileSync | amd2.js:3:3:3:17 | fs.readFileSync | -| mod | constructorFunction | moduleUses.js:8:9:8:31 | mod.con ... unction | -| mod | moduleField | moduleUses.js:11:1:11:15 | mod.moduleField | -| mod | moduleFunction | moduleUses.js:5:9:5:26 | mod.moduleFunction | -| mod | moduleMethod | moduleUses.js:3:1:3:16 | mod.moduleMethod | -| myDefaultImportedModuleInstance | default | instanceThroughDefaultImport.js:1:8:1:42 | myDefaultImportedModuleInstanceName | diff --git a/javascript/ql/test/library-tests/ModuleImportNodes/moduleMember.ql b/javascript/ql/test/library-tests/ModuleImportNodes/moduleMember.ql deleted file mode 100644 index 7d8e74626ec0..000000000000 --- a/javascript/ql/test/library-tests/ModuleImportNodes/moduleMember.ql +++ /dev/null @@ -1,4 +0,0 @@ -import javascript - -from string path, string m -select path, m, DataFlow::moduleMember(path, m) diff --git a/javascript/ql/test/library-tests/ModuleImportNodes/moduleMember.qll b/javascript/ql/test/library-tests/ModuleImportNodes/moduleMember.qll new file mode 100644 index 000000000000..0f8625cb705d --- /dev/null +++ b/javascript/ql/test/library-tests/ModuleImportNodes/moduleMember.qll @@ -0,0 +1,5 @@ +import javascript + +query predicate test_moduleMember(string path, string m, DataFlow::SourceNode res) { + res = DataFlow::moduleMember(path, m) +} diff --git a/javascript/ql/test/library-tests/ModuleImportNodes/tests.expected b/javascript/ql/test/library-tests/ModuleImportNodes/tests.expected new file mode 100644 index 000000000000..5d6588b78b65 --- /dev/null +++ b/javascript/ql/test/library-tests/ModuleImportNodes/tests.expected @@ -0,0 +1,86 @@ +test_ModuleImportNode +| amd1.js:1:25:1:26 | fs | fs | amd1.js:2:3:2:4 | fs | fs | +| amd2.js:2:12:2:24 | require('fs') | fs | amd2.js:3:3:3:4 | fs | fs | +| instanceThroughDefaultImport.js:1:8:1:42 | myDefaultImportedModuleInstanceName | myDefaultImportedModuleInstance | instanceThroughDefaultImport.js:2:1:2:35 | myDefau ... nceName | myDefaultImportedModuleInstanceName | +| instanceThroughDefaultImport.js:1:8:1:42 | myDefaultImportedModuleInstanceName | myDefaultImportedModuleInstance | instanceThroughDefaultImport.js:4:5:4:39 | myDefau ... nceName | myDefaultImportedModuleInstanceName | +| instanceThroughNamespaceImport.js:1:8:1:49 | myNamespaceImportedModuleInstanceName | myNamespaceImportedModuleInstance | instanceThroughNamespaceImport.js:2:1:2:37 | myNames ... nceName | myNamespaceImportedModuleInstanceName | +| instanceThroughNamespaceImport.js:1:8:1:49 | myNamespaceImportedModuleInstanceName | myNamespaceImportedModuleInstance | instanceThroughNamespaceImport.js:4:5:4:41 | myNames ... nceName | myNamespaceImportedModuleInstanceName | +| instanceThroughRequire.js:1:36:1:70 | require ... tance') | myRequiredModuleInstance | instanceThroughRequire.js:2:1:2:28 | myRequi ... nceName | myRequiredModuleInstanceName | +| instanceThroughRequire.js:1:36:1:70 | require ... tance') | myRequiredModuleInstance | instanceThroughRequire.js:4:5:4:32 | myRequi ... nceName | myRequiredModuleInstanceName | +| moduleUses.js:1:11:1:24 | require('mod') | mod | moduleUses.js:3:1:3:3 | mod | mod | +| moduleUses.js:1:11:1:24 | require('mod') | mod | moduleUses.js:5:9:5:11 | mod | mod | +| moduleUses.js:1:11:1:24 | require('mod') | mod | moduleUses.js:8:9:8:11 | mod | mod | +| moduleUses.js:1:11:1:24 | require('mod') | mod | moduleUses.js:11:1:11:3 | mod | mod | +| moduleUses.js:1:11:1:24 | require('mod') | mod | moduleUses.js:13:1:13:3 | mod | mod | +| moduleUses.js:1:11:1:24 | require('mod') | mod | moduleUses.js:15:5:15:7 | mod | mod | +test_ModuleImportNode_getAConstructorInvocation +| destructuringES6.js:1:1:1:41 | import ... ctron'; | destructuringES6.js:2:1:2:19 | new BrowserWindow() | +| destructuringRequire.js:1:27:1:45 | require('electron') | destructuringRequire.js:2:1:2:19 | new BrowserWindow() | +| moduleUses.js:1:11:1:24 | require('mod') | moduleUses.js:9:1:9:7 | new K() | +test_moduleImport +| electron | destructuringES6.js:1:1:1:41 | import ... ctron'; | +| electron | destructuringRequire.js:1:27:1:45 | require('electron') | +| fs | amd1.js:1:25:1:26 | fs | +| fs | amd2.js:2:12:2:24 | require('fs') | +| mod | moduleUses.js:1:11:1:24 | require('mod') | +| myDefaultImportedModuleInstance | instanceThroughDefaultImport.js:1:1:1:82 | import ... tance'; | +| myDefaultImportedModuleInstance | instanceThroughDefaultImport.js:1:8:1:42 | myDefaultImportedModuleInstanceName | +| myNamespaceImportedModuleInstance | instanceThroughNamespaceImport.js:1:8:1:49 | myNamespaceImportedModuleInstanceName | +| myRequiredModuleInstance | instanceThroughRequire.js:1:36:1:70 | require ... tance') | +test_moduleMember +| electron | BrowserWindow | destructuringES6.js:1:10:1:22 | BrowserWindow | +| electron | BrowserWindow | destructuringRequire.js:1:9:1:21 | BrowserWindow | +| fs | readFileSync | amd1.js:2:3:2:17 | fs.readFileSync | +| fs | readFileSync | amd2.js:3:3:3:17 | fs.readFileSync | +| mod | constructorFunction | moduleUses.js:8:9:8:31 | mod.con ... unction | +| mod | moduleField | moduleUses.js:11:1:11:15 | mod.moduleField | +| mod | moduleFunction | moduleUses.js:5:9:5:26 | mod.moduleFunction | +| mod | moduleMethod | moduleUses.js:3:1:3:16 | mod.moduleMethod | +| myDefaultImportedModuleInstance | default | instanceThroughDefaultImport.js:1:8:1:42 | myDefaultImportedModuleInstanceName | +test_ModuleImportNode_getPath +| amd1.js:1:25:1:26 | fs | fs | +| amd2.js:2:12:2:24 | require('fs') | fs | +| destructuringES6.js:1:1:1:41 | import ... ctron'; | electron | +| destructuringRequire.js:1:27:1:45 | require('electron') | electron | +| instanceThroughDefaultImport.js:1:1:1:82 | import ... tance'; | myDefaultImportedModuleInstance | +| instanceThroughDefaultImport.js:1:8:1:42 | myDefaultImportedModuleInstanceName | myDefaultImportedModuleInstance | +| instanceThroughNamespaceImport.js:1:8:1:49 | myNamespaceImportedModuleInstanceName | myNamespaceImportedModuleInstance | +| instanceThroughRequire.js:1:36:1:70 | require ... tance') | myRequiredModuleInstance | +| moduleUses.js:1:11:1:24 | require('mod') | mod | +test_ModuleImportNode_getAMethodCall +| amd1.js:1:25:1:26 | fs | amd1.js:2:3:2:29 | fs.read ... a.txt") | +| amd2.js:2:12:2:24 | require('fs') | amd2.js:3:3:3:29 | fs.read ... a.txt") | +| moduleUses.js:1:11:1:24 | require('mod') | moduleUses.js:3:1:3:18 | mod.moduleMethod() | +test_ModuleImportNode_getAMemberInvocation +| amd1.js:1:25:1:26 | fs | amd1.js:2:3:2:29 | fs.read ... a.txt") | +| amd2.js:2:12:2:24 | require('fs') | amd2.js:3:3:3:29 | fs.read ... a.txt") | +| destructuringES6.js:1:1:1:41 | import ... ctron'; | destructuringES6.js:2:1:2:19 | new BrowserWindow() | +| destructuringRequire.js:1:27:1:45 | require('electron') | destructuringRequire.js:2:1:2:19 | new BrowserWindow() | +| moduleUses.js:1:11:1:24 | require('mod') | moduleUses.js:3:1:3:18 | mod.moduleMethod() | +| moduleUses.js:1:11:1:24 | require('mod') | moduleUses.js:6:1:6:3 | f() | +| moduleUses.js:1:11:1:24 | require('mod') | moduleUses.js:9:1:9:7 | new K() | +test_moduleImportProp +| electron | BrowserWindow | destructuringES6.js:1:10:1:22 | BrowserWindow | +| electron | BrowserWindow | destructuringRequire.js:1:9:1:21 | BrowserWindow | +| fs | readFileSync | amd1.js:2:3:2:17 | fs.readFileSync | +| fs | readFileSync | amd2.js:3:3:3:17 | fs.readFileSync | +| mod | constructorFunction | moduleUses.js:8:9:8:31 | mod.con ... unction | +| mod | moduleField | moduleUses.js:11:1:11:15 | mod.moduleField | +| mod | moduleFunction | moduleUses.js:5:9:5:26 | mod.moduleFunction | +| mod | moduleMethod | moduleUses.js:3:1:3:16 | mod.moduleMethod | +| myDefaultImportedModuleInstance | default | instanceThroughDefaultImport.js:1:8:1:42 | myDefaultImportedModuleInstanceName | +test_ModuleImportNode_getAMemberCall +| amd1.js:1:25:1:26 | fs | amd1.js:2:3:2:29 | fs.read ... a.txt") | +| amd2.js:2:12:2:24 | require('fs') | amd2.js:3:3:3:29 | fs.read ... a.txt") | +| moduleUses.js:1:11:1:24 | require('mod') | moduleUses.js:3:1:3:18 | mod.moduleMethod() | +| moduleUses.js:1:11:1:24 | require('mod') | moduleUses.js:6:1:6:3 | f() | +test_ModuleImportNode_getAPropertyRead +| amd1.js:1:25:1:26 | fs | amd1.js:2:3:2:17 | fs.readFileSync | +| amd2.js:2:12:2:24 | require('fs') | amd2.js:3:3:3:17 | fs.readFileSync | +| destructuringES6.js:1:1:1:41 | import ... ctron'; | destructuringES6.js:1:10:1:22 | BrowserWindow | +| destructuringRequire.js:1:27:1:45 | require('electron') | destructuringRequire.js:1:9:1:21 | BrowserWindow | +| instanceThroughDefaultImport.js:1:1:1:82 | import ... tance'; | instanceThroughDefaultImport.js:1:8:1:42 | myDefaultImportedModuleInstanceName | +| moduleUses.js:1:11:1:24 | require('mod') | moduleUses.js:3:1:3:16 | mod.moduleMethod | +| moduleUses.js:1:11:1:24 | require('mod') | moduleUses.js:5:9:5:26 | mod.moduleFunction | +| moduleUses.js:1:11:1:24 | require('mod') | moduleUses.js:8:9:8:31 | mod.con ... unction | +| moduleUses.js:1:11:1:24 | require('mod') | moduleUses.js:11:1:11:15 | mod.moduleField | diff --git a/javascript/ql/test/library-tests/ModuleImportNodes/tests.ql b/javascript/ql/test/library-tests/ModuleImportNodes/tests.ql new file mode 100644 index 000000000000..d1867185deb2 --- /dev/null +++ b/javascript/ql/test/library-tests/ModuleImportNodes/tests.ql @@ -0,0 +1,10 @@ +import ModuleImportNode +import ModuleImportNode_getAConstructorInvocation +import moduleImport +import moduleMember +import ModuleImportNode_getPath +import ModuleImportNode_getAMethodCall +import ModuleImportNode_getAMemberInvocation +import moduleImportProp +import ModuleImportNode_getAMemberCall +import ModuleImportNode_getAPropertyRead diff --git a/javascript/ql/test/library-tests/Modules/BulkReExportDeclarations.expected b/javascript/ql/test/library-tests/Modules/BulkReExportDeclarations.expected deleted file mode 100644 index d6e19b447917..000000000000 --- a/javascript/ql/test/library-tests/Modules/BulkReExportDeclarations.expected +++ /dev/null @@ -1 +0,0 @@ -| d.js:4:1:4:20 | export * from 'm/c'; | diff --git a/javascript/ql/test/library-tests/Modules/BulkReExportDeclarations.ql b/javascript/ql/test/library-tests/Modules/BulkReExportDeclarations.ql deleted file mode 100644 index c185f7c665a7..000000000000 --- a/javascript/ql/test/library-tests/Modules/BulkReExportDeclarations.ql +++ /dev/null @@ -1,4 +0,0 @@ -import semmle.javascript.ES2015Modules - -from BulkReExportDeclaration bred -select bred diff --git a/javascript/ql/test/library-tests/Modules/BulkReExportDeclarations.qll b/javascript/ql/test/library-tests/Modules/BulkReExportDeclarations.qll new file mode 100644 index 000000000000..ddb997248612 --- /dev/null +++ b/javascript/ql/test/library-tests/Modules/BulkReExportDeclarations.qll @@ -0,0 +1,3 @@ +import semmle.javascript.ES2015Modules + +query predicate test_BulkReExportDeclarations(BulkReExportDeclaration bred) { any() } diff --git a/javascript/ql/test/library-tests/Modules/ExportDeclarations.expected b/javascript/ql/test/library-tests/Modules/ExportDeclarations.expected deleted file mode 100644 index 44e8e4ce1697..000000000000 --- a/javascript/ql/test/library-tests/Modules/ExportDeclarations.expected +++ /dev/null @@ -1,12 +0,0 @@ -| a.js:1:1:3:1 | export ... n 23;\\n} | -| a.js:5:1:5:32 | export ... } = o; | -| b.js:5:1:5:18 | export { f as g }; | -| b.js:7:1:7:21 | export ... './a'; | -| d.js:4:1:4:20 | export * from 'm/c'; | -| e.js:2:1:2:16 | export { x, y }; | -| e.js:3:1:3:35 | export ... './a'; | -| es2015_require.js:3:1:3:25 | export ... ss C {} | -| export-in-mjs.mjs:1:1:1:34 | export ... s = 42; | -| f.ts:5:1:5:24 | export ... oo() {} | -| m/c.js:5:1:5:30 | export ... '../b'; | -| tst.html:7:3:7:22 | export const y = 42; | diff --git a/javascript/ql/test/library-tests/Modules/ExportDeclarations.ql b/javascript/ql/test/library-tests/Modules/ExportDeclarations.ql deleted file mode 100644 index a3648aa92225..000000000000 --- a/javascript/ql/test/library-tests/Modules/ExportDeclarations.ql +++ /dev/null @@ -1,4 +0,0 @@ -import semmle.javascript.ES2015Modules - -from ExportDeclaration ed -select ed diff --git a/javascript/ql/test/library-tests/Modules/ExportDeclarations.qll b/javascript/ql/test/library-tests/Modules/ExportDeclarations.qll new file mode 100644 index 000000000000..93a296fc3983 --- /dev/null +++ b/javascript/ql/test/library-tests/Modules/ExportDeclarations.qll @@ -0,0 +1,3 @@ +import semmle.javascript.ES2015Modules + +query predicate test_ExportDeclarations(ExportDeclaration ed) { any() } diff --git a/javascript/ql/test/library-tests/Modules/ExportDefaultDeclarations.expected b/javascript/ql/test/library-tests/Modules/ExportDefaultDeclarations.expected deleted file mode 100644 index 1829f4ee81eb..000000000000 --- a/javascript/ql/test/library-tests/Modules/ExportDefaultDeclarations.expected +++ /dev/null @@ -1,2 +0,0 @@ -| a.js:1:1:3:1 | export ... n 23;\\n} | -| es2015_require.js:3:1:3:25 | export ... ss C {} | diff --git a/javascript/ql/test/library-tests/Modules/ExportDefaultDeclarations.ql b/javascript/ql/test/library-tests/Modules/ExportDefaultDeclarations.ql deleted file mode 100644 index cd4b74eac49e..000000000000 --- a/javascript/ql/test/library-tests/Modules/ExportDefaultDeclarations.ql +++ /dev/null @@ -1,4 +0,0 @@ -import semmle.javascript.ES2015Modules - -from ExportDefaultDeclaration edd -select edd diff --git a/javascript/ql/test/library-tests/Modules/ExportDefaultDeclarations.qll b/javascript/ql/test/library-tests/Modules/ExportDefaultDeclarations.qll new file mode 100644 index 000000000000..9dd1f189db0c --- /dev/null +++ b/javascript/ql/test/library-tests/Modules/ExportDefaultDeclarations.qll @@ -0,0 +1,3 @@ +import semmle.javascript.ES2015Modules + +query predicate test_ExportDefaultDeclarations(ExportDefaultDeclaration edd) { any() } diff --git a/javascript/ql/test/library-tests/Modules/ExportSpecifiers.expected b/javascript/ql/test/library-tests/Modules/ExportSpecifiers.expected deleted file mode 100644 index 3186556790ff..000000000000 --- a/javascript/ql/test/library-tests/Modules/ExportSpecifiers.expected +++ /dev/null @@ -1,5 +0,0 @@ -| b.js:5:10:5:15 | f as g | b.js:5:10:5:10 | f | b.js:5:15:5:15 | g | -| e.js:2:10:2:10 | x | e.js:2:10:2:10 | x | e.js:2:10:2:10 | x | -| e.js:2:13:2:13 | y | e.js:2:13:2:13 | y | e.js:2:13:2:13 | y | -| e.js:3:10:3:21 | default as g | e.js:3:10:3:16 | default | e.js:3:21:3:21 | g | -| m/c.js:5:10:5:15 | g as h | m/c.js:5:10:5:10 | g | m/c.js:5:15:5:15 | h | diff --git a/javascript/ql/test/library-tests/Modules/ExportSpecifiers.ql b/javascript/ql/test/library-tests/Modules/ExportSpecifiers.ql deleted file mode 100644 index 57f0f7803732..000000000000 --- a/javascript/ql/test/library-tests/Modules/ExportSpecifiers.ql +++ /dev/null @@ -1,4 +0,0 @@ -import semmle.javascript.ES2015Modules - -from ExportSpecifier es -select es, es.getLocal(), es.getExported() diff --git a/javascript/ql/test/library-tests/Modules/ExportSpecifiers.qll b/javascript/ql/test/library-tests/Modules/ExportSpecifiers.qll new file mode 100644 index 000000000000..dc87e21f4185 --- /dev/null +++ b/javascript/ql/test/library-tests/Modules/ExportSpecifiers.qll @@ -0,0 +1,5 @@ +import semmle.javascript.ES2015Modules + +query predicate test_ExportSpecifiers(ExportSpecifier es, Identifier res0, Identifier res1) { + res0 = es.getLocal() and res1 = es.getExported() +} diff --git a/javascript/ql/test/library-tests/Modules/GlobalVariableRef.expected b/javascript/ql/test/library-tests/Modules/GlobalVariableRef.expected deleted file mode 100644 index 90cf72071ae8..000000000000 --- a/javascript/ql/test/library-tests/Modules/GlobalVariableRef.expected +++ /dev/null @@ -1,3 +0,0 @@ -| a.js:5:31:5:31 | o | -| exports.js:3:9:3:15 | exports | -| tst.html:6:3:6:7 | alert | diff --git a/javascript/ql/test/library-tests/Modules/GlobalVariableRef.ql b/javascript/ql/test/library-tests/Modules/GlobalVariableRef.ql deleted file mode 100644 index 5b06a07a2267..000000000000 --- a/javascript/ql/test/library-tests/Modules/GlobalVariableRef.ql +++ /dev/null @@ -1,5 +0,0 @@ -import javascript - -from VarAccess access -where access.getVariable() instanceof GlobalVariable -select access diff --git a/javascript/ql/test/library-tests/Modules/GlobalVariableRef.qll b/javascript/ql/test/library-tests/Modules/GlobalVariableRef.qll new file mode 100644 index 000000000000..d99709299292 --- /dev/null +++ b/javascript/ql/test/library-tests/Modules/GlobalVariableRef.qll @@ -0,0 +1,5 @@ +import javascript + +query predicate test_GlobalVariableRef(VarAccess access) { + access.getVariable() instanceof GlobalVariable +} diff --git a/javascript/ql/test/library-tests/Modules/ImportDefaultSpecifiers.expected b/javascript/ql/test/library-tests/Modules/ImportDefaultSpecifiers.expected deleted file mode 100644 index 956ca965eac8..000000000000 --- a/javascript/ql/test/library-tests/Modules/ImportDefaultSpecifiers.expected +++ /dev/null @@ -1,5 +0,0 @@ -| b.js:1:8:1:8 | f | -| f.ts:1:8:1:8 | g | -| import-in-mjs.mjs:1:8:1:24 | exported_from_mjs | -| tst.html:5:10:5:10 | f | -| unresolved.js:1:8:1:8 | f | diff --git a/javascript/ql/test/library-tests/Modules/ImportDefaultSpecifiers.ql b/javascript/ql/test/library-tests/Modules/ImportDefaultSpecifiers.ql deleted file mode 100644 index b6f7e0e32808..000000000000 --- a/javascript/ql/test/library-tests/Modules/ImportDefaultSpecifiers.ql +++ /dev/null @@ -1,4 +0,0 @@ -import semmle.javascript.ES2015Modules - -from ImportDefaultSpecifier ids -select ids diff --git a/javascript/ql/test/library-tests/Modules/ImportDefaultSpecifiers.qll b/javascript/ql/test/library-tests/Modules/ImportDefaultSpecifiers.qll new file mode 100644 index 000000000000..5d5dbb34e6a1 --- /dev/null +++ b/javascript/ql/test/library-tests/Modules/ImportDefaultSpecifiers.qll @@ -0,0 +1,3 @@ +import semmle.javascript.ES2015Modules + +query predicate test_ImportDefaultSpecifiers(ImportDefaultSpecifier ids) { any() } diff --git a/javascript/ql/test/library-tests/Modules/ImportNamespaceSpecifier.expected b/javascript/ql/test/library-tests/Modules/ImportNamespaceSpecifier.expected deleted file mode 100644 index 61093b96451f..000000000000 --- a/javascript/ql/test/library-tests/Modules/ImportNamespaceSpecifier.expected +++ /dev/null @@ -1,2 +0,0 @@ -| exports.js:1:8:1:17 | * as dummy | -| m/c.js:1:8:1:13 | * as b | diff --git a/javascript/ql/test/library-tests/Modules/ImportNamespaceSpecifier.ql b/javascript/ql/test/library-tests/Modules/ImportNamespaceSpecifier.ql deleted file mode 100644 index 06d3deda823a..000000000000 --- a/javascript/ql/test/library-tests/Modules/ImportNamespaceSpecifier.ql +++ /dev/null @@ -1,4 +0,0 @@ -import semmle.javascript.ES2015Modules - -from ImportNamespaceSpecifier ins -select ins diff --git a/javascript/ql/test/library-tests/Modules/ImportNamespaceSpecifier.qll b/javascript/ql/test/library-tests/Modules/ImportNamespaceSpecifier.qll new file mode 100644 index 000000000000..b3362878e448 --- /dev/null +++ b/javascript/ql/test/library-tests/Modules/ImportNamespaceSpecifier.qll @@ -0,0 +1,3 @@ +import semmle.javascript.ES2015Modules + +query predicate test_ImportNamespaceSpecifier(ImportNamespaceSpecifier ins) { any() } diff --git a/javascript/ql/test/library-tests/Modules/ImportSpecifiers.expected b/javascript/ql/test/library-tests/Modules/ImportSpecifiers.expected deleted file mode 100644 index 73763be74506..000000000000 --- a/javascript/ql/test/library-tests/Modules/ImportSpecifiers.expected +++ /dev/null @@ -1,10 +0,0 @@ -| b.js:1:8:1:8 | f | b.js:1:8:1:8 | f | -| d.js:1:10:1:21 | default as g | d.js:1:21:1:21 | g | -| d.js:1:24:1:29 | x as y | d.js:1:29:1:29 | y | -| exports.js:1:8:1:17 | * as dummy | exports.js:1:13:1:17 | dummy | -| f.ts:1:8:1:8 | g | f.ts:1:8:1:8 | g | -| g.ts:1:9:1:11 | foo | g.ts:1:9:1:11 | foo | -| import-in-mjs.mjs:1:8:1:24 | exported_from_mjs | import-in-mjs.mjs:1:8:1:24 | exported_from_mjs | -| m/c.js:1:8:1:13 | * as b | m/c.js:1:13:1:13 | b | -| tst.html:5:10:5:10 | f | tst.html:5:10:5:10 | f | -| unresolved.js:1:8:1:8 | f | unresolved.js:1:8:1:8 | f | diff --git a/javascript/ql/test/library-tests/Modules/ImportSpecifiers.ql b/javascript/ql/test/library-tests/Modules/ImportSpecifiers.ql deleted file mode 100644 index 5e21ff366c06..000000000000 --- a/javascript/ql/test/library-tests/Modules/ImportSpecifiers.ql +++ /dev/null @@ -1,4 +0,0 @@ -import semmle.javascript.ES2015Modules - -from ImportSpecifier is -select is, is.getLocal() diff --git a/javascript/ql/test/library-tests/Modules/ImportSpecifiers.qll b/javascript/ql/test/library-tests/Modules/ImportSpecifiers.qll new file mode 100644 index 000000000000..4ac2c16bd45f --- /dev/null +++ b/javascript/ql/test/library-tests/Modules/ImportSpecifiers.qll @@ -0,0 +1,3 @@ +import semmle.javascript.ES2015Modules + +query predicate test_ImportSpecifiers(ImportSpecifier is, VarDecl res) { res = is.getLocal() } diff --git a/javascript/ql/test/library-tests/Modules/Imports.expected b/javascript/ql/test/library-tests/Modules/Imports.expected deleted file mode 100644 index 723f35420390..000000000000 --- a/javascript/ql/test/library-tests/Modules/Imports.expected +++ /dev/null @@ -1,10 +0,0 @@ -| b.js:1:1:1:20 | import f from './a'; | b.js:1:15:1:19 | './a' | 1 | -| d.js:1:1:1:43 | import ... './a'; | d.js:1:38:1:42 | './a' | 2 | -| d.js:2:1:2:13 | import './b'; | d.js:2:8:2:12 | './b' | 0 | -| exports.js:1:1:1:31 | import ... dummy'; | exports.js:1:24:1:30 | 'dummy' | 1 | -| f.ts:1:1:1:19 | import g from './e' | f.ts:1:15:1:19 | './e' | 1 | -| g.ts:1:1:1:23 | import ... m './f' | g.ts:1:19:1:23 | './f' | 1 | -| import-in-mjs.mjs:1:1:1:46 | import ... n-mjs'; | import-in-mjs.mjs:1:31:1:45 | 'export-in-mjs' | 1 | -| m/c.js:1:1:1:26 | import ... '../b'; | m/c.js:1:20:1:25 | '../b' | 1 | -| tst.html:5:3:5:20 | import f from 'a'; | tst.html:5:17:5:19 | 'a' | 1 | -| unresolved.js:1:1:1:18 | import f from 'a'; | unresolved.js:1:15:1:17 | 'a' | 1 | diff --git a/javascript/ql/test/library-tests/Modules/Imports.ql b/javascript/ql/test/library-tests/Modules/Imports.ql deleted file mode 100644 index 976e77bc11a7..000000000000 --- a/javascript/ql/test/library-tests/Modules/Imports.ql +++ /dev/null @@ -1,4 +0,0 @@ -import semmle.javascript.ES2015Modules - -from ImportDeclaration id -select id, id.getImportedPath(), count(id.getASpecifier()) diff --git a/javascript/ql/test/library-tests/Modules/Imports.qll b/javascript/ql/test/library-tests/Modules/Imports.qll new file mode 100644 index 000000000000..389e433c59fe --- /dev/null +++ b/javascript/ql/test/library-tests/Modules/Imports.qll @@ -0,0 +1,5 @@ +import semmle.javascript.ES2015Modules + +query predicate test_Imports(ImportDeclaration id, PathExprInModule res0, int res1) { + res0 = id.getImportedPath() and res1 = count(id.getASpecifier()) +} diff --git a/javascript/ql/test/library-tests/Modules/Module_exports.expected b/javascript/ql/test/library-tests/Modules/Module_exports.expected deleted file mode 100644 index 6865e86c163b..000000000000 --- a/javascript/ql/test/library-tests/Modules/Module_exports.expected +++ /dev/null @@ -1,13 +0,0 @@ -| a.js:1:1:5:32 | | default | a.js:1:1:3:1 | export ... n 23;\\n} | -| a.js:1:1:5:32 | | x | a.js:5:1:5:32 | export ... } = o; | -| a.js:1:1:5:32 | | y | a.js:5:1:5:32 | export ... } = o; | -| b.js:1:1:10:0 | | f2 | b.js:7:1:7:21 | export ... './a'; | -| b.js:1:1:10:0 | | g | b.js:5:1:5:18 | export { f as g }; | -| e.js:1:1:4:0 | | g | e.js:3:1:3:35 | export ... './a'; | -| e.js:1:1:4:0 | | x | e.js:2:1:2:16 | export { x, y }; | -| e.js:1:1:4:0 | | y | e.js:2:1:2:16 | export { x, y }; | -| es2015_require.js:1:1:3:25 | | default | es2015_require.js:3:1:3:25 | export ... ss C {} | -| export-in-mjs.mjs:1:1:1:34 | | exported_from_mjs | export-in-mjs.mjs:1:1:1:34 | export ... s = 42; | -| f.ts:1:1:6:0 | | foo | f.ts:5:1:5:24 | export ... oo() {} | -| m/c.js:1:1:8:0 | | h | m/c.js:5:1:5:30 | export ... '../b'; | -| tst.html:4:23:8:0 | | y | tst.html:7:3:7:22 | export const y = 42; | diff --git a/javascript/ql/test/library-tests/Modules/Module_exports.ql b/javascript/ql/test/library-tests/Modules/Module_exports.ql deleted file mode 100644 index eaeccca92122..000000000000 --- a/javascript/ql/test/library-tests/Modules/Module_exports.ql +++ /dev/null @@ -1,5 +0,0 @@ -import javascript - -from Module m, string name, ASTNode export -where m.exports(name, export) -select m, name, export diff --git a/javascript/ql/test/library-tests/Modules/Module_exports.qll b/javascript/ql/test/library-tests/Modules/Module_exports.qll new file mode 100644 index 000000000000..edb931a22a0f --- /dev/null +++ b/javascript/ql/test/library-tests/Modules/Module_exports.qll @@ -0,0 +1,5 @@ +import javascript + +query predicate test_Module_exports(Module m, string name, ASTNode export) { + m.exports(name, export) +} diff --git a/javascript/ql/test/library-tests/Modules/NamedImportSpecifier.expected b/javascript/ql/test/library-tests/Modules/NamedImportSpecifier.expected deleted file mode 100644 index c75d55af1a62..000000000000 --- a/javascript/ql/test/library-tests/Modules/NamedImportSpecifier.expected +++ /dev/null @@ -1,3 +0,0 @@ -| d.js:1:10:1:21 | default as g | -| d.js:1:24:1:29 | x as y | -| g.ts:1:9:1:11 | foo | diff --git a/javascript/ql/test/library-tests/Modules/NamedImportSpecifier.ql b/javascript/ql/test/library-tests/Modules/NamedImportSpecifier.ql deleted file mode 100644 index a2e519319e49..000000000000 --- a/javascript/ql/test/library-tests/Modules/NamedImportSpecifier.ql +++ /dev/null @@ -1,4 +0,0 @@ -import semmle.javascript.ES2015Modules - -from NamedImportSpecifier nis -select nis diff --git a/javascript/ql/test/library-tests/Modules/NamedImportSpecifier.qll b/javascript/ql/test/library-tests/Modules/NamedImportSpecifier.qll new file mode 100644 index 000000000000..2206a941f472 --- /dev/null +++ b/javascript/ql/test/library-tests/Modules/NamedImportSpecifier.qll @@ -0,0 +1,3 @@ +import semmle.javascript.ES2015Modules + +query predicate test_NamedImportSpecifier(NamedImportSpecifier nis) { any() } diff --git a/javascript/ql/test/library-tests/Modules/OtherImports.expected b/javascript/ql/test/library-tests/Modules/OtherImports.expected deleted file mode 100644 index 5e0bbcae88cf..000000000000 --- a/javascript/ql/test/library-tests/Modules/OtherImports.expected +++ /dev/null @@ -1 +0,0 @@ -| es2015_require.js:1:11:1:24 | require('./d') | d.js:1:1:5:0 | | diff --git a/javascript/ql/test/library-tests/Modules/OtherImports.ql b/javascript/ql/test/library-tests/Modules/OtherImports.ql deleted file mode 100644 index e9f38b1e6da8..000000000000 --- a/javascript/ql/test/library-tests/Modules/OtherImports.ql +++ /dev/null @@ -1,5 +0,0 @@ -import javascript - -from Import imprt -where not imprt instanceof ImportDeclaration -select imprt, imprt.getImportedModule() diff --git a/javascript/ql/test/library-tests/Modules/OtherImports.qll b/javascript/ql/test/library-tests/Modules/OtherImports.qll new file mode 100644 index 000000000000..84ec0bff6808 --- /dev/null +++ b/javascript/ql/test/library-tests/Modules/OtherImports.qll @@ -0,0 +1,5 @@ +import javascript + +query predicate test_OtherImports(Import imprt, Module res) { + not imprt instanceof ImportDeclaration and res = imprt.getImportedModule() +} diff --git a/javascript/ql/test/library-tests/Modules/ReExportDeclarations.expected b/javascript/ql/test/library-tests/Modules/ReExportDeclarations.expected deleted file mode 100644 index e90a6dd2be1b..000000000000 --- a/javascript/ql/test/library-tests/Modules/ReExportDeclarations.expected +++ /dev/null @@ -1,4 +0,0 @@ -| b.js:7:1:7:21 | export ... './a'; | b.js:7:16:7:20 | './a' | -| d.js:4:1:4:20 | export * from 'm/c'; | d.js:4:15:4:19 | 'm/c' | -| e.js:3:1:3:35 | export ... './a'; | e.js:3:30:3:34 | './a' | -| m/c.js:5:1:5:30 | export ... '../b'; | m/c.js:5:24:5:29 | '../b' | diff --git a/javascript/ql/test/library-tests/Modules/ReExportDeclarations.ql b/javascript/ql/test/library-tests/Modules/ReExportDeclarations.ql deleted file mode 100644 index db66be3c45c0..000000000000 --- a/javascript/ql/test/library-tests/Modules/ReExportDeclarations.ql +++ /dev/null @@ -1,4 +0,0 @@ -import semmle.javascript.ES2015Modules - -from ReExportDeclaration red -select red, red.getImportedPath() diff --git a/javascript/ql/test/library-tests/Modules/ReExportDeclarations.qll b/javascript/ql/test/library-tests/Modules/ReExportDeclarations.qll new file mode 100644 index 000000000000..860a9c77a8e4 --- /dev/null +++ b/javascript/ql/test/library-tests/Modules/ReExportDeclarations.qll @@ -0,0 +1,5 @@ +import semmle.javascript.ES2015Modules + +query predicate test_ReExportDeclarations(ReExportDeclaration red, ConstantString res) { + res = red.getImportedPath() +} diff --git a/javascript/ql/test/library-tests/Modules/getAnImportedModule.expected b/javascript/ql/test/library-tests/Modules/getAnImportedModule.expected deleted file mode 100644 index dd02258c9f7f..000000000000 --- a/javascript/ql/test/library-tests/Modules/getAnImportedModule.expected +++ /dev/null @@ -1,7 +0,0 @@ -| b.js | a.js | -| d.js | a.js | -| d.js | b.js | -| es2015_require.js | d.js | -| f.ts | e.js | -| g.ts | f.ts | -| m/c.js | b.js | diff --git a/javascript/ql/test/library-tests/Modules/getAnImportedModule.ql b/javascript/ql/test/library-tests/Modules/getAnImportedModule.ql deleted file mode 100644 index 2b4b2b8f15fb..000000000000 --- a/javascript/ql/test/library-tests/Modules/getAnImportedModule.ql +++ /dev/null @@ -1,4 +0,0 @@ -import javascript - -from Module mod -select mod.getFile().getRelativePath(), mod.getAnImportedModule().getFile().getRelativePath() diff --git a/javascript/ql/test/library-tests/Modules/getAnImportedModule.qll b/javascript/ql/test/library-tests/Modules/getAnImportedModule.qll new file mode 100644 index 000000000000..aaafcb75d01c --- /dev/null +++ b/javascript/ql/test/library-tests/Modules/getAnImportedModule.qll @@ -0,0 +1,8 @@ +import javascript + +query predicate test_getAnImportedModule(string res0, string res1) { + exists(Module mod | + res0 = mod.getFile().getRelativePath() and + res1 = mod.getAnImportedModule().getFile().getRelativePath() + ) +} diff --git a/javascript/ql/test/library-tests/Modules/getExportedName.expected b/javascript/ql/test/library-tests/Modules/getExportedName.expected deleted file mode 100644 index 63a5350caf3b..000000000000 --- a/javascript/ql/test/library-tests/Modules/getExportedName.expected +++ /dev/null @@ -1,6 +0,0 @@ -| b.js:5:10:5:15 | f as g | f | -| b.js:7:8:7:9 | f2 | default | -| e.js:2:10:2:10 | x | x | -| e.js:2:13:2:13 | y | y | -| e.js:3:10:3:21 | default as g | default | -| m/c.js:5:10:5:15 | g as h | g | diff --git a/javascript/ql/test/library-tests/Modules/getExportedName.ql b/javascript/ql/test/library-tests/Modules/getExportedName.ql deleted file mode 100644 index b2348c6e76fa..000000000000 --- a/javascript/ql/test/library-tests/Modules/getExportedName.ql +++ /dev/null @@ -1,4 +0,0 @@ -import javascript - -from ExportSpecifier es -select es, es.getLocalName() diff --git a/javascript/ql/test/library-tests/Modules/getExportedName.qll b/javascript/ql/test/library-tests/Modules/getExportedName.qll new file mode 100644 index 000000000000..924296f7be11 --- /dev/null +++ b/javascript/ql/test/library-tests/Modules/getExportedName.qll @@ -0,0 +1,3 @@ +import javascript + +query predicate test_getExportedName(ExportSpecifier es, string res) { res = es.getLocalName() } diff --git a/javascript/ql/test/library-tests/Modules/getImportedName.expected b/javascript/ql/test/library-tests/Modules/getImportedName.expected deleted file mode 100644 index 4004cf2579c5..000000000000 --- a/javascript/ql/test/library-tests/Modules/getImportedName.expected +++ /dev/null @@ -1,8 +0,0 @@ -| b.js:1:8:1:8 | f | default | -| d.js:1:10:1:21 | default as g | default | -| d.js:1:24:1:29 | x as y | x | -| f.ts:1:8:1:8 | g | default | -| g.ts:1:9:1:11 | foo | foo | -| import-in-mjs.mjs:1:8:1:24 | exported_from_mjs | default | -| tst.html:5:10:5:10 | f | default | -| unresolved.js:1:8:1:8 | f | default | diff --git a/javascript/ql/test/library-tests/Modules/getImportedName.ql b/javascript/ql/test/library-tests/Modules/getImportedName.ql deleted file mode 100644 index ed0e5d55dc9f..000000000000 --- a/javascript/ql/test/library-tests/Modules/getImportedName.ql +++ /dev/null @@ -1,4 +0,0 @@ -import javascript - -from ImportSpecifier is -select is, is.getImportedName() diff --git a/javascript/ql/test/library-tests/Modules/getImportedName.qll b/javascript/ql/test/library-tests/Modules/getImportedName.qll new file mode 100644 index 000000000000..e05b2f422da2 --- /dev/null +++ b/javascript/ql/test/library-tests/Modules/getImportedName.qll @@ -0,0 +1,3 @@ +import javascript + +query predicate test_getImportedName(ImportSpecifier is, string res) { res = is.getImportedName() } diff --git a/javascript/ql/test/library-tests/Modules/getLocalName.expected b/javascript/ql/test/library-tests/Modules/getLocalName.expected deleted file mode 100644 index 63a5350caf3b..000000000000 --- a/javascript/ql/test/library-tests/Modules/getLocalName.expected +++ /dev/null @@ -1,6 +0,0 @@ -| b.js:5:10:5:15 | f as g | f | -| b.js:7:8:7:9 | f2 | default | -| e.js:2:10:2:10 | x | x | -| e.js:2:13:2:13 | y | y | -| e.js:3:10:3:21 | default as g | default | -| m/c.js:5:10:5:15 | g as h | g | diff --git a/javascript/ql/test/library-tests/Modules/getLocalName.ql b/javascript/ql/test/library-tests/Modules/getLocalName.ql deleted file mode 100644 index b2348c6e76fa..000000000000 --- a/javascript/ql/test/library-tests/Modules/getLocalName.ql +++ /dev/null @@ -1,4 +0,0 @@ -import javascript - -from ExportSpecifier es -select es, es.getLocalName() diff --git a/javascript/ql/test/library-tests/Modules/getLocalName.qll b/javascript/ql/test/library-tests/Modules/getLocalName.qll new file mode 100644 index 000000000000..5eab12c755e7 --- /dev/null +++ b/javascript/ql/test/library-tests/Modules/getLocalName.qll @@ -0,0 +1,3 @@ +import javascript + +query predicate test_getLocalName(ExportSpecifier es, string res) { res = es.getLocalName() } diff --git a/javascript/ql/test/library-tests/Modules/getSourceNode.expected b/javascript/ql/test/library-tests/Modules/getSourceNode.expected deleted file mode 100644 index c1a8cae1ccc4..000000000000 --- a/javascript/ql/test/library-tests/Modules/getSourceNode.expected +++ /dev/null @@ -1,12 +0,0 @@ -| a.js:1:1:3:1 | export ... n 23;\\n} | default | a.js:1:16:3:1 | functio ... n 23;\\n} | -| a.js:5:1:5:32 | export ... } = o; | x | a.js:5:18:5:20 | f() | -| b.js:5:1:5:18 | export { f as g }; | g | b.js:5:10:5:10 | f | -| b.js:7:1:7:21 | export ... './a'; | f2 | a.js:1:16:3:1 | functio ... n 23;\\n} | -| e.js:2:1:2:16 | export { x, y }; | x | e.js:2:10:2:10 | x | -| e.js:2:1:2:16 | export { x, y }; | y | e.js:2:13:2:13 | y | -| e.js:3:1:3:35 | export ... './a'; | g | a.js:1:16:3:1 | functio ... n 23;\\n} | -| es2015_require.js:3:1:3:25 | export ... ss C {} | default | es2015_require.js:3:16:3:25 | class C {} | -| export-in-mjs.mjs:1:1:1:34 | export ... s = 42; | exported_from_mjs | export-in-mjs.mjs:1:32:1:33 | 42 | -| f.ts:5:1:5:24 | export ... oo() {} | foo | f.ts:5:8:5:24 | function foo() {} | -| m/c.js:5:1:5:30 | export ... '../b'; | h | b.js:5:10:5:10 | f | -| tst.html:7:3:7:22 | export const y = 42; | y | tst.html:7:20:7:21 | 42 | diff --git a/javascript/ql/test/library-tests/Modules/getSourceNode.ql b/javascript/ql/test/library-tests/Modules/getSourceNode.ql deleted file mode 100644 index 65fb795b25f0..000000000000 --- a/javascript/ql/test/library-tests/Modules/getSourceNode.ql +++ /dev/null @@ -1,4 +0,0 @@ -import javascript - -from ExportDeclaration ed, string name -select ed, name, ed.getSourceNode(name) diff --git a/javascript/ql/test/library-tests/Modules/getSourceNode.qll b/javascript/ql/test/library-tests/Modules/getSourceNode.qll new file mode 100644 index 000000000000..f0d5eb1d6ebe --- /dev/null +++ b/javascript/ql/test/library-tests/Modules/getSourceNode.qll @@ -0,0 +1,5 @@ +import javascript + +query predicate test_getSourceNode(ExportDeclaration ed, string name, DataFlow::Node res) { + res = ed.getSourceNode(name) +} diff --git a/javascript/ql/test/library-tests/Modules/tests.expected b/javascript/ql/test/library-tests/Modules/tests.expected new file mode 100644 index 000000000000..8cdd45f90667 --- /dev/null +++ b/javascript/ql/test/library-tests/Modules/tests.expected @@ -0,0 +1,128 @@ +test_ImportSpecifiers +| b.js:1:8:1:8 | f | b.js:1:8:1:8 | f | +| d.js:1:10:1:21 | default as g | d.js:1:21:1:21 | g | +| d.js:1:24:1:29 | x as y | d.js:1:29:1:29 | y | +| exports.js:1:8:1:17 | * as dummy | exports.js:1:13:1:17 | dummy | +| f.ts:1:8:1:8 | g | f.ts:1:8:1:8 | g | +| g.ts:1:9:1:11 | foo | g.ts:1:9:1:11 | foo | +| import-in-mjs.mjs:1:8:1:24 | exported_from_mjs | import-in-mjs.mjs:1:8:1:24 | exported_from_mjs | +| m/c.js:1:8:1:13 | * as b | m/c.js:1:13:1:13 | b | +| tst.html:5:10:5:10 | f | tst.html:5:10:5:10 | f | +| unresolved.js:1:8:1:8 | f | unresolved.js:1:8:1:8 | f | +test_getLocalName +| b.js:5:10:5:15 | f as g | f | +| b.js:7:8:7:9 | f2 | default | +| e.js:2:10:2:10 | x | x | +| e.js:2:13:2:13 | y | y | +| e.js:3:10:3:21 | default as g | default | +| m/c.js:5:10:5:15 | g as h | g | +test_getExportedName +| b.js:5:10:5:15 | f as g | f | +| b.js:7:8:7:9 | f2 | default | +| e.js:2:10:2:10 | x | x | +| e.js:2:13:2:13 | y | y | +| e.js:3:10:3:21 | default as g | default | +| m/c.js:5:10:5:15 | g as h | g | +test_OtherImports +| es2015_require.js:1:11:1:24 | require('./d') | d.js:1:1:5:0 | | +test_ReExportDeclarations +| b.js:7:1:7:21 | export ... './a'; | b.js:7:16:7:20 | './a' | +| d.js:4:1:4:20 | export * from 'm/c'; | d.js:4:15:4:19 | 'm/c' | +| e.js:3:1:3:35 | export ... './a'; | e.js:3:30:3:34 | './a' | +| m/c.js:5:1:5:30 | export ... '../b'; | m/c.js:5:24:5:29 | '../b' | +test_ImportDefaultSpecifiers +| b.js:1:8:1:8 | f | +| f.ts:1:8:1:8 | g | +| import-in-mjs.mjs:1:8:1:24 | exported_from_mjs | +| tst.html:5:10:5:10 | f | +| unresolved.js:1:8:1:8 | f | +test_getImportedName +| b.js:1:8:1:8 | f | default | +| d.js:1:10:1:21 | default as g | default | +| d.js:1:24:1:29 | x as y | x | +| f.ts:1:8:1:8 | g | default | +| g.ts:1:9:1:11 | foo | foo | +| import-in-mjs.mjs:1:8:1:24 | exported_from_mjs | default | +| tst.html:5:10:5:10 | f | default | +| unresolved.js:1:8:1:8 | f | default | +test_ExportDeclarations +| a.js:1:1:3:1 | export ... n 23;\\n} | +| a.js:5:1:5:32 | export ... } = o; | +| b.js:5:1:5:18 | export { f as g }; | +| b.js:7:1:7:21 | export ... './a'; | +| d.js:4:1:4:20 | export * from 'm/c'; | +| e.js:2:1:2:16 | export { x, y }; | +| e.js:3:1:3:35 | export ... './a'; | +| es2015_require.js:3:1:3:25 | export ... ss C {} | +| export-in-mjs.mjs:1:1:1:34 | export ... s = 42; | +| f.ts:5:1:5:24 | export ... oo() {} | +| m/c.js:5:1:5:30 | export ... '../b'; | +| tst.html:7:3:7:22 | export const y = 42; | +test_getAnImportedModule +| b.js | a.js | +| d.js | a.js | +| d.js | b.js | +| es2015_require.js | d.js | +| f.ts | e.js | +| g.ts | f.ts | +| m/c.js | b.js | +test_getSourceNode +| a.js:1:1:3:1 | export ... n 23;\\n} | default | a.js:1:16:3:1 | functio ... n 23;\\n} | +| a.js:5:1:5:32 | export ... } = o; | x | a.js:5:18:5:20 | f() | +| b.js:5:1:5:18 | export { f as g }; | g | b.js:5:10:5:10 | f | +| b.js:7:1:7:21 | export ... './a'; | f2 | a.js:1:16:3:1 | functio ... n 23;\\n} | +| e.js:2:1:2:16 | export { x, y }; | x | e.js:2:10:2:10 | x | +| e.js:2:1:2:16 | export { x, y }; | y | e.js:2:13:2:13 | y | +| e.js:3:1:3:35 | export ... './a'; | g | a.js:1:16:3:1 | functio ... n 23;\\n} | +| es2015_require.js:3:1:3:25 | export ... ss C {} | default | es2015_require.js:3:16:3:25 | class C {} | +| export-in-mjs.mjs:1:1:1:34 | export ... s = 42; | exported_from_mjs | export-in-mjs.mjs:1:32:1:33 | 42 | +| f.ts:5:1:5:24 | export ... oo() {} | foo | f.ts:5:8:5:24 | function foo() {} | +| m/c.js:5:1:5:30 | export ... '../b'; | h | b.js:5:10:5:10 | f | +| tst.html:7:3:7:22 | export const y = 42; | y | tst.html:7:20:7:21 | 42 | +test_Imports +| b.js:1:1:1:20 | import f from './a'; | b.js:1:15:1:19 | './a' | 1 | +| d.js:1:1:1:43 | import ... './a'; | d.js:1:38:1:42 | './a' | 2 | +| d.js:2:1:2:13 | import './b'; | d.js:2:8:2:12 | './b' | 0 | +| exports.js:1:1:1:31 | import ... dummy'; | exports.js:1:24:1:30 | 'dummy' | 1 | +| f.ts:1:1:1:19 | import g from './e' | f.ts:1:15:1:19 | './e' | 1 | +| g.ts:1:1:1:23 | import ... m './f' | g.ts:1:19:1:23 | './f' | 1 | +| import-in-mjs.mjs:1:1:1:46 | import ... n-mjs'; | import-in-mjs.mjs:1:31:1:45 | 'export-in-mjs' | 1 | +| m/c.js:1:1:1:26 | import ... '../b'; | m/c.js:1:20:1:25 | '../b' | 1 | +| tst.html:5:3:5:20 | import f from 'a'; | tst.html:5:17:5:19 | 'a' | 1 | +| unresolved.js:1:1:1:18 | import f from 'a'; | unresolved.js:1:15:1:17 | 'a' | 1 | +test_NamedImportSpecifier +| d.js:1:10:1:21 | default as g | +| d.js:1:24:1:29 | x as y | +| g.ts:1:9:1:11 | foo | +test_GlobalVariableRef +| a.js:5:31:5:31 | o | +| exports.js:3:9:3:15 | exports | +| tst.html:6:3:6:7 | alert | +test_BulkReExportDeclarations +| d.js:4:1:4:20 | export * from 'm/c'; | +test_Module_exports +| a.js:1:1:5:32 | | default | a.js:1:1:3:1 | export ... n 23;\\n} | +| a.js:1:1:5:32 | | x | a.js:5:1:5:32 | export ... } = o; | +| a.js:1:1:5:32 | | y | a.js:5:1:5:32 | export ... } = o; | +| b.js:1:1:10:0 | | f2 | b.js:7:1:7:21 | export ... './a'; | +| b.js:1:1:10:0 | | g | b.js:5:1:5:18 | export { f as g }; | +| e.js:1:1:4:0 | | g | e.js:3:1:3:35 | export ... './a'; | +| e.js:1:1:4:0 | | x | e.js:2:1:2:16 | export { x, y }; | +| e.js:1:1:4:0 | | y | e.js:2:1:2:16 | export { x, y }; | +| es2015_require.js:1:1:3:25 | | default | es2015_require.js:3:1:3:25 | export ... ss C {} | +| export-in-mjs.mjs:1:1:1:34 | | exported_from_mjs | export-in-mjs.mjs:1:1:1:34 | export ... s = 42; | +| f.ts:1:1:6:0 | | foo | f.ts:5:1:5:24 | export ... oo() {} | +| m/c.js:1:1:8:0 | | h | m/c.js:5:1:5:30 | export ... '../b'; | +| tst.html:4:23:8:0 | | y | tst.html:7:3:7:22 | export const y = 42; | +test_ExportDefaultDeclarations +| a.js:1:1:3:1 | export ... n 23;\\n} | +| es2015_require.js:3:1:3:25 | export ... ss C {} | +test_ExportSpecifiers +| b.js:5:10:5:15 | f as g | b.js:5:10:5:10 | f | b.js:5:15:5:15 | g | +| e.js:2:10:2:10 | x | e.js:2:10:2:10 | x | e.js:2:10:2:10 | x | +| e.js:2:13:2:13 | y | e.js:2:13:2:13 | y | e.js:2:13:2:13 | y | +| e.js:3:10:3:21 | default as g | e.js:3:10:3:16 | default | e.js:3:21:3:21 | g | +| m/c.js:5:10:5:15 | g as h | m/c.js:5:10:5:10 | g | m/c.js:5:15:5:15 | h | +test_ImportNamespaceSpecifier +| exports.js:1:8:1:17 | * as dummy | +| m/c.js:1:8:1:13 | * as b | diff --git a/javascript/ql/test/library-tests/Modules/tests.ql b/javascript/ql/test/library-tests/Modules/tests.ql new file mode 100644 index 000000000000..7f1652f60ae0 --- /dev/null +++ b/javascript/ql/test/library-tests/Modules/tests.ql @@ -0,0 +1,18 @@ +import ImportSpecifiers +import getLocalName +import getExportedName +import OtherImports +import ReExportDeclarations +import ImportDefaultSpecifiers +import getImportedName +import ExportDeclarations +import getAnImportedModule +import getSourceNode +import Imports +import NamedImportSpecifier +import GlobalVariableRef +import BulkReExportDeclarations +import Module_exports +import ExportDefaultDeclarations +import ExportSpecifiers +import ImportNamespaceSpecifier diff --git a/javascript/ql/test/library-tests/Promises/PromiseDefinition.expected b/javascript/ql/test/library-tests/Promises/PromiseDefinition.expected deleted file mode 100644 index ead2e1306372..000000000000 --- a/javascript/ql/test/library-tests/Promises/PromiseDefinition.expected +++ /dev/null @@ -1,4 +0,0 @@ -| promises.js:3:17:5:4 | new Pro ... );\\n }) | -| promises.js:10:18:17:4 | new Pro ... );\\n }) | -| promises.js:33:19:35:6 | new Pro ... \\n }) | -| promises.js:43:19:45:6 | Q.Promi ... \\n }) | diff --git a/javascript/ql/test/library-tests/Promises/PromiseDefinition.ql b/javascript/ql/test/library-tests/Promises/PromiseDefinition.ql deleted file mode 100644 index 9f8300106134..000000000000 --- a/javascript/ql/test/library-tests/Promises/PromiseDefinition.ql +++ /dev/null @@ -1,3 +0,0 @@ -import javascript - -select any(PromiseDefinition pd) diff --git a/javascript/ql/test/library-tests/Promises/PromiseDefinition.qll b/javascript/ql/test/library-tests/Promises/PromiseDefinition.qll new file mode 100644 index 000000000000..f0f1d211b685 --- /dev/null +++ b/javascript/ql/test/library-tests/Promises/PromiseDefinition.qll @@ -0,0 +1,5 @@ +import javascript + +query predicate test_PromiseDefinition(PromiseDefinition res) { + res = any(PromiseDefinition pd | any() | pd) +} diff --git a/javascript/ql/test/library-tests/Promises/PromiseDefinition_getACatchHandler.expected b/javascript/ql/test/library-tests/Promises/PromiseDefinition_getACatchHandler.expected deleted file mode 100644 index 816b6b4fc83b..000000000000 --- a/javascript/ql/test/library-tests/Promises/PromiseDefinition_getACatchHandler.expected +++ /dev/null @@ -1 +0,0 @@ -| promises.js:10:18:17:4 | new Pro ... );\\n }) | promises.js:23:18:25:3 | (v) => ... v;\\n } | diff --git a/javascript/ql/test/library-tests/Promises/PromiseDefinition_getACatchHandler.ql b/javascript/ql/test/library-tests/Promises/PromiseDefinition_getACatchHandler.ql deleted file mode 100644 index 0172656291e1..000000000000 --- a/javascript/ql/test/library-tests/Promises/PromiseDefinition_getACatchHandler.ql +++ /dev/null @@ -1,4 +0,0 @@ -import javascript - -from PromiseDefinition pd -select pd, pd.getACatchHandler() diff --git a/javascript/ql/test/library-tests/Promises/PromiseDefinition_getACatchHandler.qll b/javascript/ql/test/library-tests/Promises/PromiseDefinition_getACatchHandler.qll new file mode 100644 index 000000000000..bc391f52ead9 --- /dev/null +++ b/javascript/ql/test/library-tests/Promises/PromiseDefinition_getACatchHandler.qll @@ -0,0 +1,7 @@ +import javascript + +query predicate test_PromiseDefinition_getACatchHandler( + PromiseDefinition pd, DataFlow::FunctionNode res +) { + res = pd.getACatchHandler() +} diff --git a/javascript/ql/test/library-tests/Promises/PromiseDefinition_getAFinallyHandler.expected b/javascript/ql/test/library-tests/Promises/PromiseDefinition_getAFinallyHandler.expected deleted file mode 100644 index ac764c1f41ff..000000000000 --- a/javascript/ql/test/library-tests/Promises/PromiseDefinition_getAFinallyHandler.expected +++ /dev/null @@ -1 +0,0 @@ -| promises.js:10:18:17:4 | new Pro ... );\\n }) | promises.js:26:20:28:3 | (v) => ... v;\\n } | diff --git a/javascript/ql/test/library-tests/Promises/PromiseDefinition_getAFinallyHandler.ql b/javascript/ql/test/library-tests/Promises/PromiseDefinition_getAFinallyHandler.ql deleted file mode 100644 index 00c28f546fe2..000000000000 --- a/javascript/ql/test/library-tests/Promises/PromiseDefinition_getAFinallyHandler.ql +++ /dev/null @@ -1,4 +0,0 @@ -import javascript - -from PromiseDefinition pd -select pd, pd.getAFinallyHandler() diff --git a/javascript/ql/test/library-tests/Promises/PromiseDefinition_getAFinallyHandler.qll b/javascript/ql/test/library-tests/Promises/PromiseDefinition_getAFinallyHandler.qll new file mode 100644 index 000000000000..ab7482738991 --- /dev/null +++ b/javascript/ql/test/library-tests/Promises/PromiseDefinition_getAFinallyHandler.qll @@ -0,0 +1,7 @@ +import javascript + +query predicate test_PromiseDefinition_getAFinallyHandler( + PromiseDefinition pd, DataFlow::FunctionNode res +) { + res = pd.getAFinallyHandler() +} diff --git a/javascript/ql/test/library-tests/Promises/PromiseDefinition_getARejectHandler.expected b/javascript/ql/test/library-tests/Promises/PromiseDefinition_getARejectHandler.expected deleted file mode 100644 index 3daa1172b180..000000000000 --- a/javascript/ql/test/library-tests/Promises/PromiseDefinition_getARejectHandler.expected +++ /dev/null @@ -1,3 +0,0 @@ -| promises.js:10:18:17:4 | new Pro ... );\\n }) | promises.js:20:6:22:3 | (v) => ... v;\\n } | -| promises.js:10:18:17:4 | new Pro ... );\\n }) | promises.js:23:18:25:3 | (v) => ... v;\\n } | -| promises.js:10:18:17:4 | new Pro ... );\\n }) | promises.js:26:20:28:3 | (v) => ... v;\\n } | diff --git a/javascript/ql/test/library-tests/Promises/PromiseDefinition_getARejectHandler.ql b/javascript/ql/test/library-tests/Promises/PromiseDefinition_getARejectHandler.ql deleted file mode 100644 index 427918c53303..000000000000 --- a/javascript/ql/test/library-tests/Promises/PromiseDefinition_getARejectHandler.ql +++ /dev/null @@ -1,4 +0,0 @@ -import javascript - -from PromiseDefinition pd -select pd, pd.getARejectHandler() diff --git a/javascript/ql/test/library-tests/Promises/PromiseDefinition_getARejectHandler.qll b/javascript/ql/test/library-tests/Promises/PromiseDefinition_getARejectHandler.qll new file mode 100644 index 000000000000..0fdc206a0b15 --- /dev/null +++ b/javascript/ql/test/library-tests/Promises/PromiseDefinition_getARejectHandler.qll @@ -0,0 +1,7 @@ +import javascript + +query predicate test_PromiseDefinition_getARejectHandler( + PromiseDefinition pd, DataFlow::FunctionNode res +) { + res = pd.getARejectHandler() +} diff --git a/javascript/ql/test/library-tests/Promises/PromiseDefinition_getAResolveHandler.expected b/javascript/ql/test/library-tests/Promises/PromiseDefinition_getAResolveHandler.expected deleted file mode 100644 index f220fce6a875..000000000000 --- a/javascript/ql/test/library-tests/Promises/PromiseDefinition_getAResolveHandler.expected +++ /dev/null @@ -1,5 +0,0 @@ -| promises.js:3:17:5:4 | new Pro ... );\\n }) | promises.js:6:16:8:3 | functio ... al;\\n } | -| promises.js:10:18:17:4 | new Pro ... );\\n }) | promises.js:18:17:20:3 | (v) => ... v;\\n } | -| promises.js:10:18:17:4 | new Pro ... );\\n }) | promises.js:26:20:28:3 | (v) => ... v;\\n } | -| promises.js:33:19:35:6 | new Pro ... \\n }) | promises.js:36:18:38:5 | functio ... ;\\n } | -| promises.js:43:19:45:6 | Q.Promi ... \\n }) | promises.js:46:18:48:5 | functio ... ;\\n } | diff --git a/javascript/ql/test/library-tests/Promises/PromiseDefinition_getAResolveHandler.ql b/javascript/ql/test/library-tests/Promises/PromiseDefinition_getAResolveHandler.ql deleted file mode 100644 index c3bebdff5459..000000000000 --- a/javascript/ql/test/library-tests/Promises/PromiseDefinition_getAResolveHandler.ql +++ /dev/null @@ -1,4 +0,0 @@ -import javascript - -from PromiseDefinition pd -select pd, pd.getAResolveHandler() diff --git a/javascript/ql/test/library-tests/Promises/PromiseDefinition_getAResolveHandler.qll b/javascript/ql/test/library-tests/Promises/PromiseDefinition_getAResolveHandler.qll new file mode 100644 index 000000000000..fa5edad22c72 --- /dev/null +++ b/javascript/ql/test/library-tests/Promises/PromiseDefinition_getAResolveHandler.qll @@ -0,0 +1,7 @@ +import javascript + +query predicate test_PromiseDefinition_getAResolveHandler( + PromiseDefinition pd, DataFlow::FunctionNode res +) { + res = pd.getAResolveHandler() +} diff --git a/javascript/ql/test/library-tests/Promises/PromiseDefinition_getExecutor.expected b/javascript/ql/test/library-tests/Promises/PromiseDefinition_getExecutor.expected deleted file mode 100644 index 264f542e9596..000000000000 --- a/javascript/ql/test/library-tests/Promises/PromiseDefinition_getExecutor.expected +++ /dev/null @@ -1,4 +0,0 @@ -| promises.js:3:17:5:4 | new Pro ... );\\n }) | promises.js:3:29:5:3 | functio ... e);\\n } | -| promises.js:10:18:17:4 | new Pro ... );\\n }) | promises.js:10:30:17:3 | (res, r ... e);\\n } | -| promises.js:33:19:35:6 | new Pro ... \\n }) | promises.js:33:31:35:5 | functio ... ;\\n } | -| promises.js:43:19:45:6 | Q.Promi ... \\n }) | promises.js:43:29:45:5 | functio ... ;\\n } | diff --git a/javascript/ql/test/library-tests/Promises/PromiseDefinition_getExecutor.ql b/javascript/ql/test/library-tests/Promises/PromiseDefinition_getExecutor.ql deleted file mode 100644 index fe91b42dae29..000000000000 --- a/javascript/ql/test/library-tests/Promises/PromiseDefinition_getExecutor.ql +++ /dev/null @@ -1,4 +0,0 @@ -import javascript - -from PromiseDefinition pd -select pd, pd.getExecutor() diff --git a/javascript/ql/test/library-tests/Promises/PromiseDefinition_getExecutor.qll b/javascript/ql/test/library-tests/Promises/PromiseDefinition_getExecutor.qll new file mode 100644 index 000000000000..1943c66c0fe0 --- /dev/null +++ b/javascript/ql/test/library-tests/Promises/PromiseDefinition_getExecutor.qll @@ -0,0 +1,5 @@ +import javascript + +query predicate test_PromiseDefinition_getExecutor(PromiseDefinition pd, DataFlow::FunctionNode res) { + res = pd.getExecutor() +} diff --git a/javascript/ql/test/library-tests/Promises/PromiseDefinition_getRejectParameter.expected b/javascript/ql/test/library-tests/Promises/PromiseDefinition_getRejectParameter.expected deleted file mode 100644 index b11440afb3cd..000000000000 --- a/javascript/ql/test/library-tests/Promises/PromiseDefinition_getRejectParameter.expected +++ /dev/null @@ -1,4 +0,0 @@ -| promises.js:3:17:5:4 | new Pro ... );\\n }) | promises.js:3:48:3:53 | reject | -| promises.js:10:18:17:4 | new Pro ... );\\n }) | promises.js:10:36:10:38 | rej | -| promises.js:33:19:35:6 | new Pro ... \\n }) | promises.js:33:50:33:55 | reject | -| promises.js:43:19:45:6 | Q.Promi ... \\n }) | promises.js:43:48:43:53 | reject | diff --git a/javascript/ql/test/library-tests/Promises/PromiseDefinition_getRejectParameter.ql b/javascript/ql/test/library-tests/Promises/PromiseDefinition_getRejectParameter.ql deleted file mode 100644 index 5bfcda2528ec..000000000000 --- a/javascript/ql/test/library-tests/Promises/PromiseDefinition_getRejectParameter.ql +++ /dev/null @@ -1,4 +0,0 @@ -import javascript - -from PromiseDefinition pd -select pd, pd.getRejectParameter() diff --git a/javascript/ql/test/library-tests/Promises/PromiseDefinition_getRejectParameter.qll b/javascript/ql/test/library-tests/Promises/PromiseDefinition_getRejectParameter.qll new file mode 100644 index 000000000000..2c378e5c5345 --- /dev/null +++ b/javascript/ql/test/library-tests/Promises/PromiseDefinition_getRejectParameter.qll @@ -0,0 +1,7 @@ +import javascript + +query predicate test_PromiseDefinition_getRejectParameter( + PromiseDefinition pd, DataFlow::ParameterNode res +) { + res = pd.getRejectParameter() +} diff --git a/javascript/ql/test/library-tests/Promises/PromiseDefinition_getResolveParameter.expected b/javascript/ql/test/library-tests/Promises/PromiseDefinition_getResolveParameter.expected deleted file mode 100644 index 4f3bf124f327..000000000000 --- a/javascript/ql/test/library-tests/Promises/PromiseDefinition_getResolveParameter.expected +++ /dev/null @@ -1,4 +0,0 @@ -| promises.js:3:17:5:4 | new Pro ... );\\n }) | promises.js:3:39:3:45 | resolve | -| promises.js:10:18:17:4 | new Pro ... );\\n }) | promises.js:10:31:10:33 | res | -| promises.js:33:19:35:6 | new Pro ... \\n }) | promises.js:33:41:33:47 | resolve | -| promises.js:43:19:45:6 | Q.Promi ... \\n }) | promises.js:43:39:43:45 | resolve | diff --git a/javascript/ql/test/library-tests/Promises/PromiseDefinition_getResolveParameter.ql b/javascript/ql/test/library-tests/Promises/PromiseDefinition_getResolveParameter.ql deleted file mode 100644 index 53c93390cbd5..000000000000 --- a/javascript/ql/test/library-tests/Promises/PromiseDefinition_getResolveParameter.ql +++ /dev/null @@ -1,4 +0,0 @@ -import javascript - -from PromiseDefinition pd -select pd, pd.getResolveParameter() diff --git a/javascript/ql/test/library-tests/Promises/PromiseDefinition_getResolveParameter.qll b/javascript/ql/test/library-tests/Promises/PromiseDefinition_getResolveParameter.qll new file mode 100644 index 000000000000..cbbd90a71b2d --- /dev/null +++ b/javascript/ql/test/library-tests/Promises/PromiseDefinition_getResolveParameter.qll @@ -0,0 +1,7 @@ +import javascript + +query predicate test_PromiseDefinition_getResolveParameter( + PromiseDefinition pd, DataFlow::ParameterNode res +) { + res = pd.getResolveParameter() +} diff --git a/javascript/ql/test/library-tests/Promises/ResolvedPromiseDefinition.expected b/javascript/ql/test/library-tests/Promises/ResolvedPromiseDefinition.expected deleted file mode 100644 index 955d64b6a237..000000000000 --- a/javascript/ql/test/library-tests/Promises/ResolvedPromiseDefinition.expected +++ /dev/null @@ -1,3 +0,0 @@ -| promises.js:53:19:53:41 | Promise ... source) | promises.js:53:35:53:40 | source | -| promises.js:62:19:62:41 | Promise ... source) | promises.js:62:35:62:40 | source | -| promises.js:71:5:71:27 | Promise ... source) | promises.js:71:21:71:26 | source | diff --git a/javascript/ql/test/library-tests/Promises/ResolvedPromiseDefinition.ql b/javascript/ql/test/library-tests/Promises/ResolvedPromiseDefinition.ql deleted file mode 100644 index 7f81bc7545fc..000000000000 --- a/javascript/ql/test/library-tests/Promises/ResolvedPromiseDefinition.ql +++ /dev/null @@ -1,4 +0,0 @@ -import javascript - -from ResolvedPromiseDefinition resolved -select resolved, resolved.getValue() diff --git a/javascript/ql/test/library-tests/Promises/ResolvedPromiseDefinition.qll b/javascript/ql/test/library-tests/Promises/ResolvedPromiseDefinition.qll new file mode 100644 index 000000000000..a7bade784120 --- /dev/null +++ b/javascript/ql/test/library-tests/Promises/ResolvedPromiseDefinition.qll @@ -0,0 +1,7 @@ +import javascript + +query predicate test_ResolvedPromiseDefinition( + ResolvedPromiseDefinition resolved, DataFlow::Node res +) { + res = resolved.getValue() +} diff --git a/javascript/ql/test/library-tests/Promises/tests.expected b/javascript/ql/test/library-tests/Promises/tests.expected new file mode 100644 index 000000000000..144b9e190361 --- /dev/null +++ b/javascript/ql/test/library-tests/Promises/tests.expected @@ -0,0 +1,38 @@ +test_ResolvedPromiseDefinition +| promises.js:53:19:53:41 | Promise ... source) | promises.js:53:35:53:40 | source | +| promises.js:62:19:62:41 | Promise ... source) | promises.js:62:35:62:40 | source | +| promises.js:71:5:71:27 | Promise ... source) | promises.js:71:21:71:26 | source | +test_PromiseDefinition_getARejectHandler +| promises.js:10:18:17:4 | new Pro ... );\\n }) | promises.js:20:6:22:3 | (v) => ... v;\\n } | +| promises.js:10:18:17:4 | new Pro ... );\\n }) | promises.js:23:18:25:3 | (v) => ... v;\\n } | +| promises.js:10:18:17:4 | new Pro ... );\\n }) | promises.js:26:20:28:3 | (v) => ... v;\\n } | +test_PromiseDefinition_getExecutor +| promises.js:3:17:5:4 | new Pro ... );\\n }) | promises.js:3:29:5:3 | functio ... e);\\n } | +| promises.js:10:18:17:4 | new Pro ... );\\n }) | promises.js:10:30:17:3 | (res, r ... e);\\n } | +| promises.js:33:19:35:6 | new Pro ... \\n }) | promises.js:33:31:35:5 | functio ... ;\\n } | +| promises.js:43:19:45:6 | Q.Promi ... \\n }) | promises.js:43:29:45:5 | functio ... ;\\n } | +test_PromiseDefinition_getAFinallyHandler +| promises.js:10:18:17:4 | new Pro ... );\\n }) | promises.js:26:20:28:3 | (v) => ... v;\\n } | +test_PromiseDefinition +| promises.js:3:17:5:4 | new Pro ... );\\n }) | +| promises.js:10:18:17:4 | new Pro ... );\\n }) | +| promises.js:33:19:35:6 | new Pro ... \\n }) | +| promises.js:43:19:45:6 | Q.Promi ... \\n }) | +test_PromiseDefinition_getAResolveHandler +| promises.js:3:17:5:4 | new Pro ... );\\n }) | promises.js:6:16:8:3 | functio ... al;\\n } | +| promises.js:10:18:17:4 | new Pro ... );\\n }) | promises.js:18:17:20:3 | (v) => ... v;\\n } | +| promises.js:10:18:17:4 | new Pro ... );\\n }) | promises.js:26:20:28:3 | (v) => ... v;\\n } | +| promises.js:33:19:35:6 | new Pro ... \\n }) | promises.js:36:18:38:5 | functio ... ;\\n } | +| promises.js:43:19:45:6 | Q.Promi ... \\n }) | promises.js:46:18:48:5 | functio ... ;\\n } | +test_PromiseDefinition_getRejectParameter +| promises.js:3:17:5:4 | new Pro ... );\\n }) | promises.js:3:48:3:53 | reject | +| promises.js:10:18:17:4 | new Pro ... );\\n }) | promises.js:10:36:10:38 | rej | +| promises.js:33:19:35:6 | new Pro ... \\n }) | promises.js:33:50:33:55 | reject | +| promises.js:43:19:45:6 | Q.Promi ... \\n }) | promises.js:43:48:43:53 | reject | +test_PromiseDefinition_getResolveParameter +| promises.js:3:17:5:4 | new Pro ... );\\n }) | promises.js:3:39:3:45 | resolve | +| promises.js:10:18:17:4 | new Pro ... );\\n }) | promises.js:10:31:10:33 | res | +| promises.js:33:19:35:6 | new Pro ... \\n }) | promises.js:33:41:33:47 | resolve | +| promises.js:43:19:45:6 | Q.Promi ... \\n }) | promises.js:43:39:43:45 | resolve | +test_PromiseDefinition_getACatchHandler +| promises.js:10:18:17:4 | new Pro ... );\\n }) | promises.js:23:18:25:3 | (v) => ... v;\\n } | diff --git a/javascript/ql/test/library-tests/Promises/tests.ql b/javascript/ql/test/library-tests/Promises/tests.ql new file mode 100644 index 000000000000..6b29dc01fa3d --- /dev/null +++ b/javascript/ql/test/library-tests/Promises/tests.ql @@ -0,0 +1,9 @@ +import ResolvedPromiseDefinition +import PromiseDefinition_getARejectHandler +import PromiseDefinition_getExecutor +import PromiseDefinition_getAFinallyHandler +import PromiseDefinition +import PromiseDefinition_getAResolveHandler +import PromiseDefinition_getRejectParameter +import PromiseDefinition_getResolveParameter +import PromiseDefinition_getACatchHandler diff --git a/javascript/ql/test/library-tests/PropWrite/PropWrite.expected b/javascript/ql/test/library-tests/PropWrite/PropWrite.expected deleted file mode 100644 index fe5fd6f52968..000000000000 --- a/javascript/ql/test/library-tests/PropWrite/PropWrite.expected +++ /dev/null @@ -1,34 +0,0 @@ -| classes.ts:3:21:3:20 | constructor() {} | -| classes.ts:4:3:4:24 | instanc ... foo(); | -| classes.ts:8:3:8:39 | constru ... eld) {} | -| classes.ts:8:15:8:35 | public ... erField | -| classes.ts:12:5:12:68 | constru ... + 42; } | -| classes.ts:12:17:12:37 | public ... erField | -| classes.ts:16:5:16:46 | constru ... {}) {} | -| classes.ts:16:17:16:37 | public ... erField | -| tst.js:3:5:3:8 | x: 4 | -| tst.js:4:5:6:5 | func: f ... ;\\n } | -| tst.js:7:5:9:5 | f() {\\n ... ;\\n } | -| tst.js:12:9:12:8 | constructor() {} | -| tst.js:13:3:15:3 | static ... x);\\n } | -| tst.js:16:3:18:3 | f(x) {\\n ... x);\\n } | -| tst.js:21:1:21:6 | C.prop | -| tst.js:24:13:24:27 | onClick={click} | -| tst.js:27:3:27:26 | get x() ... null; } | -| tst.js:28:3:28:13 | set y(v) {} | -| tst.js:32:5:32:8 | n: 1 | -| tst.js:33:5:33:10 | [v]: 2 | -| tst.js:34:5:34:14 | [vv.pp]: 3 | -| tst.js:35:5:35:20 | [vvv.ppp.qqq]: 4 | -| tst.js:38:13:38:15 | "a" | -| tst.js:38:18:38:20 | "b" | -| tst.js:38:23:38:25 | "c" | -| tst.js:39:13:39:15 | "a" | -| tst.js:39:20:39:22 | "c" | -| tst.js:40:15:40:17 | "b" | -| tst.js:40:20:40:22 | "c" | -| tst.js:41:13:41:15 | "a" | -| tst.js:41:18:41:20 | "b" | -| tst.js:42:13:42:15 | "a" | -| tst.js:42:18:42:24 | ...arr3 | -| tst.js:42:27:42:29 | "d" | diff --git a/javascript/ql/test/library-tests/PropWrite/PropWrite.ql b/javascript/ql/test/library-tests/PropWrite/PropWrite.ql deleted file mode 100644 index 80fc4327e7f3..000000000000 --- a/javascript/ql/test/library-tests/PropWrite/PropWrite.ql +++ /dev/null @@ -1,4 +0,0 @@ -import javascript - -from DataFlow::PropWrite p -select p diff --git a/javascript/ql/test/library-tests/PropWrite/PropWrite.qll b/javascript/ql/test/library-tests/PropWrite/PropWrite.qll new file mode 100644 index 000000000000..05716e8e26af --- /dev/null +++ b/javascript/ql/test/library-tests/PropWrite/PropWrite.qll @@ -0,0 +1,3 @@ +import javascript + +query predicate test_PropWrite(DataFlow::PropWrite p) { any() } diff --git a/javascript/ql/test/library-tests/PropWrite/PropWriteBase.expected b/javascript/ql/test/library-tests/PropWrite/PropWriteBase.expected deleted file mode 100644 index 1d8e78556df6..000000000000 --- a/javascript/ql/test/library-tests/PropWrite/PropWriteBase.expected +++ /dev/null @@ -1,28 +0,0 @@ -| classes.ts:4:3:4:24 | instanc ... foo(); | classes.ts:3:21:3:20 | this | -| classes.ts:8:15:8:35 | public ... erField | classes.ts:8:3:8:2 | this | -| classes.ts:12:17:12:37 | public ... erField | classes.ts:12:5:12:4 | this | -| classes.ts:16:17:16:37 | public ... erField | classes.ts:16:5:16:4 | this | -| tst.js:3:5:3:8 | x: 4 | tst.js:2:11:10:1 | {\\n x ... }\\n} | -| tst.js:4:5:6:5 | func: f ... ;\\n } | tst.js:2:11:10:1 | {\\n x ... }\\n} | -| tst.js:7:5:9:5 | f() {\\n ... ;\\n } | tst.js:2:11:10:1 | {\\n x ... }\\n} | -| tst.js:13:3:15:3 | static ... x);\\n } | tst.js:12:1:19:1 | class C ... ;\\n }\\n} | -| tst.js:21:1:21:6 | C.prop | tst.js:21:1:21:1 | C | -| tst.js:24:13:24:27 | onClick={click} | tst.js:24:8:24:57 |
| -| tst.js:27:3:27:26 | get x() ... null; } | tst.js:26:2:29:1 | {\\n get ... v) {}\\n} | -| tst.js:28:3:28:13 | set y(v) {} | tst.js:26:2:29:1 | {\\n get ... v) {}\\n} | -| tst.js:32:5:32:8 | n: 1 | tst.js:31:2:36:1 | {\\n n ... q]: 4\\n} | -| tst.js:33:5:33:10 | [v]: 2 | tst.js:31:2:36:1 | {\\n n ... q]: 4\\n} | -| tst.js:34:5:34:14 | [vv.pp]: 3 | tst.js:31:2:36:1 | {\\n n ... q]: 4\\n} | -| tst.js:35:5:35:20 | [vvv.ppp.qqq]: 4 | tst.js:31:2:36:1 | {\\n n ... q]: 4\\n} | -| tst.js:38:13:38:15 | "a" | tst.js:38:12:38:26 | ["a", "b", "c"] | -| tst.js:38:18:38:20 | "b" | tst.js:38:12:38:26 | ["a", "b", "c"] | -| tst.js:38:23:38:25 | "c" | tst.js:38:12:38:26 | ["a", "b", "c"] | -| tst.js:39:13:39:15 | "a" | tst.js:39:12:39:23 | ["a", , "c"] | -| tst.js:39:20:39:22 | "c" | tst.js:39:12:39:23 | ["a", , "c"] | -| tst.js:40:15:40:17 | "b" | tst.js:40:12:40:23 | [, "b", "c"] | -| tst.js:40:20:40:22 | "c" | tst.js:40:12:40:23 | [, "b", "c"] | -| tst.js:41:13:41:15 | "a" | tst.js:41:12:41:22 | ["a", "b",] | -| tst.js:41:18:41:20 | "b" | tst.js:41:12:41:22 | ["a", "b",] | -| tst.js:42:13:42:15 | "a" | tst.js:42:12:42:30 | ["a", ...arr3, "d"] | -| tst.js:42:18:42:24 | ...arr3 | tst.js:42:12:42:30 | ["a", ...arr3, "d"] | -| tst.js:42:27:42:29 | "d" | tst.js:42:12:42:30 | ["a", ...arr3, "d"] | diff --git a/javascript/ql/test/library-tests/PropWrite/PropWriteBase.ql b/javascript/ql/test/library-tests/PropWrite/PropWriteBase.ql deleted file mode 100644 index 927645507735..000000000000 --- a/javascript/ql/test/library-tests/PropWrite/PropWriteBase.ql +++ /dev/null @@ -1,4 +0,0 @@ -import javascript - -from DataFlow::PropWrite p -select p, p.getBase() diff --git a/javascript/ql/test/library-tests/PropWrite/PropWriteBase.qll b/javascript/ql/test/library-tests/PropWrite/PropWriteBase.qll new file mode 100644 index 000000000000..e00104454499 --- /dev/null +++ b/javascript/ql/test/library-tests/PropWrite/PropWriteBase.qll @@ -0,0 +1,3 @@ +import javascript + +query predicate test_PropWriteBase(DataFlow::PropWrite p, DataFlow::Node res) { res = p.getBase() } diff --git a/javascript/ql/test/library-tests/PropWrite/PropWritePropName.expected b/javascript/ql/test/library-tests/PropWrite/PropWritePropName.expected deleted file mode 100644 index f00531e92e6d..000000000000 --- a/javascript/ql/test/library-tests/PropWrite/PropWritePropName.expected +++ /dev/null @@ -1,19 +0,0 @@ -| classes.ts:3:21:3:20 | constructor() {} | constructor | -| classes.ts:4:3:4:24 | instanc ... foo(); | instanceField | -| classes.ts:8:3:8:39 | constru ... eld) {} | constructor | -| classes.ts:8:15:8:35 | public ... erField | parameterField | -| classes.ts:12:5:12:68 | constru ... + 42; } | constructor | -| classes.ts:12:17:12:37 | public ... erField | parameterField | -| classes.ts:16:5:16:46 | constru ... {}) {} | constructor | -| classes.ts:16:17:16:37 | public ... erField | parameterField | -| tst.js:3:5:3:8 | x: 4 | x | -| tst.js:4:5:6:5 | func: f ... ;\\n } | func | -| tst.js:7:5:9:5 | f() {\\n ... ;\\n } | f | -| tst.js:12:9:12:8 | constructor() {} | constructor | -| tst.js:13:3:15:3 | static ... x);\\n } | func | -| tst.js:16:3:18:3 | f(x) {\\n ... x);\\n } | f | -| tst.js:21:1:21:6 | C.prop | prop | -| tst.js:24:13:24:27 | onClick={click} | onClick | -| tst.js:27:3:27:26 | get x() ... null; } | x | -| tst.js:28:3:28:13 | set y(v) {} | y | -| tst.js:32:5:32:8 | n: 1 | n | diff --git a/javascript/ql/test/library-tests/PropWrite/PropWritePropName.ql b/javascript/ql/test/library-tests/PropWrite/PropWritePropName.ql deleted file mode 100644 index 3d5337b86221..000000000000 --- a/javascript/ql/test/library-tests/PropWrite/PropWritePropName.ql +++ /dev/null @@ -1,4 +0,0 @@ -import javascript - -from DataFlow::PropWrite p -select p, p.getPropertyName() diff --git a/javascript/ql/test/library-tests/PropWrite/PropWritePropName.qll b/javascript/ql/test/library-tests/PropWrite/PropWritePropName.qll new file mode 100644 index 000000000000..76687ace1c29 --- /dev/null +++ b/javascript/ql/test/library-tests/PropWrite/PropWritePropName.qll @@ -0,0 +1,5 @@ +import javascript + +query predicate test_PropWritePropName(DataFlow::PropWrite p, string res) { + res = p.getPropertyName() +} diff --git a/javascript/ql/test/library-tests/PropWrite/PropWriteRhs.expected b/javascript/ql/test/library-tests/PropWrite/PropWriteRhs.expected deleted file mode 100644 index 42087edc9c1e..000000000000 --- a/javascript/ql/test/library-tests/PropWrite/PropWriteRhs.expected +++ /dev/null @@ -1,33 +0,0 @@ -| classes.ts:3:21:3:20 | constructor() {} | classes.ts:3:21:3:20 | () {} | -| classes.ts:4:3:4:24 | instanc ... foo(); | classes.ts:4:19:4:23 | foo() | -| classes.ts:8:3:8:39 | constru ... eld) {} | classes.ts:8:3:8:39 | constru ... eld) {} | -| classes.ts:8:15:8:35 | public ... erField | classes.ts:8:22:8:35 | parameterField | -| classes.ts:12:5:12:68 | constru ... + 42; } | classes.ts:12:5:12:68 | constru ... + 42; } | -| classes.ts:12:17:12:37 | public ... erField | classes.ts:12:24:12:37 | parameterField | -| classes.ts:16:5:16:46 | constru ... {}) {} | classes.ts:16:5:16:46 | constru ... {}) {} | -| classes.ts:16:17:16:37 | public ... erField | classes.ts:16:24:16:37 | parameterField | -| classes.ts:16:17:16:37 | public ... erField | classes.ts:16:41:16:42 | {} | -| tst.js:3:5:3:8 | x: 4 | tst.js:3:8:3:8 | 4 | -| tst.js:4:5:6:5 | func: f ... ;\\n } | tst.js:4:11:6:5 | functio ... ;\\n } | -| tst.js:7:5:9:5 | f() {\\n ... ;\\n } | tst.js:7:6:9:5 | () {\\n ... ;\\n } | -| tst.js:12:9:12:8 | constructor() {} | tst.js:12:9:12:8 | () {} | -| tst.js:13:3:15:3 | static ... x);\\n } | tst.js:13:14:15:3 | (x) {\\n ... x);\\n } | -| tst.js:16:3:18:3 | f(x) {\\n ... x);\\n } | tst.js:16:4:18:3 | (x) {\\n ... x);\\n } | -| tst.js:21:1:21:6 | C.prop | tst.js:21:10:21:11 | 56 | -| tst.js:24:13:24:27 | onClick={click} | tst.js:24:22:24:26 | click | -| tst.js:32:5:32:8 | n: 1 | tst.js:32:8:32:8 | 1 | -| tst.js:33:5:33:10 | [v]: 2 | tst.js:33:10:33:10 | 2 | -| tst.js:34:5:34:14 | [vv.pp]: 3 | tst.js:34:14:34:14 | 3 | -| tst.js:35:5:35:20 | [vvv.ppp.qqq]: 4 | tst.js:35:20:35:20 | 4 | -| tst.js:38:13:38:15 | "a" | tst.js:38:13:38:15 | "a" | -| tst.js:38:18:38:20 | "b" | tst.js:38:18:38:20 | "b" | -| tst.js:38:23:38:25 | "c" | tst.js:38:23:38:25 | "c" | -| tst.js:39:13:39:15 | "a" | tst.js:39:13:39:15 | "a" | -| tst.js:39:20:39:22 | "c" | tst.js:39:20:39:22 | "c" | -| tst.js:40:15:40:17 | "b" | tst.js:40:15:40:17 | "b" | -| tst.js:40:20:40:22 | "c" | tst.js:40:20:40:22 | "c" | -| tst.js:41:13:41:15 | "a" | tst.js:41:13:41:15 | "a" | -| tst.js:41:18:41:20 | "b" | tst.js:41:18:41:20 | "b" | -| tst.js:42:13:42:15 | "a" | tst.js:42:13:42:15 | "a" | -| tst.js:42:18:42:24 | ...arr3 | tst.js:42:18:42:24 | ...arr3 | -| tst.js:42:27:42:29 | "d" | tst.js:42:27:42:29 | "d" | diff --git a/javascript/ql/test/library-tests/PropWrite/PropWriteRhs.ql b/javascript/ql/test/library-tests/PropWrite/PropWriteRhs.ql deleted file mode 100644 index 7499c147c146..000000000000 --- a/javascript/ql/test/library-tests/PropWrite/PropWriteRhs.ql +++ /dev/null @@ -1,4 +0,0 @@ -import javascript - -from DataFlow::PropWrite p -select p, p.getRhs() diff --git a/javascript/ql/test/library-tests/PropWrite/PropWriteRhs.qll b/javascript/ql/test/library-tests/PropWrite/PropWriteRhs.qll new file mode 100644 index 000000000000..1b57e1f2876e --- /dev/null +++ b/javascript/ql/test/library-tests/PropWrite/PropWriteRhs.qll @@ -0,0 +1,3 @@ +import javascript + +query predicate test_PropWriteRhs(DataFlow::PropWrite p, DataFlow::Node res) { res = p.getRhs() } diff --git a/javascript/ql/test/library-tests/PropWrite/getAPropertyRead.expected b/javascript/ql/test/library-tests/PropWrite/getAPropertyRead.expected deleted file mode 100644 index bfce597c0475..000000000000 --- a/javascript/ql/test/library-tests/PropWrite/getAPropertyRead.expected +++ /dev/null @@ -1,11 +0,0 @@ -| tst.js:1:1:1:0 | this | tst.js:23:15:23:29 | this.someMethod | -| tst.js:1:1:1:0 | this | tst.js:24:36:24:45 | this.state | -| tst.js:14:5:14:11 | console | tst.js:14:5:14:15 | console.log | -| tst.js:17:5:17:11 | console | tst.js:17:5:17:15 | console.log | -| tst.js:23:15:23:29 | this.someMethod | tst.js:23:15:23:34 | this.someMethod.bind | -| tst.js:24:36:24:45 | this.state | tst.js:24:36:24:50 | this.state.name | -| tst.js:34:6:34:7 | vv | tst.js:34:6:34:10 | vv.pp | -| tst.js:35:6:35:8 | vvv | tst.js:35:6:35:12 | vvv.ppp | -| tst.js:35:6:35:12 | vvv.ppp | tst.js:35:6:35:16 | vvv.ppp.qqq | -| tst.js:45:3:45:9 | console | tst.js:45:3:45:13 | console.log | -| tst.js:45:15:45:17 | obj | tst.js:45:15:45:20 | obj[p] | diff --git a/javascript/ql/test/library-tests/PropWrite/getAPropertyRead.ql b/javascript/ql/test/library-tests/PropWrite/getAPropertyRead.ql deleted file mode 100644 index e92e78861e12..000000000000 --- a/javascript/ql/test/library-tests/PropWrite/getAPropertyRead.ql +++ /dev/null @@ -1,4 +0,0 @@ -import javascript - -from DataFlow::SourceNode nd -select nd, nd.getAPropertyRead() diff --git a/javascript/ql/test/library-tests/PropWrite/getAPropertyRead.qll b/javascript/ql/test/library-tests/PropWrite/getAPropertyRead.qll new file mode 100644 index 000000000000..cf0abe755ecc --- /dev/null +++ b/javascript/ql/test/library-tests/PropWrite/getAPropertyRead.qll @@ -0,0 +1,5 @@ +import javascript + +query predicate test_getAPropertyRead(DataFlow::SourceNode nd, DataFlow::PropRead res) { + res = nd.getAPropertyRead() +} diff --git a/javascript/ql/test/library-tests/PropWrite/getAPropertyRead2.expected b/javascript/ql/test/library-tests/PropWrite/getAPropertyRead2.expected deleted file mode 100644 index 854d59318494..000000000000 --- a/javascript/ql/test/library-tests/PropWrite/getAPropertyRead2.expected +++ /dev/null @@ -1,10 +0,0 @@ -| tst.js:1:1:1:0 | this | someMethod | tst.js:23:15:23:29 | this.someMethod | -| tst.js:1:1:1:0 | this | state | tst.js:24:36:24:45 | this.state | -| tst.js:14:5:14:11 | console | log | tst.js:14:5:14:15 | console.log | -| tst.js:17:5:17:11 | console | log | tst.js:17:5:17:15 | console.log | -| tst.js:23:15:23:29 | this.someMethod | bind | tst.js:23:15:23:34 | this.someMethod.bind | -| tst.js:24:36:24:45 | this.state | name | tst.js:24:36:24:50 | this.state.name | -| tst.js:34:6:34:7 | vv | pp | tst.js:34:6:34:10 | vv.pp | -| tst.js:35:6:35:8 | vvv | ppp | tst.js:35:6:35:12 | vvv.ppp | -| tst.js:35:6:35:12 | vvv.ppp | qqq | tst.js:35:6:35:16 | vvv.ppp.qqq | -| tst.js:45:3:45:9 | console | log | tst.js:45:3:45:13 | console.log | diff --git a/javascript/ql/test/library-tests/PropWrite/getAPropertyRead2.ql b/javascript/ql/test/library-tests/PropWrite/getAPropertyRead2.ql deleted file mode 100644 index 2476d9906275..000000000000 --- a/javascript/ql/test/library-tests/PropWrite/getAPropertyRead2.ql +++ /dev/null @@ -1,4 +0,0 @@ -import javascript - -from DataFlow::SourceNode nd, string prop -select nd, prop, nd.getAPropertyRead(prop) diff --git a/javascript/ql/test/library-tests/PropWrite/getAPropertyRead2.qll b/javascript/ql/test/library-tests/PropWrite/getAPropertyRead2.qll new file mode 100644 index 000000000000..3b853e75f52c --- /dev/null +++ b/javascript/ql/test/library-tests/PropWrite/getAPropertyRead2.qll @@ -0,0 +1,5 @@ +import javascript + +query predicate test_getAPropertyRead2(DataFlow::SourceNode nd, string prop, DataFlow::PropRead res) { + res = nd.getAPropertyRead(prop) +} diff --git a/javascript/ql/test/library-tests/PropWrite/getAPropertyReference.expected b/javascript/ql/test/library-tests/PropWrite/getAPropertyReference.expected deleted file mode 100644 index a6692956438c..000000000000 --- a/javascript/ql/test/library-tests/PropWrite/getAPropertyReference.expected +++ /dev/null @@ -1,39 +0,0 @@ -| classes.ts:3:21:3:20 | this | classes.ts:4:3:4:24 | instanc ... foo(); | -| classes.ts:8:3:8:2 | this | classes.ts:8:15:8:35 | public ... erField | -| classes.ts:12:5:12:4 | this | classes.ts:12:17:12:37 | public ... erField | -| classes.ts:16:5:16:4 | this | classes.ts:16:17:16:37 | public ... erField | -| tst.js:1:1:1:0 | this | tst.js:23:15:23:29 | this.someMethod | -| tst.js:1:1:1:0 | this | tst.js:24:36:24:45 | this.state | -| tst.js:2:11:10:1 | {\\n x ... }\\n} | tst.js:3:5:3:8 | x: 4 | -| tst.js:2:11:10:1 | {\\n x ... }\\n} | tst.js:4:5:6:5 | func: f ... ;\\n } | -| tst.js:2:11:10:1 | {\\n x ... }\\n} | tst.js:7:5:9:5 | f() {\\n ... ;\\n } | -| tst.js:12:1:19:1 | class C ... ;\\n }\\n} | tst.js:13:3:15:3 | static ... x);\\n } | -| tst.js:14:5:14:11 | console | tst.js:14:5:14:15 | console.log | -| tst.js:17:5:17:11 | console | tst.js:17:5:17:15 | console.log | -| tst.js:21:1:21:1 | C | tst.js:21:1:21:6 | C.prop | -| tst.js:23:15:23:29 | this.someMethod | tst.js:23:15:23:34 | this.someMethod.bind | -| tst.js:24:8:24:57 |
| tst.js:24:13:24:27 | onClick={click} | -| tst.js:24:36:24:45 | this.state | tst.js:24:36:24:50 | this.state.name | -| tst.js:26:2:29:1 | {\\n get ... v) {}\\n} | tst.js:27:3:27:26 | get x() ... null; } | -| tst.js:26:2:29:1 | {\\n get ... v) {}\\n} | tst.js:28:3:28:13 | set y(v) {} | -| tst.js:31:2:36:1 | {\\n n ... q]: 4\\n} | tst.js:32:5:32:8 | n: 1 | -| tst.js:31:2:36:1 | {\\n n ... q]: 4\\n} | tst.js:33:5:33:10 | [v]: 2 | -| tst.js:31:2:36:1 | {\\n n ... q]: 4\\n} | tst.js:34:5:34:14 | [vv.pp]: 3 | -| tst.js:31:2:36:1 | {\\n n ... q]: 4\\n} | tst.js:35:5:35:20 | [vvv.ppp.qqq]: 4 | -| tst.js:34:6:34:7 | vv | tst.js:34:6:34:10 | vv.pp | -| tst.js:35:6:35:8 | vvv | tst.js:35:6:35:12 | vvv.ppp | -| tst.js:35:6:35:12 | vvv.ppp | tst.js:35:6:35:16 | vvv.ppp.qqq | -| tst.js:38:12:38:26 | ["a", "b", "c"] | tst.js:38:13:38:15 | "a" | -| tst.js:38:12:38:26 | ["a", "b", "c"] | tst.js:38:18:38:20 | "b" | -| tst.js:38:12:38:26 | ["a", "b", "c"] | tst.js:38:23:38:25 | "c" | -| tst.js:39:12:39:23 | ["a", , "c"] | tst.js:39:13:39:15 | "a" | -| tst.js:39:12:39:23 | ["a", , "c"] | tst.js:39:20:39:22 | "c" | -| tst.js:40:12:40:23 | [, "b", "c"] | tst.js:40:15:40:17 | "b" | -| tst.js:40:12:40:23 | [, "b", "c"] | tst.js:40:20:40:22 | "c" | -| tst.js:41:12:41:22 | ["a", "b",] | tst.js:41:13:41:15 | "a" | -| tst.js:41:12:41:22 | ["a", "b",] | tst.js:41:18:41:20 | "b" | -| tst.js:42:12:42:30 | ["a", ...arr3, "d"] | tst.js:42:13:42:15 | "a" | -| tst.js:42:12:42:30 | ["a", ...arr3, "d"] | tst.js:42:18:42:24 | ...arr3 | -| tst.js:42:12:42:30 | ["a", ...arr3, "d"] | tst.js:42:27:42:29 | "d" | -| tst.js:45:3:45:9 | console | tst.js:45:3:45:13 | console.log | -| tst.js:45:15:45:17 | obj | tst.js:45:15:45:20 | obj[p] | diff --git a/javascript/ql/test/library-tests/PropWrite/getAPropertyReference.ql b/javascript/ql/test/library-tests/PropWrite/getAPropertyReference.ql deleted file mode 100644 index fc053e5ac81f..000000000000 --- a/javascript/ql/test/library-tests/PropWrite/getAPropertyReference.ql +++ /dev/null @@ -1,4 +0,0 @@ -import javascript - -from DataFlow::SourceNode nd -select nd, nd.getAPropertyReference() diff --git a/javascript/ql/test/library-tests/PropWrite/getAPropertyReference.qll b/javascript/ql/test/library-tests/PropWrite/getAPropertyReference.qll new file mode 100644 index 000000000000..0b4ccabf84bd --- /dev/null +++ b/javascript/ql/test/library-tests/PropWrite/getAPropertyReference.qll @@ -0,0 +1,5 @@ +import javascript + +query predicate test_getAPropertyReference(DataFlow::SourceNode nd, DataFlow::PropRef res) { + res = nd.getAPropertyReference() +} diff --git a/javascript/ql/test/library-tests/PropWrite/getAPropertyReference2.expected b/javascript/ql/test/library-tests/PropWrite/getAPropertyReference2.expected deleted file mode 100644 index 8bf36ce9ae77..000000000000 --- a/javascript/ql/test/library-tests/PropWrite/getAPropertyReference2.expected +++ /dev/null @@ -1,23 +0,0 @@ -| classes.ts:3:21:3:20 | this | instanceField | classes.ts:4:3:4:24 | instanc ... foo(); | -| classes.ts:8:3:8:2 | this | parameterField | classes.ts:8:15:8:35 | public ... erField | -| classes.ts:12:5:12:4 | this | parameterField | classes.ts:12:17:12:37 | public ... erField | -| classes.ts:16:5:16:4 | this | parameterField | classes.ts:16:17:16:37 | public ... erField | -| tst.js:1:1:1:0 | this | someMethod | tst.js:23:15:23:29 | this.someMethod | -| tst.js:1:1:1:0 | this | state | tst.js:24:36:24:45 | this.state | -| tst.js:2:11:10:1 | {\\n x ... }\\n} | f | tst.js:7:5:9:5 | f() {\\n ... ;\\n } | -| tst.js:2:11:10:1 | {\\n x ... }\\n} | func | tst.js:4:5:6:5 | func: f ... ;\\n } | -| tst.js:2:11:10:1 | {\\n x ... }\\n} | x | tst.js:3:5:3:8 | x: 4 | -| tst.js:12:1:19:1 | class C ... ;\\n }\\n} | func | tst.js:13:3:15:3 | static ... x);\\n } | -| tst.js:14:5:14:11 | console | log | tst.js:14:5:14:15 | console.log | -| tst.js:17:5:17:11 | console | log | tst.js:17:5:17:15 | console.log | -| tst.js:21:1:21:1 | C | prop | tst.js:21:1:21:6 | C.prop | -| tst.js:23:15:23:29 | this.someMethod | bind | tst.js:23:15:23:34 | this.someMethod.bind | -| tst.js:24:8:24:57 |
| onClick | tst.js:24:13:24:27 | onClick={click} | -| tst.js:24:36:24:45 | this.state | name | tst.js:24:36:24:50 | this.state.name | -| tst.js:26:2:29:1 | {\\n get ... v) {}\\n} | x | tst.js:27:3:27:26 | get x() ... null; } | -| tst.js:26:2:29:1 | {\\n get ... v) {}\\n} | y | tst.js:28:3:28:13 | set y(v) {} | -| tst.js:31:2:36:1 | {\\n n ... q]: 4\\n} | n | tst.js:32:5:32:8 | n: 1 | -| tst.js:34:6:34:7 | vv | pp | tst.js:34:6:34:10 | vv.pp | -| tst.js:35:6:35:8 | vvv | ppp | tst.js:35:6:35:12 | vvv.ppp | -| tst.js:35:6:35:12 | vvv.ppp | qqq | tst.js:35:6:35:16 | vvv.ppp.qqq | -| tst.js:45:3:45:9 | console | log | tst.js:45:3:45:13 | console.log | diff --git a/javascript/ql/test/library-tests/PropWrite/getAPropertyReference2.ql b/javascript/ql/test/library-tests/PropWrite/getAPropertyReference2.ql deleted file mode 100644 index 3d82f9af0def..000000000000 --- a/javascript/ql/test/library-tests/PropWrite/getAPropertyReference2.ql +++ /dev/null @@ -1,4 +0,0 @@ -import javascript - -from DataFlow::SourceNode nd, string prop -select nd, prop, nd.getAPropertyReference(prop) diff --git a/javascript/ql/test/library-tests/PropWrite/getAPropertyReference2.qll b/javascript/ql/test/library-tests/PropWrite/getAPropertyReference2.qll new file mode 100644 index 000000000000..a30388ee3c01 --- /dev/null +++ b/javascript/ql/test/library-tests/PropWrite/getAPropertyReference2.qll @@ -0,0 +1,7 @@ +import javascript + +query predicate test_getAPropertyReference2( + DataFlow::SourceNode nd, string prop, DataFlow::PropRef res +) { + res = nd.getAPropertyReference(prop) +} diff --git a/javascript/ql/test/library-tests/PropWrite/getAPropertySource.expected b/javascript/ql/test/library-tests/PropWrite/getAPropertySource.expected deleted file mode 100644 index 101dba0e8a49..000000000000 --- a/javascript/ql/test/library-tests/PropWrite/getAPropertySource.expected +++ /dev/null @@ -1,10 +0,0 @@ -| classes.ts:3:21:3:20 | this | instanceField | classes.ts:4:19:4:23 | foo() | -| classes.ts:8:3:8:2 | this | parameterField | classes.ts:8:22:8:35 | parameterField | -| classes.ts:12:5:12:4 | this | parameterField | classes.ts:12:24:12:37 | parameterField | -| classes.ts:12:5:12:4 | this | parameterField | classes.ts:12:41:12:42 | {} | -| classes.ts:16:5:16:4 | this | parameterField | classes.ts:16:24:16:37 | parameterField | -| classes.ts:16:5:16:4 | this | parameterField | classes.ts:16:41:16:42 | {} | -| tst.js:2:11:10:1 | {\\n x ... }\\n} | f | tst.js:7:6:9:5 | () {\\n ... ;\\n } | -| tst.js:2:11:10:1 | {\\n x ... }\\n} | func | tst.js:4:11:6:5 | functio ... ;\\n } | -| tst.js:12:1:19:1 | class C ... ;\\n }\\n} | func | tst.js:13:14:15:3 | (x) {\\n ... x);\\n } | -| tst.js:24:8:24:57 |
| onClick | tst.js:24:22:24:26 | click | diff --git a/javascript/ql/test/library-tests/PropWrite/getAPropertySource.ql b/javascript/ql/test/library-tests/PropWrite/getAPropertySource.ql deleted file mode 100644 index 4b2f7f8d98f1..000000000000 --- a/javascript/ql/test/library-tests/PropWrite/getAPropertySource.ql +++ /dev/null @@ -1,4 +0,0 @@ -import javascript - -from DataFlow::SourceNode nd, string prop -select nd, prop, nd.getAPropertySource(prop) diff --git a/javascript/ql/test/library-tests/PropWrite/getAPropertySource.qll b/javascript/ql/test/library-tests/PropWrite/getAPropertySource.qll new file mode 100644 index 000000000000..7114358615ce --- /dev/null +++ b/javascript/ql/test/library-tests/PropWrite/getAPropertySource.qll @@ -0,0 +1,7 @@ +import javascript + +query predicate test_getAPropertySource( + DataFlow::SourceNode nd, string prop, DataFlow::SourceNode res +) { + res = nd.getAPropertySource(prop) +} diff --git a/javascript/ql/test/library-tests/PropWrite/getAPropertyWrite.expected b/javascript/ql/test/library-tests/PropWrite/getAPropertyWrite.expected deleted file mode 100644 index 485beb857984..000000000000 --- a/javascript/ql/test/library-tests/PropWrite/getAPropertyWrite.expected +++ /dev/null @@ -1,28 +0,0 @@ -| classes.ts:3:21:3:20 | this | classes.ts:4:3:4:24 | instanc ... foo(); | -| classes.ts:8:3:8:2 | this | classes.ts:8:15:8:35 | public ... erField | -| classes.ts:12:5:12:4 | this | classes.ts:12:17:12:37 | public ... erField | -| classes.ts:16:5:16:4 | this | classes.ts:16:17:16:37 | public ... erField | -| tst.js:2:11:10:1 | {\\n x ... }\\n} | tst.js:3:5:3:8 | x: 4 | -| tst.js:2:11:10:1 | {\\n x ... }\\n} | tst.js:4:5:6:5 | func: f ... ;\\n } | -| tst.js:2:11:10:1 | {\\n x ... }\\n} | tst.js:7:5:9:5 | f() {\\n ... ;\\n } | -| tst.js:12:1:19:1 | class C ... ;\\n }\\n} | tst.js:13:3:15:3 | static ... x);\\n } | -| tst.js:21:1:21:1 | C | tst.js:21:1:21:6 | C.prop | -| tst.js:24:8:24:57 |
| tst.js:24:13:24:27 | onClick={click} | -| tst.js:26:2:29:1 | {\\n get ... v) {}\\n} | tst.js:27:3:27:26 | get x() ... null; } | -| tst.js:26:2:29:1 | {\\n get ... v) {}\\n} | tst.js:28:3:28:13 | set y(v) {} | -| tst.js:31:2:36:1 | {\\n n ... q]: 4\\n} | tst.js:32:5:32:8 | n: 1 | -| tst.js:31:2:36:1 | {\\n n ... q]: 4\\n} | tst.js:33:5:33:10 | [v]: 2 | -| tst.js:31:2:36:1 | {\\n n ... q]: 4\\n} | tst.js:34:5:34:14 | [vv.pp]: 3 | -| tst.js:31:2:36:1 | {\\n n ... q]: 4\\n} | tst.js:35:5:35:20 | [vvv.ppp.qqq]: 4 | -| tst.js:38:12:38:26 | ["a", "b", "c"] | tst.js:38:13:38:15 | "a" | -| tst.js:38:12:38:26 | ["a", "b", "c"] | tst.js:38:18:38:20 | "b" | -| tst.js:38:12:38:26 | ["a", "b", "c"] | tst.js:38:23:38:25 | "c" | -| tst.js:39:12:39:23 | ["a", , "c"] | tst.js:39:13:39:15 | "a" | -| tst.js:39:12:39:23 | ["a", , "c"] | tst.js:39:20:39:22 | "c" | -| tst.js:40:12:40:23 | [, "b", "c"] | tst.js:40:15:40:17 | "b" | -| tst.js:40:12:40:23 | [, "b", "c"] | tst.js:40:20:40:22 | "c" | -| tst.js:41:12:41:22 | ["a", "b",] | tst.js:41:13:41:15 | "a" | -| tst.js:41:12:41:22 | ["a", "b",] | tst.js:41:18:41:20 | "b" | -| tst.js:42:12:42:30 | ["a", ...arr3, "d"] | tst.js:42:13:42:15 | "a" | -| tst.js:42:12:42:30 | ["a", ...arr3, "d"] | tst.js:42:18:42:24 | ...arr3 | -| tst.js:42:12:42:30 | ["a", ...arr3, "d"] | tst.js:42:27:42:29 | "d" | diff --git a/javascript/ql/test/library-tests/PropWrite/getAPropertyWrite.ql b/javascript/ql/test/library-tests/PropWrite/getAPropertyWrite.ql deleted file mode 100644 index 31fc0e8a7730..000000000000 --- a/javascript/ql/test/library-tests/PropWrite/getAPropertyWrite.ql +++ /dev/null @@ -1,4 +0,0 @@ -import javascript - -from DataFlow::SourceNode nd -select nd, nd.getAPropertyWrite() diff --git a/javascript/ql/test/library-tests/PropWrite/getAPropertyWrite.qll b/javascript/ql/test/library-tests/PropWrite/getAPropertyWrite.qll new file mode 100644 index 000000000000..622f72d3d043 --- /dev/null +++ b/javascript/ql/test/library-tests/PropWrite/getAPropertyWrite.qll @@ -0,0 +1,5 @@ +import javascript + +query predicate test_getAPropertyWrite(DataFlow::SourceNode nd, DataFlow::PropWrite res) { + res = nd.getAPropertyWrite() +} diff --git a/javascript/ql/test/library-tests/PropWrite/getAPropertyWrite2.expected b/javascript/ql/test/library-tests/PropWrite/getAPropertyWrite2.expected deleted file mode 100644 index e276e476ec83..000000000000 --- a/javascript/ql/test/library-tests/PropWrite/getAPropertyWrite2.expected +++ /dev/null @@ -1,13 +0,0 @@ -| classes.ts:3:21:3:20 | this | instanceField | classes.ts:4:3:4:24 | instanc ... foo(); | -| classes.ts:8:3:8:2 | this | parameterField | classes.ts:8:15:8:35 | public ... erField | -| classes.ts:12:5:12:4 | this | parameterField | classes.ts:12:17:12:37 | public ... erField | -| classes.ts:16:5:16:4 | this | parameterField | classes.ts:16:17:16:37 | public ... erField | -| tst.js:2:11:10:1 | {\\n x ... }\\n} | f | tst.js:7:5:9:5 | f() {\\n ... ;\\n } | -| tst.js:2:11:10:1 | {\\n x ... }\\n} | func | tst.js:4:5:6:5 | func: f ... ;\\n } | -| tst.js:2:11:10:1 | {\\n x ... }\\n} | x | tst.js:3:5:3:8 | x: 4 | -| tst.js:12:1:19:1 | class C ... ;\\n }\\n} | func | tst.js:13:3:15:3 | static ... x);\\n } | -| tst.js:21:1:21:1 | C | prop | tst.js:21:1:21:6 | C.prop | -| tst.js:24:8:24:57 |
| onClick | tst.js:24:13:24:27 | onClick={click} | -| tst.js:26:2:29:1 | {\\n get ... v) {}\\n} | x | tst.js:27:3:27:26 | get x() ... null; } | -| tst.js:26:2:29:1 | {\\n get ... v) {}\\n} | y | tst.js:28:3:28:13 | set y(v) {} | -| tst.js:31:2:36:1 | {\\n n ... q]: 4\\n} | n | tst.js:32:5:32:8 | n: 1 | diff --git a/javascript/ql/test/library-tests/PropWrite/getAPropertyWrite2.ql b/javascript/ql/test/library-tests/PropWrite/getAPropertyWrite2.ql deleted file mode 100644 index b1fd8f930a2c..000000000000 --- a/javascript/ql/test/library-tests/PropWrite/getAPropertyWrite2.ql +++ /dev/null @@ -1,4 +0,0 @@ -import javascript - -from DataFlow::SourceNode nd, string prop -select nd, prop, nd.getAPropertyWrite(prop) diff --git a/javascript/ql/test/library-tests/PropWrite/getAPropertyWrite2.qll b/javascript/ql/test/library-tests/PropWrite/getAPropertyWrite2.qll new file mode 100644 index 000000000000..a42d5d27211e --- /dev/null +++ b/javascript/ql/test/library-tests/PropWrite/getAPropertyWrite2.qll @@ -0,0 +1,7 @@ +import javascript + +query predicate test_getAPropertyWrite2( + DataFlow::SourceNode nd, string prop, DataFlow::PropWrite res +) { + res = nd.getAPropertyWrite(prop) +} diff --git a/javascript/ql/test/library-tests/PropWrite/hasPropertyWrite.expected b/javascript/ql/test/library-tests/PropWrite/hasPropertyWrite.expected deleted file mode 100644 index e6138ec0a33d..000000000000 --- a/javascript/ql/test/library-tests/PropWrite/hasPropertyWrite.expected +++ /dev/null @@ -1,12 +0,0 @@ -| classes.ts:3:21:3:20 | this | instanceField | classes.ts:4:19:4:23 | foo() | -| classes.ts:8:3:8:2 | this | parameterField | classes.ts:8:22:8:35 | parameterField | -| classes.ts:12:5:12:4 | this | parameterField | classes.ts:12:24:12:37 | parameterField | -| classes.ts:16:5:16:4 | this | parameterField | classes.ts:16:24:16:37 | parameterField | -| classes.ts:16:5:16:4 | this | parameterField | classes.ts:16:41:16:42 | {} | -| tst.js:2:11:10:1 | {\\n x ... }\\n} | f | tst.js:7:6:9:5 | () {\\n ... ;\\n } | -| tst.js:2:11:10:1 | {\\n x ... }\\n} | func | tst.js:4:11:6:5 | functio ... ;\\n } | -| tst.js:2:11:10:1 | {\\n x ... }\\n} | x | tst.js:3:8:3:8 | 4 | -| tst.js:12:1:19:1 | class C ... ;\\n }\\n} | func | tst.js:13:14:15:3 | (x) {\\n ... x);\\n } | -| tst.js:21:1:21:1 | C | prop | tst.js:21:10:21:11 | 56 | -| tst.js:24:8:24:57 |
| onClick | tst.js:24:22:24:26 | click | -| tst.js:31:2:36:1 | {\\n n ... q]: 4\\n} | n | tst.js:32:8:32:8 | 1 | diff --git a/javascript/ql/test/library-tests/PropWrite/hasPropertyWrite.ql b/javascript/ql/test/library-tests/PropWrite/hasPropertyWrite.ql deleted file mode 100644 index 6ed91279bf0f..000000000000 --- a/javascript/ql/test/library-tests/PropWrite/hasPropertyWrite.ql +++ /dev/null @@ -1,5 +0,0 @@ -import javascript - -from DataFlow::SourceNode src, string prop, DataFlow::Node rhs -where src.hasPropertyWrite(prop, rhs) -select src, prop, rhs diff --git a/javascript/ql/test/library-tests/PropWrite/hasPropertyWrite.qll b/javascript/ql/test/library-tests/PropWrite/hasPropertyWrite.qll new file mode 100644 index 000000000000..4802527850cc --- /dev/null +++ b/javascript/ql/test/library-tests/PropWrite/hasPropertyWrite.qll @@ -0,0 +1,5 @@ +import javascript + +query predicate test_hasPropertyWrite(DataFlow::SourceNode src, string prop, DataFlow::Node rhs) { + src.hasPropertyWrite(prop, rhs) +} diff --git a/javascript/ql/test/library-tests/PropWrite/tests.expected b/javascript/ql/test/library-tests/PropWrite/tests.expected new file mode 100644 index 000000000000..33eff9b06287 --- /dev/null +++ b/javascript/ql/test/library-tests/PropWrite/tests.expected @@ -0,0 +1,272 @@ +test_getAPropertyRead +| tst.js:1:1:1:0 | this | tst.js:23:15:23:29 | this.someMethod | +| tst.js:1:1:1:0 | this | tst.js:24:36:24:45 | this.state | +| tst.js:14:5:14:11 | console | tst.js:14:5:14:15 | console.log | +| tst.js:17:5:17:11 | console | tst.js:17:5:17:15 | console.log | +| tst.js:23:15:23:29 | this.someMethod | tst.js:23:15:23:34 | this.someMethod.bind | +| tst.js:24:36:24:45 | this.state | tst.js:24:36:24:50 | this.state.name | +| tst.js:34:6:34:7 | vv | tst.js:34:6:34:10 | vv.pp | +| tst.js:35:6:35:8 | vvv | tst.js:35:6:35:12 | vvv.ppp | +| tst.js:35:6:35:12 | vvv.ppp | tst.js:35:6:35:16 | vvv.ppp.qqq | +| tst.js:45:3:45:9 | console | tst.js:45:3:45:13 | console.log | +| tst.js:45:15:45:17 | obj | tst.js:45:15:45:20 | obj[p] | +test_getAPropertyReference +| classes.ts:3:21:3:20 | this | classes.ts:4:3:4:24 | instanc ... foo(); | +| classes.ts:8:3:8:2 | this | classes.ts:8:15:8:35 | public ... erField | +| classes.ts:12:5:12:4 | this | classes.ts:12:17:12:37 | public ... erField | +| classes.ts:16:5:16:4 | this | classes.ts:16:17:16:37 | public ... erField | +| tst.js:1:1:1:0 | this | tst.js:23:15:23:29 | this.someMethod | +| tst.js:1:1:1:0 | this | tst.js:24:36:24:45 | this.state | +| tst.js:2:11:10:1 | {\\n x ... }\\n} | tst.js:3:5:3:8 | x: 4 | +| tst.js:2:11:10:1 | {\\n x ... }\\n} | tst.js:4:5:6:5 | func: f ... ;\\n } | +| tst.js:2:11:10:1 | {\\n x ... }\\n} | tst.js:7:5:9:5 | f() {\\n ... ;\\n } | +| tst.js:12:1:19:1 | class C ... ;\\n }\\n} | tst.js:13:3:15:3 | static ... x);\\n } | +| tst.js:14:5:14:11 | console | tst.js:14:5:14:15 | console.log | +| tst.js:17:5:17:11 | console | tst.js:17:5:17:15 | console.log | +| tst.js:21:1:21:1 | C | tst.js:21:1:21:6 | C.prop | +| tst.js:23:15:23:29 | this.someMethod | tst.js:23:15:23:34 | this.someMethod.bind | +| tst.js:24:8:24:57 |
| tst.js:24:13:24:27 | onClick={click} | +| tst.js:24:36:24:45 | this.state | tst.js:24:36:24:50 | this.state.name | +| tst.js:26:2:29:1 | {\\n get ... v) {}\\n} | tst.js:27:3:27:26 | get x() ... null; } | +| tst.js:26:2:29:1 | {\\n get ... v) {}\\n} | tst.js:28:3:28:13 | set y(v) {} | +| tst.js:31:2:36:1 | {\\n n ... q]: 4\\n} | tst.js:32:5:32:8 | n: 1 | +| tst.js:31:2:36:1 | {\\n n ... q]: 4\\n} | tst.js:33:5:33:10 | [v]: 2 | +| tst.js:31:2:36:1 | {\\n n ... q]: 4\\n} | tst.js:34:5:34:14 | [vv.pp]: 3 | +| tst.js:31:2:36:1 | {\\n n ... q]: 4\\n} | tst.js:35:5:35:20 | [vvv.ppp.qqq]: 4 | +| tst.js:34:6:34:7 | vv | tst.js:34:6:34:10 | vv.pp | +| tst.js:35:6:35:8 | vvv | tst.js:35:6:35:12 | vvv.ppp | +| tst.js:35:6:35:12 | vvv.ppp | tst.js:35:6:35:16 | vvv.ppp.qqq | +| tst.js:38:12:38:26 | ["a", "b", "c"] | tst.js:38:13:38:15 | "a" | +| tst.js:38:12:38:26 | ["a", "b", "c"] | tst.js:38:18:38:20 | "b" | +| tst.js:38:12:38:26 | ["a", "b", "c"] | tst.js:38:23:38:25 | "c" | +| tst.js:39:12:39:23 | ["a", , "c"] | tst.js:39:13:39:15 | "a" | +| tst.js:39:12:39:23 | ["a", , "c"] | tst.js:39:20:39:22 | "c" | +| tst.js:40:12:40:23 | [, "b", "c"] | tst.js:40:15:40:17 | "b" | +| tst.js:40:12:40:23 | [, "b", "c"] | tst.js:40:20:40:22 | "c" | +| tst.js:41:12:41:22 | ["a", "b",] | tst.js:41:13:41:15 | "a" | +| tst.js:41:12:41:22 | ["a", "b",] | tst.js:41:18:41:20 | "b" | +| tst.js:42:12:42:30 | ["a", ...arr3, "d"] | tst.js:42:13:42:15 | "a" | +| tst.js:42:12:42:30 | ["a", ...arr3, "d"] | tst.js:42:18:42:24 | ...arr3 | +| tst.js:42:12:42:30 | ["a", ...arr3, "d"] | tst.js:42:27:42:29 | "d" | +| tst.js:45:3:45:9 | console | tst.js:45:3:45:13 | console.log | +| tst.js:45:15:45:17 | obj | tst.js:45:15:45:20 | obj[p] | +test_getAPropertySource +| classes.ts:3:21:3:20 | this | instanceField | classes.ts:4:19:4:23 | foo() | +| classes.ts:8:3:8:2 | this | parameterField | classes.ts:8:22:8:35 | parameterField | +| classes.ts:12:5:12:4 | this | parameterField | classes.ts:12:24:12:37 | parameterField | +| classes.ts:12:5:12:4 | this | parameterField | classes.ts:12:41:12:42 | {} | +| classes.ts:16:5:16:4 | this | parameterField | classes.ts:16:24:16:37 | parameterField | +| classes.ts:16:5:16:4 | this | parameterField | classes.ts:16:41:16:42 | {} | +| tst.js:2:11:10:1 | {\\n x ... }\\n} | f | tst.js:7:6:9:5 | () {\\n ... ;\\n } | +| tst.js:2:11:10:1 | {\\n x ... }\\n} | func | tst.js:4:11:6:5 | functio ... ;\\n } | +| tst.js:12:1:19:1 | class C ... ;\\n }\\n} | func | tst.js:13:14:15:3 | (x) {\\n ... x);\\n } | +| tst.js:24:8:24:57 |
| onClick | tst.js:24:22:24:26 | click | +test_PropWritePropName +| classes.ts:3:21:3:20 | constructor() {} | constructor | +| classes.ts:4:3:4:24 | instanc ... foo(); | instanceField | +| classes.ts:8:3:8:39 | constru ... eld) {} | constructor | +| classes.ts:8:15:8:35 | public ... erField | parameterField | +| classes.ts:12:5:12:68 | constru ... + 42; } | constructor | +| classes.ts:12:17:12:37 | public ... erField | parameterField | +| classes.ts:16:5:16:46 | constru ... {}) {} | constructor | +| classes.ts:16:17:16:37 | public ... erField | parameterField | +| tst.js:3:5:3:8 | x: 4 | x | +| tst.js:4:5:6:5 | func: f ... ;\\n } | func | +| tst.js:7:5:9:5 | f() {\\n ... ;\\n } | f | +| tst.js:12:9:12:8 | constructor() {} | constructor | +| tst.js:13:3:15:3 | static ... x);\\n } | func | +| tst.js:16:3:18:3 | f(x) {\\n ... x);\\n } | f | +| tst.js:21:1:21:6 | C.prop | prop | +| tst.js:24:13:24:27 | onClick={click} | onClick | +| tst.js:27:3:27:26 | get x() ... null; } | x | +| tst.js:28:3:28:13 | set y(v) {} | y | +| tst.js:32:5:32:8 | n: 1 | n | +test_getAPropertyRead2 +| tst.js:1:1:1:0 | this | someMethod | tst.js:23:15:23:29 | this.someMethod | +| tst.js:1:1:1:0 | this | state | tst.js:24:36:24:45 | this.state | +| tst.js:14:5:14:11 | console | log | tst.js:14:5:14:15 | console.log | +| tst.js:17:5:17:11 | console | log | tst.js:17:5:17:15 | console.log | +| tst.js:23:15:23:29 | this.someMethod | bind | tst.js:23:15:23:34 | this.someMethod.bind | +| tst.js:24:36:24:45 | this.state | name | tst.js:24:36:24:50 | this.state.name | +| tst.js:34:6:34:7 | vv | pp | tst.js:34:6:34:10 | vv.pp | +| tst.js:35:6:35:8 | vvv | ppp | tst.js:35:6:35:12 | vvv.ppp | +| tst.js:35:6:35:12 | vvv.ppp | qqq | tst.js:35:6:35:16 | vvv.ppp.qqq | +| tst.js:45:3:45:9 | console | log | tst.js:45:3:45:13 | console.log | +test_getAPropertyReference2 +| classes.ts:3:21:3:20 | this | instanceField | classes.ts:4:3:4:24 | instanc ... foo(); | +| classes.ts:8:3:8:2 | this | parameterField | classes.ts:8:15:8:35 | public ... erField | +| classes.ts:12:5:12:4 | this | parameterField | classes.ts:12:17:12:37 | public ... erField | +| classes.ts:16:5:16:4 | this | parameterField | classes.ts:16:17:16:37 | public ... erField | +| tst.js:1:1:1:0 | this | someMethod | tst.js:23:15:23:29 | this.someMethod | +| tst.js:1:1:1:0 | this | state | tst.js:24:36:24:45 | this.state | +| tst.js:2:11:10:1 | {\\n x ... }\\n} | f | tst.js:7:5:9:5 | f() {\\n ... ;\\n } | +| tst.js:2:11:10:1 | {\\n x ... }\\n} | func | tst.js:4:5:6:5 | func: f ... ;\\n } | +| tst.js:2:11:10:1 | {\\n x ... }\\n} | x | tst.js:3:5:3:8 | x: 4 | +| tst.js:12:1:19:1 | class C ... ;\\n }\\n} | func | tst.js:13:3:15:3 | static ... x);\\n } | +| tst.js:14:5:14:11 | console | log | tst.js:14:5:14:15 | console.log | +| tst.js:17:5:17:11 | console | log | tst.js:17:5:17:15 | console.log | +| tst.js:21:1:21:1 | C | prop | tst.js:21:1:21:6 | C.prop | +| tst.js:23:15:23:29 | this.someMethod | bind | tst.js:23:15:23:34 | this.someMethod.bind | +| tst.js:24:8:24:57 |
| onClick | tst.js:24:13:24:27 | onClick={click} | +| tst.js:24:36:24:45 | this.state | name | tst.js:24:36:24:50 | this.state.name | +| tst.js:26:2:29:1 | {\\n get ... v) {}\\n} | x | tst.js:27:3:27:26 | get x() ... null; } | +| tst.js:26:2:29:1 | {\\n get ... v) {}\\n} | y | tst.js:28:3:28:13 | set y(v) {} | +| tst.js:31:2:36:1 | {\\n n ... q]: 4\\n} | n | tst.js:32:5:32:8 | n: 1 | +| tst.js:34:6:34:7 | vv | pp | tst.js:34:6:34:10 | vv.pp | +| tst.js:35:6:35:8 | vvv | ppp | tst.js:35:6:35:12 | vvv.ppp | +| tst.js:35:6:35:12 | vvv.ppp | qqq | tst.js:35:6:35:16 | vvv.ppp.qqq | +| tst.js:45:3:45:9 | console | log | tst.js:45:3:45:13 | console.log | +test_hasPropertyWrite +| classes.ts:3:21:3:20 | this | instanceField | classes.ts:4:19:4:23 | foo() | +| classes.ts:8:3:8:2 | this | parameterField | classes.ts:8:22:8:35 | parameterField | +| classes.ts:12:5:12:4 | this | parameterField | classes.ts:12:24:12:37 | parameterField | +| classes.ts:16:5:16:4 | this | parameterField | classes.ts:16:24:16:37 | parameterField | +| classes.ts:16:5:16:4 | this | parameterField | classes.ts:16:41:16:42 | {} | +| tst.js:2:11:10:1 | {\\n x ... }\\n} | f | tst.js:7:6:9:5 | () {\\n ... ;\\n } | +| tst.js:2:11:10:1 | {\\n x ... }\\n} | func | tst.js:4:11:6:5 | functio ... ;\\n } | +| tst.js:2:11:10:1 | {\\n x ... }\\n} | x | tst.js:3:8:3:8 | 4 | +| tst.js:12:1:19:1 | class C ... ;\\n }\\n} | func | tst.js:13:14:15:3 | (x) {\\n ... x);\\n } | +| tst.js:21:1:21:1 | C | prop | tst.js:21:10:21:11 | 56 | +| tst.js:24:8:24:57 |
| onClick | tst.js:24:22:24:26 | click | +| tst.js:31:2:36:1 | {\\n n ... q]: 4\\n} | n | tst.js:32:8:32:8 | 1 | +test_PropWriteBase +| classes.ts:4:3:4:24 | instanc ... foo(); | classes.ts:3:21:3:20 | this | +| classes.ts:8:15:8:35 | public ... erField | classes.ts:8:3:8:2 | this | +| classes.ts:12:17:12:37 | public ... erField | classes.ts:12:5:12:4 | this | +| classes.ts:16:17:16:37 | public ... erField | classes.ts:16:5:16:4 | this | +| tst.js:3:5:3:8 | x: 4 | tst.js:2:11:10:1 | {\\n x ... }\\n} | +| tst.js:4:5:6:5 | func: f ... ;\\n } | tst.js:2:11:10:1 | {\\n x ... }\\n} | +| tst.js:7:5:9:5 | f() {\\n ... ;\\n } | tst.js:2:11:10:1 | {\\n x ... }\\n} | +| tst.js:13:3:15:3 | static ... x);\\n } | tst.js:12:1:19:1 | class C ... ;\\n }\\n} | +| tst.js:21:1:21:6 | C.prop | tst.js:21:1:21:1 | C | +| tst.js:24:13:24:27 | onClick={click} | tst.js:24:8:24:57 |
| +| tst.js:27:3:27:26 | get x() ... null; } | tst.js:26:2:29:1 | {\\n get ... v) {}\\n} | +| tst.js:28:3:28:13 | set y(v) {} | tst.js:26:2:29:1 | {\\n get ... v) {}\\n} | +| tst.js:32:5:32:8 | n: 1 | tst.js:31:2:36:1 | {\\n n ... q]: 4\\n} | +| tst.js:33:5:33:10 | [v]: 2 | tst.js:31:2:36:1 | {\\n n ... q]: 4\\n} | +| tst.js:34:5:34:14 | [vv.pp]: 3 | tst.js:31:2:36:1 | {\\n n ... q]: 4\\n} | +| tst.js:35:5:35:20 | [vvv.ppp.qqq]: 4 | tst.js:31:2:36:1 | {\\n n ... q]: 4\\n} | +| tst.js:38:13:38:15 | "a" | tst.js:38:12:38:26 | ["a", "b", "c"] | +| tst.js:38:18:38:20 | "b" | tst.js:38:12:38:26 | ["a", "b", "c"] | +| tst.js:38:23:38:25 | "c" | tst.js:38:12:38:26 | ["a", "b", "c"] | +| tst.js:39:13:39:15 | "a" | tst.js:39:12:39:23 | ["a", , "c"] | +| tst.js:39:20:39:22 | "c" | tst.js:39:12:39:23 | ["a", , "c"] | +| tst.js:40:15:40:17 | "b" | tst.js:40:12:40:23 | [, "b", "c"] | +| tst.js:40:20:40:22 | "c" | tst.js:40:12:40:23 | [, "b", "c"] | +| tst.js:41:13:41:15 | "a" | tst.js:41:12:41:22 | ["a", "b",] | +| tst.js:41:18:41:20 | "b" | tst.js:41:12:41:22 | ["a", "b",] | +| tst.js:42:13:42:15 | "a" | tst.js:42:12:42:30 | ["a", ...arr3, "d"] | +| tst.js:42:18:42:24 | ...arr3 | tst.js:42:12:42:30 | ["a", ...arr3, "d"] | +| tst.js:42:27:42:29 | "d" | tst.js:42:12:42:30 | ["a", ...arr3, "d"] | +test_getAPropertyWrite +| classes.ts:3:21:3:20 | this | classes.ts:4:3:4:24 | instanc ... foo(); | +| classes.ts:8:3:8:2 | this | classes.ts:8:15:8:35 | public ... erField | +| classes.ts:12:5:12:4 | this | classes.ts:12:17:12:37 | public ... erField | +| classes.ts:16:5:16:4 | this | classes.ts:16:17:16:37 | public ... erField | +| tst.js:2:11:10:1 | {\\n x ... }\\n} | tst.js:3:5:3:8 | x: 4 | +| tst.js:2:11:10:1 | {\\n x ... }\\n} | tst.js:4:5:6:5 | func: f ... ;\\n } | +| tst.js:2:11:10:1 | {\\n x ... }\\n} | tst.js:7:5:9:5 | f() {\\n ... ;\\n } | +| tst.js:12:1:19:1 | class C ... ;\\n }\\n} | tst.js:13:3:15:3 | static ... x);\\n } | +| tst.js:21:1:21:1 | C | tst.js:21:1:21:6 | C.prop | +| tst.js:24:8:24:57 |
| tst.js:24:13:24:27 | onClick={click} | +| tst.js:26:2:29:1 | {\\n get ... v) {}\\n} | tst.js:27:3:27:26 | get x() ... null; } | +| tst.js:26:2:29:1 | {\\n get ... v) {}\\n} | tst.js:28:3:28:13 | set y(v) {} | +| tst.js:31:2:36:1 | {\\n n ... q]: 4\\n} | tst.js:32:5:32:8 | n: 1 | +| tst.js:31:2:36:1 | {\\n n ... q]: 4\\n} | tst.js:33:5:33:10 | [v]: 2 | +| tst.js:31:2:36:1 | {\\n n ... q]: 4\\n} | tst.js:34:5:34:14 | [vv.pp]: 3 | +| tst.js:31:2:36:1 | {\\n n ... q]: 4\\n} | tst.js:35:5:35:20 | [vvv.ppp.qqq]: 4 | +| tst.js:38:12:38:26 | ["a", "b", "c"] | tst.js:38:13:38:15 | "a" | +| tst.js:38:12:38:26 | ["a", "b", "c"] | tst.js:38:18:38:20 | "b" | +| tst.js:38:12:38:26 | ["a", "b", "c"] | tst.js:38:23:38:25 | "c" | +| tst.js:39:12:39:23 | ["a", , "c"] | tst.js:39:13:39:15 | "a" | +| tst.js:39:12:39:23 | ["a", , "c"] | tst.js:39:20:39:22 | "c" | +| tst.js:40:12:40:23 | [, "b", "c"] | tst.js:40:15:40:17 | "b" | +| tst.js:40:12:40:23 | [, "b", "c"] | tst.js:40:20:40:22 | "c" | +| tst.js:41:12:41:22 | ["a", "b",] | tst.js:41:13:41:15 | "a" | +| tst.js:41:12:41:22 | ["a", "b",] | tst.js:41:18:41:20 | "b" | +| tst.js:42:12:42:30 | ["a", ...arr3, "d"] | tst.js:42:13:42:15 | "a" | +| tst.js:42:12:42:30 | ["a", ...arr3, "d"] | tst.js:42:18:42:24 | ...arr3 | +| tst.js:42:12:42:30 | ["a", ...arr3, "d"] | tst.js:42:27:42:29 | "d" | +test_PropWrite +| classes.ts:3:21:3:20 | constructor() {} | +| classes.ts:4:3:4:24 | instanc ... foo(); | +| classes.ts:8:3:8:39 | constru ... eld) {} | +| classes.ts:8:15:8:35 | public ... erField | +| classes.ts:12:5:12:68 | constru ... + 42; } | +| classes.ts:12:17:12:37 | public ... erField | +| classes.ts:16:5:16:46 | constru ... {}) {} | +| classes.ts:16:17:16:37 | public ... erField | +| tst.js:3:5:3:8 | x: 4 | +| tst.js:4:5:6:5 | func: f ... ;\\n } | +| tst.js:7:5:9:5 | f() {\\n ... ;\\n } | +| tst.js:12:9:12:8 | constructor() {} | +| tst.js:13:3:15:3 | static ... x);\\n } | +| tst.js:16:3:18:3 | f(x) {\\n ... x);\\n } | +| tst.js:21:1:21:6 | C.prop | +| tst.js:24:13:24:27 | onClick={click} | +| tst.js:27:3:27:26 | get x() ... null; } | +| tst.js:28:3:28:13 | set y(v) {} | +| tst.js:32:5:32:8 | n: 1 | +| tst.js:33:5:33:10 | [v]: 2 | +| tst.js:34:5:34:14 | [vv.pp]: 3 | +| tst.js:35:5:35:20 | [vvv.ppp.qqq]: 4 | +| tst.js:38:13:38:15 | "a" | +| tst.js:38:18:38:20 | "b" | +| tst.js:38:23:38:25 | "c" | +| tst.js:39:13:39:15 | "a" | +| tst.js:39:20:39:22 | "c" | +| tst.js:40:15:40:17 | "b" | +| tst.js:40:20:40:22 | "c" | +| tst.js:41:13:41:15 | "a" | +| tst.js:41:18:41:20 | "b" | +| tst.js:42:13:42:15 | "a" | +| tst.js:42:18:42:24 | ...arr3 | +| tst.js:42:27:42:29 | "d" | +test_getAPropertyWrite2 +| classes.ts:3:21:3:20 | this | instanceField | classes.ts:4:3:4:24 | instanc ... foo(); | +| classes.ts:8:3:8:2 | this | parameterField | classes.ts:8:15:8:35 | public ... erField | +| classes.ts:12:5:12:4 | this | parameterField | classes.ts:12:17:12:37 | public ... erField | +| classes.ts:16:5:16:4 | this | parameterField | classes.ts:16:17:16:37 | public ... erField | +| tst.js:2:11:10:1 | {\\n x ... }\\n} | f | tst.js:7:5:9:5 | f() {\\n ... ;\\n } | +| tst.js:2:11:10:1 | {\\n x ... }\\n} | func | tst.js:4:5:6:5 | func: f ... ;\\n } | +| tst.js:2:11:10:1 | {\\n x ... }\\n} | x | tst.js:3:5:3:8 | x: 4 | +| tst.js:12:1:19:1 | class C ... ;\\n }\\n} | func | tst.js:13:3:15:3 | static ... x);\\n } | +| tst.js:21:1:21:1 | C | prop | tst.js:21:1:21:6 | C.prop | +| tst.js:24:8:24:57 |
| onClick | tst.js:24:13:24:27 | onClick={click} | +| tst.js:26:2:29:1 | {\\n get ... v) {}\\n} | x | tst.js:27:3:27:26 | get x() ... null; } | +| tst.js:26:2:29:1 | {\\n get ... v) {}\\n} | y | tst.js:28:3:28:13 | set y(v) {} | +| tst.js:31:2:36:1 | {\\n n ... q]: 4\\n} | n | tst.js:32:5:32:8 | n: 1 | +test_PropWriteRhs +| classes.ts:3:21:3:20 | constructor() {} | classes.ts:3:21:3:20 | () {} | +| classes.ts:4:3:4:24 | instanc ... foo(); | classes.ts:4:19:4:23 | foo() | +| classes.ts:8:3:8:39 | constru ... eld) {} | classes.ts:8:3:8:39 | constru ... eld) {} | +| classes.ts:8:15:8:35 | public ... erField | classes.ts:8:22:8:35 | parameterField | +| classes.ts:12:5:12:68 | constru ... + 42; } | classes.ts:12:5:12:68 | constru ... + 42; } | +| classes.ts:12:17:12:37 | public ... erField | classes.ts:12:24:12:37 | parameterField | +| classes.ts:16:5:16:46 | constru ... {}) {} | classes.ts:16:5:16:46 | constru ... {}) {} | +| classes.ts:16:17:16:37 | public ... erField | classes.ts:16:24:16:37 | parameterField | +| classes.ts:16:17:16:37 | public ... erField | classes.ts:16:41:16:42 | {} | +| tst.js:3:5:3:8 | x: 4 | tst.js:3:8:3:8 | 4 | +| tst.js:4:5:6:5 | func: f ... ;\\n } | tst.js:4:11:6:5 | functio ... ;\\n } | +| tst.js:7:5:9:5 | f() {\\n ... ;\\n } | tst.js:7:6:9:5 | () {\\n ... ;\\n } | +| tst.js:12:9:12:8 | constructor() {} | tst.js:12:9:12:8 | () {} | +| tst.js:13:3:15:3 | static ... x);\\n } | tst.js:13:14:15:3 | (x) {\\n ... x);\\n } | +| tst.js:16:3:18:3 | f(x) {\\n ... x);\\n } | tst.js:16:4:18:3 | (x) {\\n ... x);\\n } | +| tst.js:21:1:21:6 | C.prop | tst.js:21:10:21:11 | 56 | +| tst.js:24:13:24:27 | onClick={click} | tst.js:24:22:24:26 | click | +| tst.js:32:5:32:8 | n: 1 | tst.js:32:8:32:8 | 1 | +| tst.js:33:5:33:10 | [v]: 2 | tst.js:33:10:33:10 | 2 | +| tst.js:34:5:34:14 | [vv.pp]: 3 | tst.js:34:14:34:14 | 3 | +| tst.js:35:5:35:20 | [vvv.ppp.qqq]: 4 | tst.js:35:20:35:20 | 4 | +| tst.js:38:13:38:15 | "a" | tst.js:38:13:38:15 | "a" | +| tst.js:38:18:38:20 | "b" | tst.js:38:18:38:20 | "b" | +| tst.js:38:23:38:25 | "c" | tst.js:38:23:38:25 | "c" | +| tst.js:39:13:39:15 | "a" | tst.js:39:13:39:15 | "a" | +| tst.js:39:20:39:22 | "c" | tst.js:39:20:39:22 | "c" | +| tst.js:40:15:40:17 | "b" | tst.js:40:15:40:17 | "b" | +| tst.js:40:20:40:22 | "c" | tst.js:40:20:40:22 | "c" | +| tst.js:41:13:41:15 | "a" | tst.js:41:13:41:15 | "a" | +| tst.js:41:18:41:20 | "b" | tst.js:41:18:41:20 | "b" | +| tst.js:42:13:42:15 | "a" | tst.js:42:13:42:15 | "a" | +| tst.js:42:18:42:24 | ...arr3 | tst.js:42:18:42:24 | ...arr3 | +| tst.js:42:27:42:29 | "d" | tst.js:42:27:42:29 | "d" | diff --git a/javascript/ql/test/library-tests/PropWrite/tests.ql b/javascript/ql/test/library-tests/PropWrite/tests.ql new file mode 100644 index 000000000000..661f7ed563b7 --- /dev/null +++ b/javascript/ql/test/library-tests/PropWrite/tests.ql @@ -0,0 +1,12 @@ +import getAPropertyRead +import getAPropertyReference +import getAPropertySource +import PropWritePropName +import getAPropertyRead2 +import getAPropertyReference2 +import hasPropertyWrite +import PropWriteBase +import getAPropertyWrite +import PropWrite +import getAPropertyWrite2 +import PropWriteRhs diff --git a/javascript/ql/test/library-tests/TypeScript/TypeAnnotations/ArrayTypeExpr.expected b/javascript/ql/test/library-tests/TypeScript/TypeAnnotations/ArrayTypeExpr.expected deleted file mode 100644 index d6fc26c35200..000000000000 --- a/javascript/ql/test/library-tests/TypeScript/TypeAnnotations/ArrayTypeExpr.expected +++ /dev/null @@ -1,10 +0,0 @@ -| tst.ts:38:16:38:23 | string[] | tst.ts:38:16:38:21 | string | -| tst.ts:39:17:39:24 | string[] | tst.ts:39:17:39:22 | string | -| tst.ts:39:17:39:26 | string[][] | tst.ts:39:17:39:24 | string[] | -| tst.ts:40:17:40:24 | string[] | tst.ts:40:17:40:22 | string | -| tst.ts:40:17:40:26 | string[][] | tst.ts:40:17:40:24 | string[] | -| tst.ts:40:17:40:28 | string[][][] | tst.ts:40:17:40:26 | string[][] | -| tst.ts:80:49:80:54 | Leaf[] | tst.ts:80:49:80:52 | Leaf | -| tst.ts:81:27:81:34 | string[] | tst.ts:81:27:81:32 | string | -| tst.ts:135:39:135:46 | string[] | tst.ts:135:39:135:44 | string | -| tst.ts:136:60:136:67 | number[] | tst.ts:136:60:136:65 | number | diff --git a/javascript/ql/test/library-tests/TypeScript/TypeAnnotations/ArrayTypeExpr.ql b/javascript/ql/test/library-tests/TypeScript/TypeAnnotations/ArrayTypeExpr.ql deleted file mode 100644 index ece1f188941d..000000000000 --- a/javascript/ql/test/library-tests/TypeScript/TypeAnnotations/ArrayTypeExpr.ql +++ /dev/null @@ -1,4 +0,0 @@ -import javascript - -from ArrayTypeExpr expr -select expr, expr.getElementType() diff --git a/javascript/ql/test/library-tests/TypeScript/TypeAnnotations/ArrayTypeExpr.qll b/javascript/ql/test/library-tests/TypeScript/TypeAnnotations/ArrayTypeExpr.qll new file mode 100644 index 000000000000..6488470c94f2 --- /dev/null +++ b/javascript/ql/test/library-tests/TypeScript/TypeAnnotations/ArrayTypeExpr.qll @@ -0,0 +1,3 @@ +import javascript + +query predicate test_ArrayTypeExpr(ArrayTypeExpr expr, TypeExpr res) { res = expr.getElementType() } diff --git a/javascript/ql/test/library-tests/TypeScript/TypeAnnotations/ChildIndex.expected b/javascript/ql/test/library-tests/TypeScript/TypeAnnotations/ChildIndex.expected deleted file mode 100644 index e69de29bb2d1..000000000000 diff --git a/javascript/ql/test/library-tests/TypeScript/TypeAnnotations/ChildIndex.ql b/javascript/ql/test/library-tests/TypeScript/TypeAnnotations/ChildIndex.ql deleted file mode 100644 index 8854d1f7bd9b..000000000000 --- a/javascript/ql/test/library-tests/TypeScript/TypeAnnotations/ChildIndex.ql +++ /dev/null @@ -1,8 +0,0 @@ -import javascript - -from ASTNode node, ASTNode child1, ASTNode child2, int index -where - node.getChild(index) = child1 and - node.getChild(index) = child2 and - child1 != child2 -select node, "There are two different children at index " + index diff --git a/javascript/ql/test/library-tests/TypeScript/TypeAnnotations/ChildIndex.qll b/javascript/ql/test/library-tests/TypeScript/TypeAnnotations/ChildIndex.qll new file mode 100644 index 000000000000..76f83803ea3d --- /dev/null +++ b/javascript/ql/test/library-tests/TypeScript/TypeAnnotations/ChildIndex.qll @@ -0,0 +1,9 @@ +import javascript + +query predicate test_ChildIndex(ASTNode node, string res) { + exists(ASTNode child1, ASTNode child2, int index | + node.getChild(index) = child1 and node.getChild(index) = child2 and child1 != child2 + | + res = "There are two different children at index " + index.toString() + ) +} diff --git a/javascript/ql/test/library-tests/TypeScript/TypeAnnotations/Containers.expected b/javascript/ql/test/library-tests/TypeScript/TypeAnnotations/Containers.expected deleted file mode 100644 index e69de29bb2d1..000000000000 diff --git a/javascript/ql/test/library-tests/TypeScript/TypeAnnotations/Containers.ql b/javascript/ql/test/library-tests/TypeScript/TypeAnnotations/Containers.ql deleted file mode 100644 index 7bbeec43860c..000000000000 --- a/javascript/ql/test/library-tests/TypeScript/TypeAnnotations/Containers.ql +++ /dev/null @@ -1,44 +0,0 @@ -import javascript - -abstract class Violation extends ASTNode { - abstract string reason(); -} - -class MissingContainer extends Violation, TypeExpr { - MissingContainer() { not exists(getContainer()) } - - override string reason() { result = "Has no container" } -} - -class MissingEnclosingStmt extends Violation, TypeExpr { - MissingEnclosingStmt() { - not exists(getEnclosingStmt()) and - // type parameters, parameter types, return types, and this parameter types have no enclosing statements - not exists(Function f, TypeExpr type | - ( - type = f.getAParameter().getTypeAnnotation() or - type = f.getReturnTypeAnnotation() or - type = f.getATypeParameter() or - type = f.getThisTypeAnnotation() - ) and - this.getParent*() = type - ) - } - - override string reason() { result = "Has no enclosing statement" } -} - -class DifferentContainer extends Violation, VarDecl { - DifferentContainer() { getContainer() != getTypeAnnotation().getContainer() } - - override string reason() { result = "Type annotation has different container" } -} - -class DifferentEnclosingStmt extends Violation, VarDecl { - DifferentEnclosingStmt() { getEnclosingStmt() != getTypeAnnotation().getEnclosingStmt() } - - override string reason() { result = "Type annotation has different enclosing statement" } -} - -from Violation err -select err, err.reason() diff --git a/javascript/ql/test/library-tests/TypeScript/TypeAnnotations/Containers.qll b/javascript/ql/test/library-tests/TypeScript/TypeAnnotations/Containers.qll new file mode 100644 index 000000000000..775540717c97 --- /dev/null +++ b/javascript/ql/test/library-tests/TypeScript/TypeAnnotations/Containers.qll @@ -0,0 +1,43 @@ +import javascript + +abstract class Violation extends ASTNode { + abstract string reason(); +} + +class MissingContainer extends Violation, TypeExpr { + MissingContainer() { not exists(getContainer()) } + + override string reason() { result = "Has no container" } +} + +class MissingEnclosingStmt extends Violation, TypeExpr { + MissingEnclosingStmt() { + not exists(getEnclosingStmt()) and + // type parameters, parameter types, return types, and this parameter types have no enclosing statements + not exists(Function f, TypeExpr type | + ( + type = f.getAParameter().getTypeAnnotation() or + type = f.getReturnTypeAnnotation() or + type = f.getATypeParameter() or + type = f.getThisTypeAnnotation() + ) and + this.getParent*() = type + ) + } + + override string reason() { result = "Has no enclosing statement" } +} + +class DifferentContainer extends Violation, VarDecl { + DifferentContainer() { getContainer() != getTypeAnnotation().getContainer() } + + override string reason() { result = "Type annotation has different container" } +} + +class DifferentEnclosingStmt extends Violation, VarDecl { + DifferentEnclosingStmt() { getEnclosingStmt() != getTypeAnnotation().getEnclosingStmt() } + + override string reason() { result = "Type annotation has different enclosing statement" } +} + +query predicate test_Containers(Violation err, string res) { res = err.reason() } diff --git a/javascript/ql/test/library-tests/TypeScript/TypeAnnotations/FieldTypes.expected b/javascript/ql/test/library-tests/TypeScript/TypeAnnotations/FieldTypes.expected deleted file mode 100644 index ae4a30a0949c..000000000000 --- a/javascript/ql/test/library-tests/TypeScript/TypeAnnotations/FieldTypes.expected +++ /dev/null @@ -1,6 +0,0 @@ -| tst.ts:15:3:15:22 | numberField: number; | tst.ts:15:16:15:21 | number | -| tst.ts:16:3:16:22 | stringField: string; | tst.ts:16:16:16:21 | string | -| tst.ts:17:3:17:28 | interfa ... erface; | tst.ts:17:19:17:27 | Interface | -| tst.ts:18:3:18:18 | thisField: this; | tst.ts:18:14:18:17 | this | -| tst.ts:83:21:83:30 | x: number; | tst.ts:83:24:83:29 | number | -| tst.ts:83:32:83:41 | y: number; | tst.ts:83:35:83:40 | number | diff --git a/javascript/ql/test/library-tests/TypeScript/TypeAnnotations/FieldTypes.ql b/javascript/ql/test/library-tests/TypeScript/TypeAnnotations/FieldTypes.ql deleted file mode 100644 index 300782746f09..000000000000 --- a/javascript/ql/test/library-tests/TypeScript/TypeAnnotations/FieldTypes.ql +++ /dev/null @@ -1,4 +0,0 @@ -import javascript - -from FieldDeclaration field -select field, field.getTypeAnnotation() diff --git a/javascript/ql/test/library-tests/TypeScript/TypeAnnotations/FieldTypes.qll b/javascript/ql/test/library-tests/TypeScript/TypeAnnotations/FieldTypes.qll new file mode 100644 index 000000000000..a576ac4cddf6 --- /dev/null +++ b/javascript/ql/test/library-tests/TypeScript/TypeAnnotations/FieldTypes.qll @@ -0,0 +1,5 @@ +import javascript + +query predicate test_FieldTypes(FieldDeclaration field, TypeExpr res) { + res = field.getTypeAnnotation() +} diff --git a/javascript/ql/test/library-tests/TypeScript/TypeAnnotations/FunctionTypeParameters.expected b/javascript/ql/test/library-tests/TypeScript/TypeAnnotations/FunctionTypeParameters.expected deleted file mode 100644 index e349662bd79f..000000000000 --- a/javascript/ql/test/library-tests/TypeScript/TypeAnnotations/FunctionTypeParameters.expected +++ /dev/null @@ -1,4 +0,0 @@ -| tst.ts:88:20:88:44 | (param: ... number | 0 | 1 | tst.ts:88:21:88:25 | param | -| tst.ts:89:20:89:37 | (param: T) => T | 0 | 1 | tst.ts:89:24:89:28 | param | -| tst.ts:91:23:91:51 | new (pa ... Object | 0 | 1 | tst.ts:91:28:91:32 | param | -| tst.ts:92:23:92:49 | new ... Object | 0 | 1 | tst.ts:92:31:92:35 | param | diff --git a/javascript/ql/test/library-tests/TypeScript/TypeAnnotations/FunctionTypeParameters.ql b/javascript/ql/test/library-tests/TypeScript/TypeAnnotations/FunctionTypeParameters.ql deleted file mode 100644 index a996e0bfe949..000000000000 --- a/javascript/ql/test/library-tests/TypeScript/TypeAnnotations/FunctionTypeParameters.ql +++ /dev/null @@ -1,4 +0,0 @@ -import javascript - -from FunctionTypeExpr type, int n -select type, n, type.getNumParameter(), type.getParameter(n) diff --git a/javascript/ql/test/library-tests/TypeScript/TypeAnnotations/FunctionTypeParameters.qll b/javascript/ql/test/library-tests/TypeScript/TypeAnnotations/FunctionTypeParameters.qll new file mode 100644 index 000000000000..8703f32cfc32 --- /dev/null +++ b/javascript/ql/test/library-tests/TypeScript/TypeAnnotations/FunctionTypeParameters.qll @@ -0,0 +1,5 @@ +import javascript + +query predicate test_FunctionTypeParameters(FunctionTypeExpr type, int n, int res0, Parameter res1) { + res0 = type.getNumParameter() and res1 = type.getParameter(n) +} diff --git a/javascript/ql/test/library-tests/TypeScript/TypeAnnotations/FunctionTypeReturns.expected b/javascript/ql/test/library-tests/TypeScript/TypeAnnotations/FunctionTypeReturns.expected deleted file mode 100644 index c98b20857a85..000000000000 --- a/javascript/ql/test/library-tests/TypeScript/TypeAnnotations/FunctionTypeReturns.expected +++ /dev/null @@ -1,6 +0,0 @@ -| tst.ts:87:20:87:31 | () => number | tst.ts:87:26:87:31 | number | -| tst.ts:88:20:88:44 | (param: ... number | tst.ts:88:39:88:44 | number | -| tst.ts:89:20:89:37 | (param: T) => T | tst.ts:89:37:89:37 | T | -| tst.ts:90:23:90:38 | new () => Object | tst.ts:90:33:90:38 | Object | -| tst.ts:91:23:91:51 | new (pa ... Object | tst.ts:91:46:91:51 | Object | -| tst.ts:92:23:92:49 | new ... Object | tst.ts:92:44:92:49 | Object | diff --git a/javascript/ql/test/library-tests/TypeScript/TypeAnnotations/FunctionTypeReturns.ql b/javascript/ql/test/library-tests/TypeScript/TypeAnnotations/FunctionTypeReturns.ql deleted file mode 100644 index b0e3c1378239..000000000000 --- a/javascript/ql/test/library-tests/TypeScript/TypeAnnotations/FunctionTypeReturns.ql +++ /dev/null @@ -1,4 +0,0 @@ -import javascript - -from FunctionTypeExpr type -select type, type.getReturnTypeAnnotation() diff --git a/javascript/ql/test/library-tests/TypeScript/TypeAnnotations/FunctionTypeReturns.qll b/javascript/ql/test/library-tests/TypeScript/TypeAnnotations/FunctionTypeReturns.qll new file mode 100644 index 000000000000..2b67219a873b --- /dev/null +++ b/javascript/ql/test/library-tests/TypeScript/TypeAnnotations/FunctionTypeReturns.qll @@ -0,0 +1,5 @@ +import javascript + +query predicate test_FunctionTypeReturns(FunctionTypeExpr type, TypeExpr res) { + res = type.getReturnTypeAnnotation() +} diff --git a/javascript/ql/test/library-tests/TypeScript/TypeAnnotations/GenericTypeExpr.expected b/javascript/ql/test/library-tests/TypeScript/TypeAnnotations/GenericTypeExpr.expected deleted file mode 100644 index 31fdfc3a5804..000000000000 --- a/javascript/ql/test/library-tests/TypeScript/TypeAnnotations/GenericTypeExpr.expected +++ /dev/null @@ -1,11 +0,0 @@ -| tst.ts:65:18:65:32 | Generic | tst.ts:65:18:65:24 | Generic | 0 | 1 | tst.ts:65:26:65:31 | number | -| tst.ts:66:18:66:40 | N.Inner ... number> | tst.ts:66:18:66:32 | N.InnerGeneric1 | 0 | 1 | tst.ts:66:34:66:39 | number | -| tst.ts:67:18:67:42 | N.M.Inn ... number> | tst.ts:67:18:67:34 | N.M.InnerGeneric2 | 0 | 1 | tst.ts:67:36:67:41 | number | -| tst.ts:68:18:68:49 | Generic ... umber>> | tst.ts:68:18:68:24 | Generic | 0 | 1 | tst.ts:68:26:68:48 | N.Inner ... number> | -| tst.ts:68:26:68:48 | N.Inner ... number> | tst.ts:68:26:68:40 | N.InnerGeneric1 | 0 | 1 | tst.ts:68:42:68:47 | number | -| tst.ts:69:18:69:54 | ManyTyp ... oolean> | tst.ts:69:18:69:29 | ManyTypeArgs | 0 | 3 | tst.ts:69:31:69:36 | number | -| tst.ts:69:18:69:54 | ManyTyp ... oolean> | tst.ts:69:18:69:29 | ManyTypeArgs | 1 | 3 | tst.ts:69:39:69:44 | string | -| tst.ts:69:18:69:54 | ManyTyp ... oolean> | tst.ts:69:18:69:29 | ManyTypeArgs | 2 | 3 | tst.ts:69:47:69:53 | boolean | -| tst.ts:80:41:80:55 | Generic | tst.ts:80:41:80:47 | Generic | 0 | 1 | tst.ts:80:49:80:54 | Leaf[] | -| tst.ts:123:26:123:47 | import( ... string> | tst.ts:123:26:123:39 | import("type") | 0 | 1 | tst.ts:123:41:123:46 | string | -| tst.ts:125:35:125:65 | import( ... string> | tst.ts:125:55:125:57 | Foo | 0 | 1 | tst.ts:125:59:125:64 | string | diff --git a/javascript/ql/test/library-tests/TypeScript/TypeAnnotations/GenericTypeExpr.ql b/javascript/ql/test/library-tests/TypeScript/TypeAnnotations/GenericTypeExpr.ql deleted file mode 100644 index 0a7eda33e62b..000000000000 --- a/javascript/ql/test/library-tests/TypeScript/TypeAnnotations/GenericTypeExpr.ql +++ /dev/null @@ -1,4 +0,0 @@ -import javascript - -from GenericTypeExpr type, int n -select type, type.getTypeAccess(), n, type.getNumTypeArgument(), type.getTypeArgument(n) diff --git a/javascript/ql/test/library-tests/TypeScript/TypeAnnotations/GenericTypeExpr.qll b/javascript/ql/test/library-tests/TypeScript/TypeAnnotations/GenericTypeExpr.qll new file mode 100644 index 000000000000..c7647d65f6aa --- /dev/null +++ b/javascript/ql/test/library-tests/TypeScript/TypeAnnotations/GenericTypeExpr.qll @@ -0,0 +1,9 @@ +import javascript + +query predicate test_GenericTypeExpr( + GenericTypeExpr type, TypeAccess res0, int n, int res1, TypeExpr res2 +) { + res0 = type.getTypeAccess() and + res1 = type.getNumTypeArgument() and + res2 = type.getTypeArgument(n) +} diff --git a/javascript/ql/test/library-tests/TypeScript/TypeAnnotations/ImportTypeExpr.expected b/javascript/ql/test/library-tests/TypeScript/TypeAnnotations/ImportTypeExpr.expected deleted file mode 100644 index dd96b0bcfb7b..000000000000 --- a/javascript/ql/test/library-tests/TypeScript/TypeAnnotations/ImportTypeExpr.expected +++ /dev/null @@ -1,7 +0,0 @@ -| tst.ts:122:19:122:32 | import("type") | type | type | -| tst.ts:123:26:123:39 | import("type") | type | type | -| tst.ts:124:28:124:46 | import("namespace") | namespace | namespace | -| tst.ts:125:35:125:53 | import("namespace") | namespace | namespace | -| tst.ts:126:28:126:42 | import("value") | value | value | -| tst.ts:127:37:127:51 | import("value") | value | value | -| tst.ts:128:38:130:3 | import( ... ce'\\n ) | awkard-namespace | namespace | diff --git a/javascript/ql/test/library-tests/TypeScript/TypeAnnotations/ImportTypeExpr.ql b/javascript/ql/test/library-tests/TypeScript/TypeAnnotations/ImportTypeExpr.ql deleted file mode 100644 index 28a7b196a71f..000000000000 --- a/javascript/ql/test/library-tests/TypeScript/TypeAnnotations/ImportTypeExpr.ql +++ /dev/null @@ -1,13 +0,0 @@ -import javascript - -string getKind(ImportTypeExpr imprt) { - if imprt.isTypeAccess() - then result = "type" - else - if imprt.isNamespaceAccess() - then result = "namespace" - else result = "value" -} - -from ImportTypeExpr imprt -select imprt, imprt.getPath(), getKind(imprt) diff --git a/javascript/ql/test/library-tests/TypeScript/TypeAnnotations/ImportTypeExpr.qll b/javascript/ql/test/library-tests/TypeScript/TypeAnnotations/ImportTypeExpr.qll new file mode 100644 index 000000000000..8b3f4d323ae1 --- /dev/null +++ b/javascript/ql/test/library-tests/TypeScript/TypeAnnotations/ImportTypeExpr.qll @@ -0,0 +1,14 @@ +import javascript + +string getKind(ImportTypeExpr imprt) { + if imprt.isTypeAccess() + then result = "type" + else + if imprt.isNamespaceAccess() + then result = "namespace" + else result = "value" +} + +query predicate test_ImportTypeExpr(ImportTypeExpr imprt, string res0, string res1) { + res0 = imprt.getPath() and res1 = getKind(imprt) +} diff --git a/javascript/ql/test/library-tests/TypeScript/TypeAnnotations/IndexedAccessTypeExpr.expected b/javascript/ql/test/library-tests/TypeScript/TypeAnnotations/IndexedAccessTypeExpr.expected deleted file mode 100644 index 5c00b36b5df5..000000000000 --- a/javascript/ql/test/library-tests/TypeScript/TypeAnnotations/IndexedAccessTypeExpr.expected +++ /dev/null @@ -1 +0,0 @@ -| tst.ts:42:18:42:41 | Interfa ... Field'] | tst.ts:42:18:42:26 | Interface | tst.ts:42:28:42:40 | 'numberField' | diff --git a/javascript/ql/test/library-tests/TypeScript/TypeAnnotations/IndexedAccessTypeExpr.ql b/javascript/ql/test/library-tests/TypeScript/TypeAnnotations/IndexedAccessTypeExpr.ql deleted file mode 100644 index 58a1953e8ec3..000000000000 --- a/javascript/ql/test/library-tests/TypeScript/TypeAnnotations/IndexedAccessTypeExpr.ql +++ /dev/null @@ -1,4 +0,0 @@ -import javascript - -from IndexedAccessTypeExpr type -select type, type.getObjectType(), type.getIndexType() diff --git a/javascript/ql/test/library-tests/TypeScript/TypeAnnotations/IndexedAccessTypeExpr.qll b/javascript/ql/test/library-tests/TypeScript/TypeAnnotations/IndexedAccessTypeExpr.qll new file mode 100644 index 000000000000..ad28d8de3450 --- /dev/null +++ b/javascript/ql/test/library-tests/TypeScript/TypeAnnotations/IndexedAccessTypeExpr.qll @@ -0,0 +1,5 @@ +import javascript + +query predicate test_IndexedAccessTypeExpr(IndexedAccessTypeExpr type, TypeExpr res0, TypeExpr res1) { + res0 = type.getObjectType() and res1 = type.getIndexType() +} diff --git a/javascript/ql/test/library-tests/TypeScript/TypeAnnotations/InterfaceTypeExpr.expected b/javascript/ql/test/library-tests/TypeScript/TypeAnnotations/InterfaceTypeExpr.expected deleted file mode 100644 index 46dbe4c0e48b..000000000000 --- a/javascript/ql/test/library-tests/TypeScript/TypeAnnotations/InterfaceTypeExpr.expected +++ /dev/null @@ -1,3 +0,0 @@ -| tst.ts:83:19:83:43 | { x: nu ... mber; } | tst.ts:83:21:83:30 | x: number; | -| tst.ts:83:19:83:43 | { x: nu ... mber; } | tst.ts:83:32:83:41 | y: number; | -| tst.ts:85:25:85:42 | { foo(): number; } | tst.ts:85:27:85:40 | foo(): number; | diff --git a/javascript/ql/test/library-tests/TypeScript/TypeAnnotations/InterfaceTypeExpr.ql b/javascript/ql/test/library-tests/TypeScript/TypeAnnotations/InterfaceTypeExpr.ql deleted file mode 100644 index 099c6b3b9530..000000000000 --- a/javascript/ql/test/library-tests/TypeScript/TypeAnnotations/InterfaceTypeExpr.ql +++ /dev/null @@ -1,4 +0,0 @@ -import javascript - -from InterfaceTypeExpr type -select type, type.getAMember() diff --git a/javascript/ql/test/library-tests/TypeScript/TypeAnnotations/InterfaceTypeExpr.qll b/javascript/ql/test/library-tests/TypeScript/TypeAnnotations/InterfaceTypeExpr.qll new file mode 100644 index 000000000000..5188e52457fb --- /dev/null +++ b/javascript/ql/test/library-tests/TypeScript/TypeAnnotations/InterfaceTypeExpr.qll @@ -0,0 +1,5 @@ +import javascript + +query predicate test_InterfaceTypeExpr(InterfaceTypeExpr type, MemberDeclaration res) { + res = type.getAMember() +} diff --git a/javascript/ql/test/library-tests/TypeScript/TypeAnnotations/IntersectionTypeExpr.expected b/javascript/ql/test/library-tests/TypeScript/TypeAnnotations/IntersectionTypeExpr.expected deleted file mode 100644 index 62e6db645731..000000000000 --- a/javascript/ql/test/library-tests/TypeScript/TypeAnnotations/IntersectionTypeExpr.expected +++ /dev/null @@ -1,5 +0,0 @@ -| tst.ts:43:23:43:43 | string& ... boolean | 0 | 3 | tst.ts:43:23:43:28 | string | -| tst.ts:43:23:43:43 | string& ... boolean | 1 | 3 | tst.ts:43:30:43:35 | number | -| tst.ts:43:23:43:43 | string& ... boolean | 2 | 3 | tst.ts:43:37:43:43 | boolean | -| tst.ts:47:18:47:55 | (string ... string) | 0 | 2 | tst.ts:47:18:47:34 | (string \| number) | -| tst.ts:47:18:47:55 | (string ... string) | 1 | 2 | tst.ts:47:38:47:55 | (boolean \| string) | diff --git a/javascript/ql/test/library-tests/TypeScript/TypeAnnotations/IntersectionTypeExpr.ql b/javascript/ql/test/library-tests/TypeScript/TypeAnnotations/IntersectionTypeExpr.ql deleted file mode 100644 index 66021fc1d798..000000000000 --- a/javascript/ql/test/library-tests/TypeScript/TypeAnnotations/IntersectionTypeExpr.ql +++ /dev/null @@ -1,4 +0,0 @@ -import javascript - -from IntersectionTypeExpr type, int n -select type, n, type.getNumElementType(), type.getElementType(n) diff --git a/javascript/ql/test/library-tests/TypeScript/TypeAnnotations/IntersectionTypeExpr.qll b/javascript/ql/test/library-tests/TypeScript/TypeAnnotations/IntersectionTypeExpr.qll new file mode 100644 index 000000000000..b8d169996e25 --- /dev/null +++ b/javascript/ql/test/library-tests/TypeScript/TypeAnnotations/IntersectionTypeExpr.qll @@ -0,0 +1,5 @@ +import javascript + +query predicate test_IntersectionTypeExpr(IntersectionTypeExpr type, int n, int res0, TypeExpr res1) { + res0 = type.getNumElementType() and res1 = type.getElementType(n) +} diff --git a/javascript/ql/test/library-tests/TypeScript/TypeAnnotations/IsTypeExpr.expected b/javascript/ql/test/library-tests/TypeScript/TypeAnnotations/IsTypeExpr.expected deleted file mode 100644 index d23a4247ba27..000000000000 --- a/javascript/ql/test/library-tests/TypeScript/TypeAnnotations/IsTypeExpr.expected +++ /dev/null @@ -1,4 +0,0 @@ -| tst.ts:75:17:75:28 | this is Leaf | tst.ts:75:17:75:20 | this | tst.ts:75:25:75:28 | Leaf | -| tst.ts:76:21:76:32 | that is Leaf | tst.ts:76:21:76:24 | that | tst.ts:76:29:76:32 | Leaf | -| tst.ts:80:36:80:55 | x is Generic | tst.ts:80:36:80:36 | x | tst.ts:80:41:80:55 | Generic | -| tst.ts:81:38:81:50 | x is typeof x | tst.ts:81:38:81:38 | x | tst.ts:81:43:81:50 | typeof x | diff --git a/javascript/ql/test/library-tests/TypeScript/TypeAnnotations/IsTypeExpr.ql b/javascript/ql/test/library-tests/TypeScript/TypeAnnotations/IsTypeExpr.ql deleted file mode 100644 index 4ab8c71571bf..000000000000 --- a/javascript/ql/test/library-tests/TypeScript/TypeAnnotations/IsTypeExpr.ql +++ /dev/null @@ -1,4 +0,0 @@ -import javascript - -from IsTypeExpr type -select type, type.getParameterName(), type.getPredicateType() diff --git a/javascript/ql/test/library-tests/TypeScript/TypeAnnotations/IsTypeExpr.qll b/javascript/ql/test/library-tests/TypeScript/TypeAnnotations/IsTypeExpr.qll new file mode 100644 index 000000000000..a0ff44c2bddd --- /dev/null +++ b/javascript/ql/test/library-tests/TypeScript/TypeAnnotations/IsTypeExpr.qll @@ -0,0 +1,5 @@ +import javascript + +query predicate test_IsTypeExpr(IsTypeExpr type, VarTypeAccess res0, TypeExpr res1) { + res0 = type.getParameterName() and res1 = type.getPredicateType() +} diff --git a/javascript/ql/test/library-tests/TypeScript/TypeAnnotations/KeyofTypeExpr.expected b/javascript/ql/test/library-tests/TypeScript/TypeAnnotations/KeyofTypeExpr.expected deleted file mode 100644 index b8e31fe56a8b..000000000000 --- a/javascript/ql/test/library-tests/TypeScript/TypeAnnotations/KeyofTypeExpr.expected +++ /dev/null @@ -1,2 +0,0 @@ -| tst.ts:49:16:49:30 | keyof Interface | tst.ts:49:22:49:30 | Interface | -| tst.ts:113:26:113:35 | keyof Node | tst.ts:113:32:113:35 | Node | diff --git a/javascript/ql/test/library-tests/TypeScript/TypeAnnotations/KeyofTypeExpr.ql b/javascript/ql/test/library-tests/TypeScript/TypeAnnotations/KeyofTypeExpr.ql deleted file mode 100644 index 6d91aed2ee35..000000000000 --- a/javascript/ql/test/library-tests/TypeScript/TypeAnnotations/KeyofTypeExpr.ql +++ /dev/null @@ -1,4 +0,0 @@ -import javascript - -from KeyofTypeExpr type -select type, type.getElementType() diff --git a/javascript/ql/test/library-tests/TypeScript/TypeAnnotations/KeyofTypeExpr.qll b/javascript/ql/test/library-tests/TypeScript/TypeAnnotations/KeyofTypeExpr.qll new file mode 100644 index 000000000000..8cc531d799b0 --- /dev/null +++ b/javascript/ql/test/library-tests/TypeScript/TypeAnnotations/KeyofTypeExpr.qll @@ -0,0 +1,3 @@ +import javascript + +query predicate test_KeyofTypeExpr(KeyofTypeExpr type, TypeExpr res) { res = type.getElementType() } diff --git a/javascript/ql/test/library-tests/TypeScript/TypeAnnotations/MappedTypeExpr.expected b/javascript/ql/test/library-tests/TypeScript/TypeAnnotations/MappedTypeExpr.expected deleted file mode 100644 index 39a82b4f07d0..000000000000 --- a/javascript/ql/test/library-tests/TypeScript/TypeAnnotations/MappedTypeExpr.expected +++ /dev/null @@ -1,2 +0,0 @@ -| tst.ts:113:18:113:46 | { [K in ... umber } | tst.ts:113:21:113:35 | K in keyof Node | tst.ts:113:21:113:21 | K | tst.ts:113:26:113:35 | keyof Node | tst.ts:113:39:113:44 | number | -| tst.ts:114:18:114:41 | { [K in ... umber } | tst.ts:114:21:114:30 | K in "foo" | tst.ts:114:21:114:21 | K | tst.ts:114:26:114:30 | "foo" | tst.ts:114:34:114:39 | number | diff --git a/javascript/ql/test/library-tests/TypeScript/TypeAnnotations/MappedTypeExpr.ql b/javascript/ql/test/library-tests/TypeScript/TypeAnnotations/MappedTypeExpr.ql deleted file mode 100644 index 02b58d329a88..000000000000 --- a/javascript/ql/test/library-tests/TypeScript/TypeAnnotations/MappedTypeExpr.ql +++ /dev/null @@ -1,5 +0,0 @@ -import javascript - -from MappedTypeExpr type -select type, type.getTypeParameter(), type.getTypeParameter().getIdentifier(), - type.getTypeParameter().getBound(), type.getElementType() diff --git a/javascript/ql/test/library-tests/TypeScript/TypeAnnotations/MappedTypeExpr.qll b/javascript/ql/test/library-tests/TypeScript/TypeAnnotations/MappedTypeExpr.qll new file mode 100644 index 000000000000..a6e60610a664 --- /dev/null +++ b/javascript/ql/test/library-tests/TypeScript/TypeAnnotations/MappedTypeExpr.qll @@ -0,0 +1,10 @@ +import javascript + +query predicate test_MappedTypeExpr( + MappedTypeExpr type, TypeParameter res0, Identifier res1, TypeExpr res2, TypeExpr res3 +) { + res0 = type.getTypeParameter() and + res1 = type.getTypeParameter().getIdentifier() and + res2 = type.getTypeParameter().getBound() and + res3 = type.getElementType() +} diff --git a/javascript/ql/test/library-tests/TypeScript/TypeAnnotations/OptionalTypeExpr.expected b/javascript/ql/test/library-tests/TypeScript/TypeAnnotations/OptionalTypeExpr.expected deleted file mode 100644 index f1fbc75409f6..000000000000 --- a/javascript/ql/test/library-tests/TypeScript/TypeAnnotations/OptionalTypeExpr.expected +++ /dev/null @@ -1,2 +0,0 @@ -| tst.ts:133:48:133:54 | number? | tst.ts:133:48:133:53 | number | -| tst.ts:136:48:136:54 | string? | tst.ts:136:48:136:53 | string | diff --git a/javascript/ql/test/library-tests/TypeScript/TypeAnnotations/OptionalTypeExpr.ql b/javascript/ql/test/library-tests/TypeScript/TypeAnnotations/OptionalTypeExpr.ql deleted file mode 100644 index 641fb7b8729e..000000000000 --- a/javascript/ql/test/library-tests/TypeScript/TypeAnnotations/OptionalTypeExpr.ql +++ /dev/null @@ -1,4 +0,0 @@ -import javascript - -from OptionalTypeExpr type -select type, type.getElementType() diff --git a/javascript/ql/test/library-tests/TypeScript/TypeAnnotations/OptionalTypeExpr.qll b/javascript/ql/test/library-tests/TypeScript/TypeAnnotations/OptionalTypeExpr.qll new file mode 100644 index 000000000000..abb4c83f5d3b --- /dev/null +++ b/javascript/ql/test/library-tests/TypeScript/TypeAnnotations/OptionalTypeExpr.qll @@ -0,0 +1,5 @@ +import javascript + +query predicate test_OptionalTypeExpr(OptionalTypeExpr type, TypeExpr res) { + res = type.getElementType() +} diff --git a/javascript/ql/test/library-tests/TypeScript/TypeAnnotations/Parameters.expected b/javascript/ql/test/library-tests/TypeScript/TypeAnnotations/Parameters.expected deleted file mode 100644 index a7e7df73b569..000000000000 --- a/javascript/ql/test/library-tests/TypeScript/TypeAnnotations/Parameters.expected +++ /dev/null @@ -1,2 +0,0 @@ -| tst.ts:36:27:36:32 | param1 | tst.ts:36:44:36:44 | 1 | tst.ts:36:35:36:40 | number | -| tst.ts:36:47:36:52 | param2 | tst.ts:36:64:36:66 | '2' | tst.ts:36:55:36:60 | string | diff --git a/javascript/ql/test/library-tests/TypeScript/TypeAnnotations/Parameters.ql b/javascript/ql/test/library-tests/TypeScript/TypeAnnotations/Parameters.ql deleted file mode 100644 index a5efb9624ccf..000000000000 --- a/javascript/ql/test/library-tests/TypeScript/TypeAnnotations/Parameters.ql +++ /dev/null @@ -1,4 +0,0 @@ -import javascript - -from Parameter p -select p, p.getDefault(), p.getTypeAnnotation() diff --git a/javascript/ql/test/library-tests/TypeScript/TypeAnnotations/Parameters.qll b/javascript/ql/test/library-tests/TypeScript/TypeAnnotations/Parameters.qll new file mode 100644 index 000000000000..7710522cd606 --- /dev/null +++ b/javascript/ql/test/library-tests/TypeScript/TypeAnnotations/Parameters.qll @@ -0,0 +1,5 @@ +import javascript + +query predicate test_Parameters(Parameter p, Expr res0, TypeExpr res1) { + res0 = p.getDefault() and res1 = p.getTypeAnnotation() +} diff --git a/javascript/ql/test/library-tests/TypeScript/TypeAnnotations/ParenthesizedTypeExpr.expected b/javascript/ql/test/library-tests/TypeScript/TypeAnnotations/ParenthesizedTypeExpr.expected deleted file mode 100644 index bb51caefc03f..000000000000 --- a/javascript/ql/test/library-tests/TypeScript/TypeAnnotations/ParenthesizedTypeExpr.expected +++ /dev/null @@ -1,8 +0,0 @@ -| tst.ts:44:24:44:31 | (string) | tst.ts:44:25:44:30 | string | tst.ts:44:25:44:30 | string | -| tst.ts:45:25:45:34 | ((string)) | tst.ts:45:26:45:33 | (string) | tst.ts:45:27:45:32 | string | -| tst.ts:45:26:45:33 | (string) | tst.ts:45:27:45:32 | string | tst.ts:45:27:45:32 | string | -| tst.ts:46:25:46:36 | (((string))) | tst.ts:46:26:46:35 | ((string)) | tst.ts:46:28:46:33 | string | -| tst.ts:46:26:46:35 | ((string)) | tst.ts:46:27:46:34 | (string) | tst.ts:46:28:46:33 | string | -| tst.ts:46:27:46:34 | (string) | tst.ts:46:28:46:33 | string | tst.ts:46:28:46:33 | string | -| tst.ts:47:18:47:34 | (string \| number) | tst.ts:47:19:47:33 | string \| number | tst.ts:47:19:47:33 | string \| number | -| tst.ts:47:38:47:55 | (boolean \| string) | tst.ts:47:39:47:54 | boolean \| string | tst.ts:47:39:47:54 | boolean \| string | diff --git a/javascript/ql/test/library-tests/TypeScript/TypeAnnotations/ParenthesizedTypeExpr.ql b/javascript/ql/test/library-tests/TypeScript/TypeAnnotations/ParenthesizedTypeExpr.ql deleted file mode 100644 index d76ba7608565..000000000000 --- a/javascript/ql/test/library-tests/TypeScript/TypeAnnotations/ParenthesizedTypeExpr.ql +++ /dev/null @@ -1,4 +0,0 @@ -import javascript - -from ParenthesizedTypeExpr type -select type, type.getElementType(), type.stripParens() diff --git a/javascript/ql/test/library-tests/TypeScript/TypeAnnotations/ParenthesizedTypeExpr.qll b/javascript/ql/test/library-tests/TypeScript/TypeAnnotations/ParenthesizedTypeExpr.qll new file mode 100644 index 000000000000..dd056157cb12 --- /dev/null +++ b/javascript/ql/test/library-tests/TypeScript/TypeAnnotations/ParenthesizedTypeExpr.qll @@ -0,0 +1,5 @@ +import javascript + +query predicate test_ParenthesizedTypeExpr(ParenthesizedTypeExpr type, TypeExpr res0, TypeExpr res1) { + res0 = type.getElementType() and res1 = type.stripParens() +} diff --git a/javascript/ql/test/library-tests/TypeScript/TypeAnnotations/QualifiedTypeAccess.expected b/javascript/ql/test/library-tests/TypeScript/TypeAnnotations/QualifiedTypeAccess.expected deleted file mode 100644 index 6459942c9d66..000000000000 --- a/javascript/ql/test/library-tests/TypeScript/TypeAnnotations/QualifiedTypeAccess.expected +++ /dev/null @@ -1,8 +0,0 @@ -| tst.ts:63:19:63:21 | N.I | tst.ts:63:19:63:19 | N | tst.ts:63:21:63:21 | I | -| tst.ts:64:20:64:24 | N.M.I | tst.ts:64:20:64:22 | N.M | tst.ts:64:24:64:24 | I | -| tst.ts:66:18:66:32 | N.InnerGeneric1 | tst.ts:66:18:66:18 | N | tst.ts:66:20:66:32 | InnerGeneric1 | -| tst.ts:67:18:67:34 | N.M.InnerGeneric2 | tst.ts:67:18:67:20 | N.M | tst.ts:67:22:67:34 | InnerGeneric2 | -| tst.ts:68:26:68:40 | N.InnerGeneric1 | tst.ts:68:26:68:26 | N | tst.ts:68:28:68:40 | InnerGeneric1 | -| tst.ts:124:48:124:50 | Foo | tst.ts:124:28:124:46 | import("namespace") | tst.ts:124:48:124:50 | Foo | -| tst.ts:125:55:125:57 | Foo | tst.ts:125:35:125:53 | import("namespace") | tst.ts:125:55:125:57 | Foo | -| tst.ts:131:4:131:6 | bar | tst.ts:128:38:130:3 | import( ... ce'\\n ) | tst.ts:131:4:131:6 | bar | diff --git a/javascript/ql/test/library-tests/TypeScript/TypeAnnotations/QualifiedTypeAccess.ql b/javascript/ql/test/library-tests/TypeScript/TypeAnnotations/QualifiedTypeAccess.ql deleted file mode 100644 index fd56582465db..000000000000 --- a/javascript/ql/test/library-tests/TypeScript/TypeAnnotations/QualifiedTypeAccess.ql +++ /dev/null @@ -1,4 +0,0 @@ -import javascript - -from QualifiedTypeAccess type -select type, type.getQualifier(), type.getIdentifier() diff --git a/javascript/ql/test/library-tests/TypeScript/TypeAnnotations/QualifiedTypeAccess.qll b/javascript/ql/test/library-tests/TypeScript/TypeAnnotations/QualifiedTypeAccess.qll new file mode 100644 index 000000000000..d81ea14d7252 --- /dev/null +++ b/javascript/ql/test/library-tests/TypeScript/TypeAnnotations/QualifiedTypeAccess.qll @@ -0,0 +1,7 @@ +import javascript + +query predicate test_QualifiedTypeAccess( + QualifiedTypeAccess type, NamespaceAccess res0, Identifier res1 +) { + res0 = type.getQualifier() and res1 = type.getIdentifier() +} diff --git a/javascript/ql/test/library-tests/TypeScript/TypeAnnotations/RestTypeExpr.expected b/javascript/ql/test/library-tests/TypeScript/TypeAnnotations/RestTypeExpr.expected deleted file mode 100644 index 1d6e759e0d2d..000000000000 --- a/javascript/ql/test/library-tests/TypeScript/TypeAnnotations/RestTypeExpr.expected +++ /dev/null @@ -1,2 +0,0 @@ -| tst.ts:135:36:135:46 | ...string[] | tst.ts:135:39:135:46 | string[] | tst.ts:135:39:135:44 | string | -| tst.ts:136:57:136:67 | ...number[] | tst.ts:136:60:136:67 | number[] | tst.ts:136:60:136:65 | number | diff --git a/javascript/ql/test/library-tests/TypeScript/TypeAnnotations/RestTypeExpr.ql b/javascript/ql/test/library-tests/TypeScript/TypeAnnotations/RestTypeExpr.ql deleted file mode 100644 index c77bed8c6881..000000000000 --- a/javascript/ql/test/library-tests/TypeScript/TypeAnnotations/RestTypeExpr.ql +++ /dev/null @@ -1,4 +0,0 @@ -import javascript - -from RestTypeExpr rest -select rest, rest.getArrayType(), rest.getElementType() diff --git a/javascript/ql/test/library-tests/TypeScript/TypeAnnotations/RestTypeExpr.qll b/javascript/ql/test/library-tests/TypeScript/TypeAnnotations/RestTypeExpr.qll new file mode 100644 index 000000000000..b3b7c4257cd5 --- /dev/null +++ b/javascript/ql/test/library-tests/TypeScript/TypeAnnotations/RestTypeExpr.qll @@ -0,0 +1,5 @@ +import javascript + +query predicate test_RestTypeExpr(RestTypeExpr rest, TypeExpr res0, TypeExpr res1) { + res0 = rest.getArrayType() and res1 = rest.getElementType() +} diff --git a/javascript/ql/test/library-tests/TypeScript/TypeAnnotations/ReturnTypes.expected b/javascript/ql/test/library-tests/TypeScript/TypeAnnotations/ReturnTypes.expected deleted file mode 100644 index e0dc801030e4..000000000000 --- a/javascript/ql/test/library-tests/TypeScript/TypeAnnotations/ReturnTypes.expected +++ /dev/null @@ -1,21 +0,0 @@ -| tst.ts:20:3:20:31 | returnN ... number; | method returnNumberMethod of interface Interface | tst.ts:20:25:20:30 | number | -| tst.ts:21:3:21:27 | returnV ... : void; | method returnVoidMethod of interface Interface | tst.ts:21:23:21:26 | void | -| tst.ts:22:3:22:27 | returnN ... : null; | method returnNullMethod of interface Interface | tst.ts:22:23:22:26 | null | -| tst.ts:23:3:23:27 | returnT ... : this; | method returnThisMethod of interface Interface | tst.ts:23:23:23:26 | this | -| tst.ts:30:1:30:53 | functio ... rn 0; } | function returnNumberFunction | tst.ts:30:34:30:39 | number | -| tst.ts:31:1:31:49 | functio ... rn 0; } | function returnVoidFunction | tst.ts:31:32:31:35 | void | -| tst.ts:32:1:32:49 | functio ... rn 0; } | function returnNullFunction | tst.ts:32:32:32:35 | null | -| tst.ts:75:3:75:29 | isThisL ... s Leaf; | method isThisLeaf of interface Node | tst.ts:75:17:75:28 | this is Leaf | -| tst.ts:76:3:76:33 | isThatL ... s Leaf; | method isThatLeaf of interface Node | tst.ts:76:21:76:32 | that is Leaf | -| tst.ts:80:1:80:73 | functio ... alse; } | function complexIsType | tst.ts:80:36:80:55 | x is Generic | -| tst.ts:81:1:81:66 | functio ... true } | function obviousIsType | tst.ts:81:38:81:50 | x is typeof x | -| tst.ts:85:27:85:40 | foo(): number; | method foo of anonymous interface | tst.ts:85:34:85:39 | number | -| tst.ts:87:20:87:31 | () => number | anonymous function type | tst.ts:87:26:87:31 | number | -| tst.ts:88:20:88:44 | (param: ... number | anonymous function type | tst.ts:88:39:88:44 | number | -| tst.ts:89:20:89:37 | (param: T) => T | anonymous function type | tst.ts:89:37:89:37 | T | -| tst.ts:90:23:90:38 | new () => Object | anonymous function type | tst.ts:90:33:90:38 | Object | -| tst.ts:91:23:91:51 | new (pa ... Object | anonymous function type | tst.ts:91:46:91:51 | Object | -| tst.ts:92:23:92:49 | new ... Object | anonymous function type | tst.ts:92:44:92:49 | Object | -| tst.ts:94:1:94:37 | functio ... rn x; } | function f1 | tst.ts:94:23:94:23 | S | -| tst.ts:95:1:95:53 | functio ... x,y]; } | function f2 | tst.ts:95:31:95:35 | [S,T] | -| tst.ts:96:1:96:52 | functio ... rn x; } | function f3 | tst.ts:96:38:96:38 | S | diff --git a/javascript/ql/test/library-tests/TypeScript/TypeAnnotations/ReturnTypes.ql b/javascript/ql/test/library-tests/TypeScript/TypeAnnotations/ReturnTypes.ql deleted file mode 100644 index 2d1cd4080942..000000000000 --- a/javascript/ql/test/library-tests/TypeScript/TypeAnnotations/ReturnTypes.ql +++ /dev/null @@ -1,4 +0,0 @@ -import javascript - -from Function function -select function, function.describe(), function.getReturnTypeAnnotation() diff --git a/javascript/ql/test/library-tests/TypeScript/TypeAnnotations/ReturnTypes.qll b/javascript/ql/test/library-tests/TypeScript/TypeAnnotations/ReturnTypes.qll new file mode 100644 index 000000000000..a89a809445f4 --- /dev/null +++ b/javascript/ql/test/library-tests/TypeScript/TypeAnnotations/ReturnTypes.qll @@ -0,0 +1,5 @@ +import javascript + +query predicate test_ReturnTypes(Function function, string res0, TypeExpr res1) { + res0 = function.describe() and res1 = function.getReturnTypeAnnotation() +} diff --git a/javascript/ql/test/library-tests/TypeScript/TypeAnnotations/ThisParameterTypes.expected b/javascript/ql/test/library-tests/TypeScript/TypeAnnotations/ThisParameterTypes.expected deleted file mode 100644 index e9f63ff08d58..000000000000 --- a/javascript/ql/test/library-tests/TypeScript/TypeAnnotations/ThisParameterTypes.expected +++ /dev/null @@ -1 +0,0 @@ -| function hasThisParam | tst.ts:116:29:116:32 | void | diff --git a/javascript/ql/test/library-tests/TypeScript/TypeAnnotations/ThisParameterTypes.ql b/javascript/ql/test/library-tests/TypeScript/TypeAnnotations/ThisParameterTypes.ql deleted file mode 100644 index 3e3d05d37860..000000000000 --- a/javascript/ql/test/library-tests/TypeScript/TypeAnnotations/ThisParameterTypes.ql +++ /dev/null @@ -1,4 +0,0 @@ -import javascript - -from Function function -select function.describe(), function.getThisTypeAnnotation() diff --git a/javascript/ql/test/library-tests/TypeScript/TypeAnnotations/ThisParameterTypes.qll b/javascript/ql/test/library-tests/TypeScript/TypeAnnotations/ThisParameterTypes.qll new file mode 100644 index 000000000000..a275f357ac1b --- /dev/null +++ b/javascript/ql/test/library-tests/TypeScript/TypeAnnotations/ThisParameterTypes.qll @@ -0,0 +1,5 @@ +import javascript + +query predicate test_ThisParameterTypes(string res0, TypeExpr res1) { + exists(Function function | res0 = function.describe() and res1 = function.getThisTypeAnnotation()) +} diff --git a/javascript/ql/test/library-tests/TypeScript/TypeAnnotations/TupleTypeExpr.expected b/javascript/ql/test/library-tests/TypeScript/TypeAnnotations/TupleTypeExpr.expected deleted file mode 100644 index 6c4d47bea6bd..000000000000 --- a/javascript/ql/test/library-tests/TypeScript/TypeAnnotations/TupleTypeExpr.expected +++ /dev/null @@ -1,13 +0,0 @@ -| tst.ts:48:16:48:40 | [number ... oolean] | 0 | 3 | tst.ts:48:17:48:22 | number | -| tst.ts:48:16:48:40 | [number ... oolean] | 1 | 3 | tst.ts:48:25:48:30 | string | -| tst.ts:48:16:48:40 | [number ... oolean] | 2 | 3 | tst.ts:48:33:48:39 | boolean | -| tst.ts:95:31:95:35 | [S,T] | 0 | 2 | tst.ts:95:32:95:32 | S | -| tst.ts:95:31:95:35 | [S,T] | 1 | 2 | tst.ts:95:34:95:34 | T | -| tst.ts:133:31:133:55 | [number ... umber?] | 0 | 3 | tst.ts:133:32:133:37 | number | -| tst.ts:133:31:133:55 | [number ... umber?] | 1 | 3 | tst.ts:133:40:133:45 | string | -| tst.ts:133:31:133:55 | [number ... umber?] | 2 | 3 | tst.ts:133:48:133:54 | number? | -| tst.ts:135:27:135:47 | [number ... ring[]] | 0 | 2 | tst.ts:135:28:135:33 | number | -| tst.ts:135:27:135:47 | [number ... ring[]] | 1 | 2 | tst.ts:135:36:135:46 | ...string[] | -| tst.ts:136:39:136:68 | [number ... mber[]] | 0 | 3 | tst.ts:136:40:136:45 | number | -| tst.ts:136:39:136:68 | [number ... mber[]] | 1 | 3 | tst.ts:136:48:136:54 | string? | -| tst.ts:136:39:136:68 | [number ... mber[]] | 2 | 3 | tst.ts:136:57:136:67 | ...number[] | diff --git a/javascript/ql/test/library-tests/TypeScript/TypeAnnotations/TupleTypeExpr.ql b/javascript/ql/test/library-tests/TypeScript/TypeAnnotations/TupleTypeExpr.ql deleted file mode 100644 index 3db99c3d10c5..000000000000 --- a/javascript/ql/test/library-tests/TypeScript/TypeAnnotations/TupleTypeExpr.ql +++ /dev/null @@ -1,4 +0,0 @@ -import javascript - -from TupleTypeExpr type, int n -select type, n, type.getNumElementType(), type.getElementType(n) diff --git a/javascript/ql/test/library-tests/TypeScript/TypeAnnotations/TupleTypeExpr.qll b/javascript/ql/test/library-tests/TypeScript/TypeAnnotations/TupleTypeExpr.qll new file mode 100644 index 000000000000..b8cbe0ab2e32 --- /dev/null +++ b/javascript/ql/test/library-tests/TypeScript/TypeAnnotations/TupleTypeExpr.qll @@ -0,0 +1,5 @@ +import javascript + +query predicate test_TupleTypeExpr(TupleTypeExpr type, int n, int res0, TypeExpr res1) { + res0 = type.getNumElementType() and res1 = type.getElementType(n) +} diff --git a/javascript/ql/test/library-tests/TypeScript/TypeAnnotations/TypeAccessHelpers.expected b/javascript/ql/test/library-tests/TypeScript/TypeAnnotations/TypeAccessHelpers.expected deleted file mode 100644 index 949150a4a533..000000000000 --- a/javascript/ql/test/library-tests/TypeScript/TypeAnnotations/TypeAccessHelpers.expected +++ /dev/null @@ -1,11 +0,0 @@ -| tst.ts:65:18:65:24 | Generic | 1 | 0 | tst.ts:65:26:65:31 | number | -| tst.ts:66:18:66:32 | N.InnerGeneric1 | 1 | 0 | tst.ts:66:34:66:39 | number | -| tst.ts:67:18:67:34 | N.M.InnerGeneric2 | 1 | 0 | tst.ts:67:36:67:41 | number | -| tst.ts:68:18:68:24 | Generic | 1 | 0 | tst.ts:68:26:68:48 | N.Inner ... number> | -| tst.ts:68:26:68:40 | N.InnerGeneric1 | 1 | 0 | tst.ts:68:42:68:47 | number | -| tst.ts:69:18:69:29 | ManyTypeArgs | 3 | 0 | tst.ts:69:31:69:36 | number | -| tst.ts:69:18:69:29 | ManyTypeArgs | 3 | 1 | tst.ts:69:39:69:44 | string | -| tst.ts:69:18:69:29 | ManyTypeArgs | 3 | 2 | tst.ts:69:47:69:53 | boolean | -| tst.ts:80:41:80:47 | Generic | 1 | 0 | tst.ts:80:49:80:54 | Leaf[] | -| tst.ts:123:26:123:39 | import("type") | 1 | 0 | tst.ts:123:41:123:46 | string | -| tst.ts:125:55:125:57 | Foo | 1 | 0 | tst.ts:125:59:125:64 | string | diff --git a/javascript/ql/test/library-tests/TypeScript/TypeAnnotations/TypeAccessHelpers.ql b/javascript/ql/test/library-tests/TypeScript/TypeAnnotations/TypeAccessHelpers.ql deleted file mode 100644 index 796bc1f9c1d7..000000000000 --- a/javascript/ql/test/library-tests/TypeScript/TypeAnnotations/TypeAccessHelpers.ql +++ /dev/null @@ -1,5 +0,0 @@ -import javascript - -from TypeAccess type, int n -where type.hasTypeArguments() -select type, type.getNumTypeArgument(), n, type.getTypeArgument(n) diff --git a/javascript/ql/test/library-tests/TypeScript/TypeAnnotations/TypeAccessHelpers.qll b/javascript/ql/test/library-tests/TypeScript/TypeAnnotations/TypeAccessHelpers.qll new file mode 100644 index 000000000000..aada65c83f95 --- /dev/null +++ b/javascript/ql/test/library-tests/TypeScript/TypeAnnotations/TypeAccessHelpers.qll @@ -0,0 +1,5 @@ +import javascript + +query predicate test_TypeAccessHelpers(TypeAccess type, int res0, int n, TypeExpr res1) { + type.hasTypeArguments() and res0 = type.getNumTypeArgument() and res1 = type.getTypeArgument(n) +} diff --git a/javascript/ql/test/library-tests/TypeScript/TypeAnnotations/TypeArguments.expected b/javascript/ql/test/library-tests/TypeScript/TypeAnnotations/TypeArguments.expected deleted file mode 100644 index 700d762dc111..000000000000 --- a/javascript/ql/test/library-tests/TypeScript/TypeAnnotations/TypeArguments.expected +++ /dev/null @@ -1,8 +0,0 @@ -| tst.ts:102:13:102:29 | f1("foo") | 0 | 1 | tst.ts:102:16:102:21 | string | -| tst.ts:103:13:103:40 | f2(5) | 0 | 1 | tst.ts:104:16:104:21 | number | -| tst.ts:106:12:106:27 | new C1() | 0 | 1 | tst.ts:106:19:106:24 | string | -| tst.ts:107:12:107:35 | new C2< ... mber>() | 0 | 2 | tst.ts:107:19:107:24 | string | -| tst.ts:107:12:107:35 | new C2< ... mber>() | 1 | 2 | tst.ts:107:27:107:32 | number | -| tst.ts:108:12:108:27 | new C3() | 0 | 1 | tst.ts:108:19:108:24 | number | diff --git a/javascript/ql/test/library-tests/TypeScript/TypeAnnotations/TypeArguments.ql b/javascript/ql/test/library-tests/TypeScript/TypeAnnotations/TypeArguments.ql deleted file mode 100644 index f445df0c42d7..000000000000 --- a/javascript/ql/test/library-tests/TypeScript/TypeAnnotations/TypeArguments.ql +++ /dev/null @@ -1,4 +0,0 @@ -import javascript - -from InvokeExpr invoke, int n -select invoke, n, invoke.getNumTypeArgument(), invoke.getTypeArgument(n) diff --git a/javascript/ql/test/library-tests/TypeScript/TypeAnnotations/TypeArguments.qll b/javascript/ql/test/library-tests/TypeScript/TypeAnnotations/TypeArguments.qll new file mode 100644 index 000000000000..794535feaff2 --- /dev/null +++ b/javascript/ql/test/library-tests/TypeScript/TypeAnnotations/TypeArguments.qll @@ -0,0 +1,5 @@ +import javascript + +query predicate test_TypeArguments(InvokeExpr invoke, int n, int res0, TypeExpr res1) { + res0 = invoke.getNumTypeArgument() and res1 = invoke.getTypeArgument(n) +} diff --git a/javascript/ql/test/library-tests/TypeScript/TypeAnnotations/TypeAssertions.expected b/javascript/ql/test/library-tests/TypeScript/TypeAnnotations/TypeAssertions.expected deleted file mode 100644 index 09e338845fef..000000000000 --- a/javascript/ql/test/library-tests/TypeScript/TypeAnnotations/TypeAssertions.expected +++ /dev/null @@ -1,2 +0,0 @@ -| tst.ts:110:14:110:24 | 5 as number | tst.ts:110:14:110:14 | 5 | tst.ts:110:19:110:24 | number | -| tst.ts:111:18:111:31 | 'foo' | tst.ts:111:27:111:31 | 'foo' | tst.ts:111:19:111:24 | string | diff --git a/javascript/ql/test/library-tests/TypeScript/TypeAnnotations/TypeAssertions.ql b/javascript/ql/test/library-tests/TypeScript/TypeAnnotations/TypeAssertions.ql deleted file mode 100644 index b0ad62bf1cda..000000000000 --- a/javascript/ql/test/library-tests/TypeScript/TypeAnnotations/TypeAssertions.ql +++ /dev/null @@ -1,4 +0,0 @@ -import javascript - -from TypeAssertion expr -select expr, expr.getExpression(), expr.getTypeAnnotation() diff --git a/javascript/ql/test/library-tests/TypeScript/TypeAnnotations/TypeAssertions.qll b/javascript/ql/test/library-tests/TypeScript/TypeAnnotations/TypeAssertions.qll new file mode 100644 index 000000000000..b30f24fdb154 --- /dev/null +++ b/javascript/ql/test/library-tests/TypeScript/TypeAnnotations/TypeAssertions.qll @@ -0,0 +1,5 @@ +import javascript + +query predicate test_TypeAssertions(TypeAssertion expr, Expr res0, TypeExpr res1) { + res0 = expr.getExpression() and res1 = expr.getTypeAnnotation() +} diff --git a/javascript/ql/test/library-tests/TypeScript/TypeAnnotations/TypeofTypeExpr.expected b/javascript/ql/test/library-tests/TypeScript/TypeAnnotations/TypeofTypeExpr.expected deleted file mode 100644 index 2e5a963fe2aa..000000000000 --- a/javascript/ql/test/library-tests/TypeScript/TypeAnnotations/TypeofTypeExpr.expected +++ /dev/null @@ -1,6 +0,0 @@ -| tst.ts:70:17:70:24 | typeof N | tst.ts:70:24:70:24 | N | -| tst.ts:71:17:71:26 | typeof N.x | tst.ts:71:24:71:26 | N.x | -| tst.ts:72:17:72:35 | typeof qualifiedVar | tst.ts:72:24:72:35 | qualifiedVar | -| tst.ts:81:43:81:50 | typeof x | tst.ts:81:50:81:50 | x | -| tst.ts:126:21:126:42 | typeof ... value") | tst.ts:126:28:126:42 | import("value") | -| tst.ts:127:30:127:53 | typeof ... lue").x | tst.ts:127:53:127:53 | x | diff --git a/javascript/ql/test/library-tests/TypeScript/TypeAnnotations/TypeofTypeExpr.ql b/javascript/ql/test/library-tests/TypeScript/TypeAnnotations/TypeofTypeExpr.ql deleted file mode 100644 index 9773ffaed6ef..000000000000 --- a/javascript/ql/test/library-tests/TypeScript/TypeAnnotations/TypeofTypeExpr.ql +++ /dev/null @@ -1,4 +0,0 @@ -import javascript - -from TypeofTypeExpr type -select type, type.getExpressionName() diff --git a/javascript/ql/test/library-tests/TypeScript/TypeAnnotations/TypeofTypeExpr.qll b/javascript/ql/test/library-tests/TypeScript/TypeAnnotations/TypeofTypeExpr.qll new file mode 100644 index 000000000000..e5301941c95b --- /dev/null +++ b/javascript/ql/test/library-tests/TypeScript/TypeAnnotations/TypeofTypeExpr.qll @@ -0,0 +1,5 @@ +import javascript + +query predicate test_TypeofTypeExpr(TypeofTypeExpr type, VarTypeAccess res) { + res = type.getExpressionName() +} diff --git a/javascript/ql/test/library-tests/TypeScript/TypeAnnotations/UnionTypeExpr.expected b/javascript/ql/test/library-tests/TypeScript/TypeAnnotations/UnionTypeExpr.expected deleted file mode 100644 index 1375c47cf05a..000000000000 --- a/javascript/ql/test/library-tests/TypeScript/TypeAnnotations/UnionTypeExpr.expected +++ /dev/null @@ -1,7 +0,0 @@ -| tst.ts:41:16:41:36 | string\| ... boolean | 0 | 3 | tst.ts:41:16:41:21 | string | -| tst.ts:41:16:41:36 | string\| ... boolean | 1 | 3 | tst.ts:41:23:41:28 | number | -| tst.ts:41:16:41:36 | string\| ... boolean | 2 | 3 | tst.ts:41:30:41:36 | boolean | -| tst.ts:47:19:47:33 | string \| number | 0 | 2 | tst.ts:47:19:47:24 | string | -| tst.ts:47:19:47:33 | string \| number | 1 | 2 | tst.ts:47:28:47:33 | number | -| tst.ts:47:39:47:54 | boolean \| string | 0 | 2 | tst.ts:47:39:47:45 | boolean | -| tst.ts:47:39:47:54 | boolean \| string | 1 | 2 | tst.ts:47:49:47:54 | string | diff --git a/javascript/ql/test/library-tests/TypeScript/TypeAnnotations/UnionTypeExpr.ql b/javascript/ql/test/library-tests/TypeScript/TypeAnnotations/UnionTypeExpr.ql deleted file mode 100644 index 1a07d1ebd8a7..000000000000 --- a/javascript/ql/test/library-tests/TypeScript/TypeAnnotations/UnionTypeExpr.ql +++ /dev/null @@ -1,4 +0,0 @@ -import javascript - -from UnionTypeExpr type, int n -select type, n, type.getNumElementType(), type.getElementType(n) diff --git a/javascript/ql/test/library-tests/TypeScript/TypeAnnotations/UnionTypeExpr.qll b/javascript/ql/test/library-tests/TypeScript/TypeAnnotations/UnionTypeExpr.qll new file mode 100644 index 000000000000..b70f73aecb60 --- /dev/null +++ b/javascript/ql/test/library-tests/TypeScript/TypeAnnotations/UnionTypeExpr.qll @@ -0,0 +1,5 @@ +import javascript + +query predicate test_UnionTypeExpr(UnionTypeExpr type, int n, int res0, TypeExpr res1) { + res0 = type.getNumElementType() and res1 = type.getElementType(n) +} diff --git a/javascript/ql/test/library-tests/TypeScript/TypeAnnotations/UnknownTypeExpr.expected b/javascript/ql/test/library-tests/TypeScript/TypeAnnotations/UnknownTypeExpr.expected deleted file mode 100644 index 5f5df1a3e361..000000000000 --- a/javascript/ql/test/library-tests/TypeScript/TypeAnnotations/UnknownTypeExpr.expected +++ /dev/null @@ -1 +0,0 @@ -| tst.ts:137:18:137:24 | unknown | diff --git a/javascript/ql/test/library-tests/TypeScript/TypeAnnotations/UnknownTypeExpr.ql b/javascript/ql/test/library-tests/TypeScript/TypeAnnotations/UnknownTypeExpr.ql deleted file mode 100644 index 5472547df6b5..000000000000 --- a/javascript/ql/test/library-tests/TypeScript/TypeAnnotations/UnknownTypeExpr.ql +++ /dev/null @@ -1,5 +0,0 @@ -import javascript - -from TypeExpr type -where type.isUnknownKeyword() -select type diff --git a/javascript/ql/test/library-tests/TypeScript/TypeAnnotations/UnknownTypeExpr.qll b/javascript/ql/test/library-tests/TypeScript/TypeAnnotations/UnknownTypeExpr.qll new file mode 100644 index 000000000000..bf260ef43540 --- /dev/null +++ b/javascript/ql/test/library-tests/TypeScript/TypeAnnotations/UnknownTypeExpr.qll @@ -0,0 +1,3 @@ +import javascript + +query predicate test_UnknownTypeExpr(TypeExpr type) { type.isUnknownKeyword() } diff --git a/javascript/ql/test/library-tests/TypeScript/TypeAnnotations/VariableTypes.expected b/javascript/ql/test/library-tests/TypeScript/TypeAnnotations/VariableTypes.expected deleted file mode 100644 index 7f6035afaac3..000000000000 --- a/javascript/ql/test/library-tests/TypeScript/TypeAnnotations/VariableTypes.expected +++ /dev/null @@ -1,76 +0,0 @@ -| tst.ts:1:5:1:13 | stringVar | stringVar | tst.ts:1:16:1:21 | string | -| tst.ts:2:5:2:13 | numberVar | numberVar | tst.ts:2:16:2:21 | number | -| tst.ts:3:5:3:14 | booleanVar | booleanVar | tst.ts:3:17:3:23 | boolean | -| tst.ts:4:5:4:11 | nullVar | nullVar | tst.ts:4:14:4:17 | null | -| tst.ts:5:5:5:16 | undefinedVar | undefinedVar | tst.ts:5:19:5:27 | undefined | -| tst.ts:6:5:6:10 | anyVar | anyVar | tst.ts:6:13:6:15 | any | -| tst.ts:7:5:7:11 | voidVar | voidVar | tst.ts:7:14:7:17 | void | -| tst.ts:8:5:8:12 | neverVar | neverVar | tst.ts:8:15:8:19 | never | -| tst.ts:9:5:9:17 | literalString | literalString | tst.ts:9:20:9:24 | "foo" | -| tst.ts:10:5:10:17 | literalNumber | literalNumber | tst.ts:10:20:10:21 | 45 | -| tst.ts:11:5:11:15 | literalTrue | literalTrue | tst.ts:11:18:11:21 | true | -| tst.ts:12:5:12:16 | literalFalse | literalFalse | tst.ts:12:19:12:23 | false | -| tst.ts:24:20:24:36 | numberMethodParam | numberMethodParam | tst.ts:24:39:24:44 | number | -| tst.ts:25:23:25:42 | interfaceMethodParam | interfaceMethodParam | tst.ts:25:45:25:53 | Interface | -| tst.ts:28:5:28:16 | interfaceVar | interfaceVar | tst.ts:28:19:28:27 | Interface | -| tst.ts:33:29:33:47 | numberFunctionParam | numberFunctionParam | tst.ts:33:50:33:55 | number | -| tst.ts:34:32:34:52 | interac ... onParam | interaceFunctionParam | tst.ts:34:55:34:63 | Interface | -| tst.ts:36:27:36:32 | param1 | param1 | tst.ts:36:35:36:40 | number | -| tst.ts:36:47:36:52 | param2 | param2 | tst.ts:36:55:36:60 | string | -| tst.ts:38:5:38:13 | arrayType | arrayType | tst.ts:38:16:38:23 | string[] | -| tst.ts:39:5:39:14 | arrayType2 | arrayType2 | tst.ts:39:17:39:26 | string[][] | -| tst.ts:40:5:40:14 | arrayType3 | arrayType3 | tst.ts:40:17:40:28 | string[][][] | -| tst.ts:41:5:41:13 | unionType | unionType | tst.ts:41:16:41:36 | string\| ... boolean | -| tst.ts:42:5:42:15 | indexedType | indexedType | tst.ts:42:18:42:41 | Interfa ... Field'] | -| tst.ts:43:5:43:20 | intersectionType | intersectionType | tst.ts:43:23:43:43 | string& ... boolean | -| tst.ts:44:5:44:21 | parenthesizedType | parenthesizedType | tst.ts:44:24:44:31 | (string) | -| tst.ts:45:5:45:22 | parenthesizedType2 | parenthesizedType2 | tst.ts:45:25:45:34 | ((string)) | -| tst.ts:46:5:46:22 | parenthesizedType3 | parenthesizedType3 | tst.ts:46:25:46:36 | (((string))) | -| tst.ts:47:5:47:15 | complexType | complexType | tst.ts:47:18:47:55 | (string ... string) | -| tst.ts:48:5:48:13 | tupleType | tupleType | tst.ts:48:16:48:40 | [number ... oolean] | -| tst.ts:49:5:49:13 | keyofType | keyofType | tst.ts:49:16:49:30 | keyof Interface | -| tst.ts:63:5:63:16 | qualifiedVar | qualifiedVar | tst.ts:63:19:63:21 | N.I | -| tst.ts:64:5:64:17 | qualifiedVar2 | qualifiedVar2 | tst.ts:64:20:64:24 | N.M.I | -| tst.ts:65:5:65:15 | genericVar1 | genericVar1 | tst.ts:65:18:65:32 | Generic | -| tst.ts:66:5:66:15 | genericVar2 | genericVar2 | tst.ts:66:18:66:40 | N.Inner ... number> | -| tst.ts:67:5:67:15 | genericVar3 | genericVar3 | tst.ts:67:18:67:42 | N.M.Inn ... number> | -| tst.ts:68:5:68:15 | genericVar4 | genericVar4 | tst.ts:68:18:68:49 | Generic ... umber>> | -| tst.ts:69:5:69:15 | genericVar5 | genericVar5 | tst.ts:69:18:69:54 | ManyTyp ... oolean> | -| tst.ts:70:5:70:14 | typeofVar1 | typeofVar1 | tst.ts:70:17:70:24 | typeof N | -| tst.ts:71:5:71:14 | typeofVar2 | typeofVar2 | tst.ts:71:17:71:26 | typeof N.x | -| tst.ts:72:5:72:14 | typeofVar3 | typeofVar3 | tst.ts:72:17:72:35 | typeof qualifiedVar | -| tst.ts:80:24:80:24 | x | x | tst.ts:80:27:80:32 | number | -| tst.ts:81:24:81:24 | x | x | tst.ts:81:27:81:34 | string[] | -| tst.ts:83:5:83:16 | interfaceVar | interfaceVar | tst.ts:83:19:83:43 | { x: nu ... mber; } | -| tst.ts:84:5:84:21 | emptyInterfaceVar | emptyInterfaceVar | tst.ts:84:24:84:25 | {} | -| tst.ts:85:5:85:22 | interfaceVarMethod | interfaceVarMethod | tst.ts:85:25:85:42 | { foo(): number; } | -| tst.ts:87:5:87:17 | functionType1 | functionType1 | tst.ts:87:20:87:31 | () => number | -| tst.ts:88:5:88:17 | functionType2 | functionType2 | tst.ts:88:20:88:44 | (param: ... number | -| tst.ts:88:21:88:25 | param | param | tst.ts:88:28:88:33 | string | -| tst.ts:89:5:89:17 | functionType3 | functionType3 | tst.ts:89:20:89:37 | (param: T) => T | -| tst.ts:89:24:89:28 | param | param | tst.ts:89:31:89:31 | T | -| tst.ts:90:5:90:20 | constructorType1 | constructorType1 | tst.ts:90:23:90:38 | new () => Object | -| tst.ts:91:5:91:20 | constructorType2 | constructorType2 | tst.ts:91:23:91:51 | new (pa ... Object | -| tst.ts:91:28:91:32 | param | param | tst.ts:91:35:91:40 | string | -| tst.ts:92:5:92:20 | constructorType3 | constructorType3 | tst.ts:92:23:92:49 | new ... Object | -| tst.ts:92:31:92:35 | param | param | tst.ts:92:38:92:38 | T | -| tst.ts:94:16:94:16 | x | x | tst.ts:94:19:94:19 | S | -| tst.ts:95:18:95:18 | x | x | tst.ts:95:21:95:21 | S | -| tst.ts:95:24:95:24 | y | y | tst.ts:95:27:95:27 | T | -| tst.ts:96:31:96:31 | x | x | tst.ts:96:34:96:34 | S | -| tst.ts:113:5:113:15 | mappedType1 | mappedType1 | tst.ts:113:18:113:46 | { [K in ... umber } | -| tst.ts:114:5:114:15 | mappedType2 | mappedType2 | tst.ts:114:18:114:41 | { [K in ... umber } | -| tst.ts:116:35:116:35 | x | x | tst.ts:116:38:116:43 | number | -| tst.ts:116:46:116:46 | y | y | tst.ts:116:49:116:54 | string | -| tst.ts:122:5:122:16 | importedType | importedType | tst.ts:122:19:122:32 | import("type") | -| tst.ts:123:5:123:23 | importedTypeGeneric | importedTypeGeneric | tst.ts:123:26:123:47 | import( ... string> | -| tst.ts:124:5:124:25 | importe ... iedType | importedQualifiedType | tst.ts:124:48:124:50 | Foo | -| tst.ts:125:5:125:32 | importe ... Generic | importedQualifiedTypeGeneric | tst.ts:125:35:125:65 | import( ... string> | -| tst.ts:126:5:126:18 | importedTypeof | importedTypeof | tst.ts:126:21:126:42 | typeof ... value") | -| tst.ts:127:5:127:27 | importe ... dTypeof | importedQualifiedTypeof | tst.ts:127:30:127:53 | typeof ... lue").x | -| tst.ts:128:5:128:35 | importe ... tespace | importedQualifiedTypeWhitespace | tst.ts:131:4:131:6 | bar | -| tst.ts:133:5:133:28 | tupleWi ... Element | tupleWithOptionalElement | tst.ts:133:31:133:55 | [number ... umber?] | -| tst.ts:134:5:134:14 | emptyTuple | emptyTuple | tst.ts:134:17:134:18 | [] | -| tst.ts:135:5:135:24 | tupleWithRestElement | tupleWithRestElement | tst.ts:135:27:135:47 | [number ... ring[]] | -| tst.ts:136:5:136:36 | tupleWi ... lements | tupleWithOptionalAndRestElements | tst.ts:136:39:136:68 | [number ... mber[]] | -| tst.ts:137:5:137:15 | unknownType | unknownType | tst.ts:137:18:137:24 | unknown | diff --git a/javascript/ql/test/library-tests/TypeScript/TypeAnnotations/VariableTypes.ql b/javascript/ql/test/library-tests/TypeScript/TypeAnnotations/VariableTypes.ql deleted file mode 100644 index 13c4c1efb24f..000000000000 --- a/javascript/ql/test/library-tests/TypeScript/TypeAnnotations/VariableTypes.ql +++ /dev/null @@ -1,4 +0,0 @@ -import javascript - -from VarDecl var -select var, var.getName(), var.getTypeAnnotation() diff --git a/javascript/ql/test/library-tests/TypeScript/TypeAnnotations/VariableTypes.qll b/javascript/ql/test/library-tests/TypeScript/TypeAnnotations/VariableTypes.qll new file mode 100644 index 000000000000..9312d5c545f5 --- /dev/null +++ b/javascript/ql/test/library-tests/TypeScript/TypeAnnotations/VariableTypes.qll @@ -0,0 +1,5 @@ +import javascript + +query predicate test_VariableTypes(VarDecl var, string res0, TypeExpr res1) { + res0 = var.getName() and res1 = var.getTypeAnnotation() +} diff --git a/javascript/ql/test/library-tests/TypeScript/TypeAnnotations/tests.expected b/javascript/ql/test/library-tests/TypeScript/TypeAnnotations/tests.expected new file mode 100644 index 000000000000..e3a4785d905d --- /dev/null +++ b/javascript/ql/test/library-tests/TypeScript/TypeAnnotations/tests.expected @@ -0,0 +1,258 @@ +test_TypeofTypeExpr +| tst.ts:70:17:70:24 | typeof N | tst.ts:70:24:70:24 | N | +| tst.ts:71:17:71:26 | typeof N.x | tst.ts:71:24:71:26 | N.x | +| tst.ts:72:17:72:35 | typeof qualifiedVar | tst.ts:72:24:72:35 | qualifiedVar | +| tst.ts:81:43:81:50 | typeof x | tst.ts:81:50:81:50 | x | +| tst.ts:126:21:126:42 | typeof ... value") | tst.ts:126:28:126:42 | import("value") | +| tst.ts:127:30:127:53 | typeof ... lue").x | tst.ts:127:53:127:53 | x | +test_FunctionTypeParameters +| tst.ts:88:20:88:44 | (param: ... number | 0 | 1 | tst.ts:88:21:88:25 | param | +| tst.ts:89:20:89:37 | (param: T) => T | 0 | 1 | tst.ts:89:24:89:28 | param | +| tst.ts:91:23:91:51 | new (pa ... Object | 0 | 1 | tst.ts:91:28:91:32 | param | +| tst.ts:92:23:92:49 | new ... Object | 0 | 1 | tst.ts:92:31:92:35 | param | +test_IndexedAccessTypeExpr +| tst.ts:42:18:42:41 | Interfa ... Field'] | tst.ts:42:18:42:26 | Interface | tst.ts:42:28:42:40 | 'numberField' | +test_UnknownTypeExpr +| tst.ts:137:18:137:24 | unknown | +test_MappedTypeExpr +| tst.ts:113:18:113:46 | { [K in ... umber } | tst.ts:113:21:113:35 | K in keyof Node | tst.ts:113:21:113:21 | K | tst.ts:113:26:113:35 | keyof Node | tst.ts:113:39:113:44 | number | +| tst.ts:114:18:114:41 | { [K in ... umber } | tst.ts:114:21:114:30 | K in "foo" | tst.ts:114:21:114:21 | K | tst.ts:114:26:114:30 | "foo" | tst.ts:114:34:114:39 | number | +test_ImportTypeExpr +| tst.ts:122:19:122:32 | import("type") | type | type | +| tst.ts:123:26:123:39 | import("type") | type | type | +| tst.ts:124:28:124:46 | import("namespace") | namespace | namespace | +| tst.ts:125:35:125:53 | import("namespace") | namespace | namespace | +| tst.ts:126:28:126:42 | import("value") | value | value | +| tst.ts:127:37:127:51 | import("value") | value | value | +| tst.ts:128:38:130:3 | import( ... ce'\\n ) | awkard-namespace | namespace | +test_OptionalTypeExpr +| tst.ts:133:48:133:54 | number? | tst.ts:133:48:133:53 | number | +| tst.ts:136:48:136:54 | string? | tst.ts:136:48:136:53 | string | +test_VariableTypes +| tst.ts:1:5:1:13 | stringVar | stringVar | tst.ts:1:16:1:21 | string | +| tst.ts:2:5:2:13 | numberVar | numberVar | tst.ts:2:16:2:21 | number | +| tst.ts:3:5:3:14 | booleanVar | booleanVar | tst.ts:3:17:3:23 | boolean | +| tst.ts:4:5:4:11 | nullVar | nullVar | tst.ts:4:14:4:17 | null | +| tst.ts:5:5:5:16 | undefinedVar | undefinedVar | tst.ts:5:19:5:27 | undefined | +| tst.ts:6:5:6:10 | anyVar | anyVar | tst.ts:6:13:6:15 | any | +| tst.ts:7:5:7:11 | voidVar | voidVar | tst.ts:7:14:7:17 | void | +| tst.ts:8:5:8:12 | neverVar | neverVar | tst.ts:8:15:8:19 | never | +| tst.ts:9:5:9:17 | literalString | literalString | tst.ts:9:20:9:24 | "foo" | +| tst.ts:10:5:10:17 | literalNumber | literalNumber | tst.ts:10:20:10:21 | 45 | +| tst.ts:11:5:11:15 | literalTrue | literalTrue | tst.ts:11:18:11:21 | true | +| tst.ts:12:5:12:16 | literalFalse | literalFalse | tst.ts:12:19:12:23 | false | +| tst.ts:24:20:24:36 | numberMethodParam | numberMethodParam | tst.ts:24:39:24:44 | number | +| tst.ts:25:23:25:42 | interfaceMethodParam | interfaceMethodParam | tst.ts:25:45:25:53 | Interface | +| tst.ts:28:5:28:16 | interfaceVar | interfaceVar | tst.ts:28:19:28:27 | Interface | +| tst.ts:33:29:33:47 | numberFunctionParam | numberFunctionParam | tst.ts:33:50:33:55 | number | +| tst.ts:34:32:34:52 | interac ... onParam | interaceFunctionParam | tst.ts:34:55:34:63 | Interface | +| tst.ts:36:27:36:32 | param1 | param1 | tst.ts:36:35:36:40 | number | +| tst.ts:36:47:36:52 | param2 | param2 | tst.ts:36:55:36:60 | string | +| tst.ts:38:5:38:13 | arrayType | arrayType | tst.ts:38:16:38:23 | string[] | +| tst.ts:39:5:39:14 | arrayType2 | arrayType2 | tst.ts:39:17:39:26 | string[][] | +| tst.ts:40:5:40:14 | arrayType3 | arrayType3 | tst.ts:40:17:40:28 | string[][][] | +| tst.ts:41:5:41:13 | unionType | unionType | tst.ts:41:16:41:36 | string\| ... boolean | +| tst.ts:42:5:42:15 | indexedType | indexedType | tst.ts:42:18:42:41 | Interfa ... Field'] | +| tst.ts:43:5:43:20 | intersectionType | intersectionType | tst.ts:43:23:43:43 | string& ... boolean | +| tst.ts:44:5:44:21 | parenthesizedType | parenthesizedType | tst.ts:44:24:44:31 | (string) | +| tst.ts:45:5:45:22 | parenthesizedType2 | parenthesizedType2 | tst.ts:45:25:45:34 | ((string)) | +| tst.ts:46:5:46:22 | parenthesizedType3 | parenthesizedType3 | tst.ts:46:25:46:36 | (((string))) | +| tst.ts:47:5:47:15 | complexType | complexType | tst.ts:47:18:47:55 | (string ... string) | +| tst.ts:48:5:48:13 | tupleType | tupleType | tst.ts:48:16:48:40 | [number ... oolean] | +| tst.ts:49:5:49:13 | keyofType | keyofType | tst.ts:49:16:49:30 | keyof Interface | +| tst.ts:63:5:63:16 | qualifiedVar | qualifiedVar | tst.ts:63:19:63:21 | N.I | +| tst.ts:64:5:64:17 | qualifiedVar2 | qualifiedVar2 | tst.ts:64:20:64:24 | N.M.I | +| tst.ts:65:5:65:15 | genericVar1 | genericVar1 | tst.ts:65:18:65:32 | Generic | +| tst.ts:66:5:66:15 | genericVar2 | genericVar2 | tst.ts:66:18:66:40 | N.Inner ... number> | +| tst.ts:67:5:67:15 | genericVar3 | genericVar3 | tst.ts:67:18:67:42 | N.M.Inn ... number> | +| tst.ts:68:5:68:15 | genericVar4 | genericVar4 | tst.ts:68:18:68:49 | Generic ... umber>> | +| tst.ts:69:5:69:15 | genericVar5 | genericVar5 | tst.ts:69:18:69:54 | ManyTyp ... oolean> | +| tst.ts:70:5:70:14 | typeofVar1 | typeofVar1 | tst.ts:70:17:70:24 | typeof N | +| tst.ts:71:5:71:14 | typeofVar2 | typeofVar2 | tst.ts:71:17:71:26 | typeof N.x | +| tst.ts:72:5:72:14 | typeofVar3 | typeofVar3 | tst.ts:72:17:72:35 | typeof qualifiedVar | +| tst.ts:80:24:80:24 | x | x | tst.ts:80:27:80:32 | number | +| tst.ts:81:24:81:24 | x | x | tst.ts:81:27:81:34 | string[] | +| tst.ts:83:5:83:16 | interfaceVar | interfaceVar | tst.ts:83:19:83:43 | { x: nu ... mber; } | +| tst.ts:84:5:84:21 | emptyInterfaceVar | emptyInterfaceVar | tst.ts:84:24:84:25 | {} | +| tst.ts:85:5:85:22 | interfaceVarMethod | interfaceVarMethod | tst.ts:85:25:85:42 | { foo(): number; } | +| tst.ts:87:5:87:17 | functionType1 | functionType1 | tst.ts:87:20:87:31 | () => number | +| tst.ts:88:5:88:17 | functionType2 | functionType2 | tst.ts:88:20:88:44 | (param: ... number | +| tst.ts:88:21:88:25 | param | param | tst.ts:88:28:88:33 | string | +| tst.ts:89:5:89:17 | functionType3 | functionType3 | tst.ts:89:20:89:37 | (param: T) => T | +| tst.ts:89:24:89:28 | param | param | tst.ts:89:31:89:31 | T | +| tst.ts:90:5:90:20 | constructorType1 | constructorType1 | tst.ts:90:23:90:38 | new () => Object | +| tst.ts:91:5:91:20 | constructorType2 | constructorType2 | tst.ts:91:23:91:51 | new (pa ... Object | +| tst.ts:91:28:91:32 | param | param | tst.ts:91:35:91:40 | string | +| tst.ts:92:5:92:20 | constructorType3 | constructorType3 | tst.ts:92:23:92:49 | new ... Object | +| tst.ts:92:31:92:35 | param | param | tst.ts:92:38:92:38 | T | +| tst.ts:94:16:94:16 | x | x | tst.ts:94:19:94:19 | S | +| tst.ts:95:18:95:18 | x | x | tst.ts:95:21:95:21 | S | +| tst.ts:95:24:95:24 | y | y | tst.ts:95:27:95:27 | T | +| tst.ts:96:31:96:31 | x | x | tst.ts:96:34:96:34 | S | +| tst.ts:113:5:113:15 | mappedType1 | mappedType1 | tst.ts:113:18:113:46 | { [K in ... umber } | +| tst.ts:114:5:114:15 | mappedType2 | mappedType2 | tst.ts:114:18:114:41 | { [K in ... umber } | +| tst.ts:116:35:116:35 | x | x | tst.ts:116:38:116:43 | number | +| tst.ts:116:46:116:46 | y | y | tst.ts:116:49:116:54 | string | +| tst.ts:122:5:122:16 | importedType | importedType | tst.ts:122:19:122:32 | import("type") | +| tst.ts:123:5:123:23 | importedTypeGeneric | importedTypeGeneric | tst.ts:123:26:123:47 | import( ... string> | +| tst.ts:124:5:124:25 | importe ... iedType | importedQualifiedType | tst.ts:124:48:124:50 | Foo | +| tst.ts:125:5:125:32 | importe ... Generic | importedQualifiedTypeGeneric | tst.ts:125:35:125:65 | import( ... string> | +| tst.ts:126:5:126:18 | importedTypeof | importedTypeof | tst.ts:126:21:126:42 | typeof ... value") | +| tst.ts:127:5:127:27 | importe ... dTypeof | importedQualifiedTypeof | tst.ts:127:30:127:53 | typeof ... lue").x | +| tst.ts:128:5:128:35 | importe ... tespace | importedQualifiedTypeWhitespace | tst.ts:131:4:131:6 | bar | +| tst.ts:133:5:133:28 | tupleWi ... Element | tupleWithOptionalElement | tst.ts:133:31:133:55 | [number ... umber?] | +| tst.ts:134:5:134:14 | emptyTuple | emptyTuple | tst.ts:134:17:134:18 | [] | +| tst.ts:135:5:135:24 | tupleWithRestElement | tupleWithRestElement | tst.ts:135:27:135:47 | [number ... ring[]] | +| tst.ts:136:5:136:36 | tupleWi ... lements | tupleWithOptionalAndRestElements | tst.ts:136:39:136:68 | [number ... mber[]] | +| tst.ts:137:5:137:15 | unknownType | unknownType | tst.ts:137:18:137:24 | unknown | +test_QualifiedTypeAccess +| tst.ts:63:19:63:21 | N.I | tst.ts:63:19:63:19 | N | tst.ts:63:21:63:21 | I | +| tst.ts:64:20:64:24 | N.M.I | tst.ts:64:20:64:22 | N.M | tst.ts:64:24:64:24 | I | +| tst.ts:66:18:66:32 | N.InnerGeneric1 | tst.ts:66:18:66:18 | N | tst.ts:66:20:66:32 | InnerGeneric1 | +| tst.ts:67:18:67:34 | N.M.InnerGeneric2 | tst.ts:67:18:67:20 | N.M | tst.ts:67:22:67:34 | InnerGeneric2 | +| tst.ts:68:26:68:40 | N.InnerGeneric1 | tst.ts:68:26:68:26 | N | tst.ts:68:28:68:40 | InnerGeneric1 | +| tst.ts:124:48:124:50 | Foo | tst.ts:124:28:124:46 | import("namespace") | tst.ts:124:48:124:50 | Foo | +| tst.ts:125:55:125:57 | Foo | tst.ts:125:35:125:53 | import("namespace") | tst.ts:125:55:125:57 | Foo | +| tst.ts:131:4:131:6 | bar | tst.ts:128:38:130:3 | import( ... ce'\\n ) | tst.ts:131:4:131:6 | bar | +test_GenericTypeExpr +| tst.ts:65:18:65:32 | Generic | tst.ts:65:18:65:24 | Generic | 0 | 1 | tst.ts:65:26:65:31 | number | +| tst.ts:66:18:66:40 | N.Inner ... number> | tst.ts:66:18:66:32 | N.InnerGeneric1 | 0 | 1 | tst.ts:66:34:66:39 | number | +| tst.ts:67:18:67:42 | N.M.Inn ... number> | tst.ts:67:18:67:34 | N.M.InnerGeneric2 | 0 | 1 | tst.ts:67:36:67:41 | number | +| tst.ts:68:18:68:49 | Generic ... umber>> | tst.ts:68:18:68:24 | Generic | 0 | 1 | tst.ts:68:26:68:48 | N.Inner ... number> | +| tst.ts:68:26:68:48 | N.Inner ... number> | tst.ts:68:26:68:40 | N.InnerGeneric1 | 0 | 1 | tst.ts:68:42:68:47 | number | +| tst.ts:69:18:69:54 | ManyTyp ... oolean> | tst.ts:69:18:69:29 | ManyTypeArgs | 0 | 3 | tst.ts:69:31:69:36 | number | +| tst.ts:69:18:69:54 | ManyTyp ... oolean> | tst.ts:69:18:69:29 | ManyTypeArgs | 1 | 3 | tst.ts:69:39:69:44 | string | +| tst.ts:69:18:69:54 | ManyTyp ... oolean> | tst.ts:69:18:69:29 | ManyTypeArgs | 2 | 3 | tst.ts:69:47:69:53 | boolean | +| tst.ts:80:41:80:55 | Generic | tst.ts:80:41:80:47 | Generic | 0 | 1 | tst.ts:80:49:80:54 | Leaf[] | +| tst.ts:123:26:123:47 | import( ... string> | tst.ts:123:26:123:39 | import("type") | 0 | 1 | tst.ts:123:41:123:46 | string | +| tst.ts:125:35:125:65 | import( ... string> | tst.ts:125:55:125:57 | Foo | 0 | 1 | tst.ts:125:59:125:64 | string | +test_IntersectionTypeExpr +| tst.ts:43:23:43:43 | string& ... boolean | 0 | 3 | tst.ts:43:23:43:28 | string | +| tst.ts:43:23:43:43 | string& ... boolean | 1 | 3 | tst.ts:43:30:43:35 | number | +| tst.ts:43:23:43:43 | string& ... boolean | 2 | 3 | tst.ts:43:37:43:43 | boolean | +| tst.ts:47:18:47:55 | (string ... string) | 0 | 2 | tst.ts:47:18:47:34 | (string \| number) | +| tst.ts:47:18:47:55 | (string ... string) | 1 | 2 | tst.ts:47:38:47:55 | (boolean \| string) | +test_FunctionTypeReturns +| tst.ts:87:20:87:31 | () => number | tst.ts:87:26:87:31 | number | +| tst.ts:88:20:88:44 | (param: ... number | tst.ts:88:39:88:44 | number | +| tst.ts:89:20:89:37 | (param: T) => T | tst.ts:89:37:89:37 | T | +| tst.ts:90:23:90:38 | new () => Object | tst.ts:90:33:90:38 | Object | +| tst.ts:91:23:91:51 | new (pa ... Object | tst.ts:91:46:91:51 | Object | +| tst.ts:92:23:92:49 | new ... Object | tst.ts:92:44:92:49 | Object | +test_InterfaceTypeExpr +| tst.ts:83:19:83:43 | { x: nu ... mber; } | tst.ts:83:21:83:30 | x: number; | +| tst.ts:83:19:83:43 | { x: nu ... mber; } | tst.ts:83:32:83:41 | y: number; | +| tst.ts:85:25:85:42 | { foo(): number; } | tst.ts:85:27:85:40 | foo(): number; | +test_IsTypeExpr +| tst.ts:75:17:75:28 | this is Leaf | tst.ts:75:17:75:20 | this | tst.ts:75:25:75:28 | Leaf | +| tst.ts:76:21:76:32 | that is Leaf | tst.ts:76:21:76:24 | that | tst.ts:76:29:76:32 | Leaf | +| tst.ts:80:36:80:55 | x is Generic | tst.ts:80:36:80:36 | x | tst.ts:80:41:80:55 | Generic | +| tst.ts:81:38:81:50 | x is typeof x | tst.ts:81:38:81:38 | x | tst.ts:81:43:81:50 | typeof x | +test_ThisParameterTypes +| function hasThisParam | tst.ts:116:29:116:32 | void | +test_ChildIndex +test_TypeArguments +| tst.ts:102:13:102:29 | f1("foo") | 0 | 1 | tst.ts:102:16:102:21 | string | +| tst.ts:103:13:103:40 | f2(5) | 0 | 1 | tst.ts:104:16:104:21 | number | +| tst.ts:106:12:106:27 | new C1() | 0 | 1 | tst.ts:106:19:106:24 | string | +| tst.ts:107:12:107:35 | new C2< ... mber>() | 0 | 2 | tst.ts:107:19:107:24 | string | +| tst.ts:107:12:107:35 | new C2< ... mber>() | 1 | 2 | tst.ts:107:27:107:32 | number | +| tst.ts:108:12:108:27 | new C3() | 0 | 1 | tst.ts:108:19:108:24 | number | +test_ParenthesizedTypeExpr +| tst.ts:44:24:44:31 | (string) | tst.ts:44:25:44:30 | string | tst.ts:44:25:44:30 | string | +| tst.ts:45:25:45:34 | ((string)) | tst.ts:45:26:45:33 | (string) | tst.ts:45:27:45:32 | string | +| tst.ts:45:26:45:33 | (string) | tst.ts:45:27:45:32 | string | tst.ts:45:27:45:32 | string | +| tst.ts:46:25:46:36 | (((string))) | tst.ts:46:26:46:35 | ((string)) | tst.ts:46:28:46:33 | string | +| tst.ts:46:26:46:35 | ((string)) | tst.ts:46:27:46:34 | (string) | tst.ts:46:28:46:33 | string | +| tst.ts:46:27:46:34 | (string) | tst.ts:46:28:46:33 | string | tst.ts:46:28:46:33 | string | +| tst.ts:47:18:47:34 | (string \| number) | tst.ts:47:19:47:33 | string \| number | tst.ts:47:19:47:33 | string \| number | +| tst.ts:47:38:47:55 | (boolean \| string) | tst.ts:47:39:47:54 | boolean \| string | tst.ts:47:39:47:54 | boolean \| string | +test_TupleTypeExpr +| tst.ts:48:16:48:40 | [number ... oolean] | 0 | 3 | tst.ts:48:17:48:22 | number | +| tst.ts:48:16:48:40 | [number ... oolean] | 1 | 3 | tst.ts:48:25:48:30 | string | +| tst.ts:48:16:48:40 | [number ... oolean] | 2 | 3 | tst.ts:48:33:48:39 | boolean | +| tst.ts:95:31:95:35 | [S,T] | 0 | 2 | tst.ts:95:32:95:32 | S | +| tst.ts:95:31:95:35 | [S,T] | 1 | 2 | tst.ts:95:34:95:34 | T | +| tst.ts:133:31:133:55 | [number ... umber?] | 0 | 3 | tst.ts:133:32:133:37 | number | +| tst.ts:133:31:133:55 | [number ... umber?] | 1 | 3 | tst.ts:133:40:133:45 | string | +| tst.ts:133:31:133:55 | [number ... umber?] | 2 | 3 | tst.ts:133:48:133:54 | number? | +| tst.ts:135:27:135:47 | [number ... ring[]] | 0 | 2 | tst.ts:135:28:135:33 | number | +| tst.ts:135:27:135:47 | [number ... ring[]] | 1 | 2 | tst.ts:135:36:135:46 | ...string[] | +| tst.ts:136:39:136:68 | [number ... mber[]] | 0 | 3 | tst.ts:136:40:136:45 | number | +| tst.ts:136:39:136:68 | [number ... mber[]] | 1 | 3 | tst.ts:136:48:136:54 | string? | +| tst.ts:136:39:136:68 | [number ... mber[]] | 2 | 3 | tst.ts:136:57:136:67 | ...number[] | +test_FieldTypes +| tst.ts:15:3:15:22 | numberField: number; | tst.ts:15:16:15:21 | number | +| tst.ts:16:3:16:22 | stringField: string; | tst.ts:16:16:16:21 | string | +| tst.ts:17:3:17:28 | interfa ... erface; | tst.ts:17:19:17:27 | Interface | +| tst.ts:18:3:18:18 | thisField: this; | tst.ts:18:14:18:17 | this | +| tst.ts:83:21:83:30 | x: number; | tst.ts:83:24:83:29 | number | +| tst.ts:83:32:83:41 | y: number; | tst.ts:83:35:83:40 | number | +test_Parameters +| tst.ts:36:27:36:32 | param1 | tst.ts:36:44:36:44 | 1 | tst.ts:36:35:36:40 | number | +| tst.ts:36:47:36:52 | param2 | tst.ts:36:64:36:66 | '2' | tst.ts:36:55:36:60 | string | +test_ArrayTypeExpr +| tst.ts:38:16:38:23 | string[] | tst.ts:38:16:38:21 | string | +| tst.ts:39:17:39:24 | string[] | tst.ts:39:17:39:22 | string | +| tst.ts:39:17:39:26 | string[][] | tst.ts:39:17:39:24 | string[] | +| tst.ts:40:17:40:24 | string[] | tst.ts:40:17:40:22 | string | +| tst.ts:40:17:40:26 | string[][] | tst.ts:40:17:40:24 | string[] | +| tst.ts:40:17:40:28 | string[][][] | tst.ts:40:17:40:26 | string[][] | +| tst.ts:80:49:80:54 | Leaf[] | tst.ts:80:49:80:52 | Leaf | +| tst.ts:81:27:81:34 | string[] | tst.ts:81:27:81:32 | string | +| tst.ts:135:39:135:46 | string[] | tst.ts:135:39:135:44 | string | +| tst.ts:136:60:136:67 | number[] | tst.ts:136:60:136:65 | number | +test_TypeAccessHelpers +| tst.ts:65:18:65:24 | Generic | 1 | 0 | tst.ts:65:26:65:31 | number | +| tst.ts:66:18:66:32 | N.InnerGeneric1 | 1 | 0 | tst.ts:66:34:66:39 | number | +| tst.ts:67:18:67:34 | N.M.InnerGeneric2 | 1 | 0 | tst.ts:67:36:67:41 | number | +| tst.ts:68:18:68:24 | Generic | 1 | 0 | tst.ts:68:26:68:48 | N.Inner ... number> | +| tst.ts:68:26:68:40 | N.InnerGeneric1 | 1 | 0 | tst.ts:68:42:68:47 | number | +| tst.ts:69:18:69:29 | ManyTypeArgs | 3 | 0 | tst.ts:69:31:69:36 | number | +| tst.ts:69:18:69:29 | ManyTypeArgs | 3 | 1 | tst.ts:69:39:69:44 | string | +| tst.ts:69:18:69:29 | ManyTypeArgs | 3 | 2 | tst.ts:69:47:69:53 | boolean | +| tst.ts:80:41:80:47 | Generic | 1 | 0 | tst.ts:80:49:80:54 | Leaf[] | +| tst.ts:123:26:123:39 | import("type") | 1 | 0 | tst.ts:123:41:123:46 | string | +| tst.ts:125:55:125:57 | Foo | 1 | 0 | tst.ts:125:59:125:64 | string | +test_TypeAssertions +| tst.ts:110:14:110:24 | 5 as number | tst.ts:110:14:110:14 | 5 | tst.ts:110:19:110:24 | number | +| tst.ts:111:18:111:31 | 'foo' | tst.ts:111:27:111:31 | 'foo' | tst.ts:111:19:111:24 | string | +test_UnionTypeExpr +| tst.ts:41:16:41:36 | string\| ... boolean | 0 | 3 | tst.ts:41:16:41:21 | string | +| tst.ts:41:16:41:36 | string\| ... boolean | 1 | 3 | tst.ts:41:23:41:28 | number | +| tst.ts:41:16:41:36 | string\| ... boolean | 2 | 3 | tst.ts:41:30:41:36 | boolean | +| tst.ts:47:19:47:33 | string \| number | 0 | 2 | tst.ts:47:19:47:24 | string | +| tst.ts:47:19:47:33 | string \| number | 1 | 2 | tst.ts:47:28:47:33 | number | +| tst.ts:47:39:47:54 | boolean \| string | 0 | 2 | tst.ts:47:39:47:45 | boolean | +| tst.ts:47:39:47:54 | boolean \| string | 1 | 2 | tst.ts:47:49:47:54 | string | +test_RestTypeExpr +| tst.ts:135:36:135:46 | ...string[] | tst.ts:135:39:135:46 | string[] | tst.ts:135:39:135:44 | string | +| tst.ts:136:57:136:67 | ...number[] | tst.ts:136:60:136:67 | number[] | tst.ts:136:60:136:65 | number | +test_Containers +test_ReturnTypes +| tst.ts:20:3:20:31 | returnN ... number; | method returnNumberMethod of interface Interface | tst.ts:20:25:20:30 | number | +| tst.ts:21:3:21:27 | returnV ... : void; | method returnVoidMethod of interface Interface | tst.ts:21:23:21:26 | void | +| tst.ts:22:3:22:27 | returnN ... : null; | method returnNullMethod of interface Interface | tst.ts:22:23:22:26 | null | +| tst.ts:23:3:23:27 | returnT ... : this; | method returnThisMethod of interface Interface | tst.ts:23:23:23:26 | this | +| tst.ts:30:1:30:53 | functio ... rn 0; } | function returnNumberFunction | tst.ts:30:34:30:39 | number | +| tst.ts:31:1:31:49 | functio ... rn 0; } | function returnVoidFunction | tst.ts:31:32:31:35 | void | +| tst.ts:32:1:32:49 | functio ... rn 0; } | function returnNullFunction | tst.ts:32:32:32:35 | null | +| tst.ts:75:3:75:29 | isThisL ... s Leaf; | method isThisLeaf of interface Node | tst.ts:75:17:75:28 | this is Leaf | +| tst.ts:76:3:76:33 | isThatL ... s Leaf; | method isThatLeaf of interface Node | tst.ts:76:21:76:32 | that is Leaf | +| tst.ts:80:1:80:73 | functio ... alse; } | function complexIsType | tst.ts:80:36:80:55 | x is Generic | +| tst.ts:81:1:81:66 | functio ... true } | function obviousIsType | tst.ts:81:38:81:50 | x is typeof x | +| tst.ts:85:27:85:40 | foo(): number; | method foo of anonymous interface | tst.ts:85:34:85:39 | number | +| tst.ts:87:20:87:31 | () => number | anonymous function type | tst.ts:87:26:87:31 | number | +| tst.ts:88:20:88:44 | (param: ... number | anonymous function type | tst.ts:88:39:88:44 | number | +| tst.ts:89:20:89:37 | (param: T) => T | anonymous function type | tst.ts:89:37:89:37 | T | +| tst.ts:90:23:90:38 | new () => Object | anonymous function type | tst.ts:90:33:90:38 | Object | +| tst.ts:91:23:91:51 | new (pa ... Object | anonymous function type | tst.ts:91:46:91:51 | Object | +| tst.ts:92:23:92:49 | new ... Object | anonymous function type | tst.ts:92:44:92:49 | Object | +| tst.ts:94:1:94:37 | functio ... rn x; } | function f1 | tst.ts:94:23:94:23 | S | +| tst.ts:95:1:95:53 | functio ... x,y]; } | function f2 | tst.ts:95:31:95:35 | [S,T] | +| tst.ts:96:1:96:52 | functio ... rn x; } | function f3 | tst.ts:96:38:96:38 | S | +test_KeyofTypeExpr +| tst.ts:49:16:49:30 | keyof Interface | tst.ts:49:22:49:30 | Interface | +| tst.ts:113:26:113:35 | keyof Node | tst.ts:113:32:113:35 | Node | diff --git a/javascript/ql/test/library-tests/TypeScript/TypeAnnotations/tests.ql b/javascript/ql/test/library-tests/TypeScript/TypeAnnotations/tests.ql new file mode 100644 index 000000000000..f9f04dee7cb8 --- /dev/null +++ b/javascript/ql/test/library-tests/TypeScript/TypeAnnotations/tests.ql @@ -0,0 +1,29 @@ +import TypeofTypeExpr +import FunctionTypeParameters +import IndexedAccessTypeExpr +import UnknownTypeExpr +import MappedTypeExpr +import ImportTypeExpr +import OptionalTypeExpr +import VariableTypes +import QualifiedTypeAccess +import GenericTypeExpr +import IntersectionTypeExpr +import FunctionTypeReturns +import InterfaceTypeExpr +import IsTypeExpr +import ThisParameterTypes +import ChildIndex +import TypeArguments +import ParenthesizedTypeExpr +import TupleTypeExpr +import FieldTypes +import Parameters +import ArrayTypeExpr +import TypeAccessHelpers +import TypeAssertions +import UnionTypeExpr +import RestTypeExpr +import Containers +import ReturnTypes +import KeyofTypeExpr diff --git a/javascript/ql/test/library-tests/frameworks/NodeJSLib/ClientRequest.expected b/javascript/ql/test/library-tests/frameworks/NodeJSLib/ClientRequest.expected deleted file mode 100644 index db19a6df549f..000000000000 --- a/javascript/ql/test/library-tests/frameworks/NodeJSLib/ClientRequest.expected +++ /dev/null @@ -1,4 +0,0 @@ -| src/http.js:18:1:18:30 | http.re ... uth" }) | -| src/http.js:21:15:26:6 | http.re ... \\n }) | -| src/http.js:27:16:27:73 | http.re ... POST'}) | -| src/https.js:18:1:18:31 | https.r ... uth" }) | diff --git a/javascript/ql/test/library-tests/frameworks/NodeJSLib/ClientRequest.ql b/javascript/ql/test/library-tests/frameworks/NodeJSLib/ClientRequest.ql deleted file mode 100644 index 1082ccf23778..000000000000 --- a/javascript/ql/test/library-tests/frameworks/NodeJSLib/ClientRequest.ql +++ /dev/null @@ -1,4 +0,0 @@ -import javascript - -from NodeJSLib::NodeJSClientRequest cr -select cr diff --git a/javascript/ql/test/library-tests/frameworks/NodeJSLib/ClientRequest.qll b/javascript/ql/test/library-tests/frameworks/NodeJSLib/ClientRequest.qll new file mode 100644 index 000000000000..0842471dbdaf --- /dev/null +++ b/javascript/ql/test/library-tests/frameworks/NodeJSLib/ClientRequest.qll @@ -0,0 +1,3 @@ +import javascript + +query predicate test_ClientRequest(NodeJSLib::NodeJSClientRequest cr) { any() } diff --git a/javascript/ql/test/library-tests/frameworks/NodeJSLib/ClientRequest_getADataNode.expected b/javascript/ql/test/library-tests/frameworks/NodeJSLib/ClientRequest_getADataNode.expected deleted file mode 100644 index 6d4b769f261e..000000000000 --- a/javascript/ql/test/library-tests/frameworks/NodeJSLib/ClientRequest_getADataNode.expected +++ /dev/null @@ -1,2 +0,0 @@ -| src/http.js:27:16:27:73 | http.re ... POST'}) | src/http.js:50:16:50:22 | 'stuff' | -| src/http.js:27:16:27:73 | http.re ... POST'}) | src/http.js:51:14:51:25 | 'more stuff' | diff --git a/javascript/ql/test/library-tests/frameworks/NodeJSLib/ClientRequest_getADataNode.ql b/javascript/ql/test/library-tests/frameworks/NodeJSLib/ClientRequest_getADataNode.ql deleted file mode 100644 index d6c03851421e..000000000000 --- a/javascript/ql/test/library-tests/frameworks/NodeJSLib/ClientRequest_getADataNode.ql +++ /dev/null @@ -1,4 +0,0 @@ -import javascript - -from NodeJSLib::NodeJSClientRequest cr -select cr, cr.getADataNode() diff --git a/javascript/ql/test/library-tests/frameworks/NodeJSLib/ClientRequest_getADataNode.qll b/javascript/ql/test/library-tests/frameworks/NodeJSLib/ClientRequest_getADataNode.qll new file mode 100644 index 000000000000..d19e4b6204b9 --- /dev/null +++ b/javascript/ql/test/library-tests/frameworks/NodeJSLib/ClientRequest_getADataNode.qll @@ -0,0 +1,7 @@ +import javascript + +query predicate test_ClientRequest_getADataNode( + NodeJSLib::NodeJSClientRequest cr, DataFlow::Node res +) { + res = cr.getADataNode() +} diff --git a/javascript/ql/test/library-tests/frameworks/NodeJSLib/Credentials.expected b/javascript/ql/test/library-tests/frameworks/NodeJSLib/Credentials.expected deleted file mode 100644 index a51710046ed5..000000000000 --- a/javascript/ql/test/library-tests/frameworks/NodeJSLib/Credentials.expected +++ /dev/null @@ -1,2 +0,0 @@ -| src/http.js:18:22:18:27 | "auth" | credentials | -| src/https.js:18:23:18:28 | "auth" | credentials | diff --git a/javascript/ql/test/library-tests/frameworks/NodeJSLib/Credentials.ql b/javascript/ql/test/library-tests/frameworks/NodeJSLib/Credentials.ql deleted file mode 100644 index 5d99f722f961..000000000000 --- a/javascript/ql/test/library-tests/frameworks/NodeJSLib/Credentials.ql +++ /dev/null @@ -1,4 +0,0 @@ -import javascript - -from NodeJSLib::Credentials cr -select cr, cr.getCredentialsKind() diff --git a/javascript/ql/test/library-tests/frameworks/NodeJSLib/Credentials.qll b/javascript/ql/test/library-tests/frameworks/NodeJSLib/Credentials.qll new file mode 100644 index 000000000000..d8682c168893 --- /dev/null +++ b/javascript/ql/test/library-tests/frameworks/NodeJSLib/Credentials.qll @@ -0,0 +1,5 @@ +import javascript + +query predicate test_Credentials(NodeJSLib::Credentials cr, string res) { + res = cr.getCredentialsKind() +} diff --git a/javascript/ql/test/library-tests/frameworks/NodeJSLib/HeaderAccess.expected b/javascript/ql/test/library-tests/frameworks/NodeJSLib/HeaderAccess.expected deleted file mode 100644 index fa4e488e78ff..000000000000 --- a/javascript/ql/test/library-tests/frameworks/NodeJSLib/HeaderAccess.expected +++ /dev/null @@ -1,2 +0,0 @@ -| src/http.js:9:3:9:17 | req.headers.foo | foo | -| src/https.js:9:3:9:17 | req.headers.foo | foo | diff --git a/javascript/ql/test/library-tests/frameworks/NodeJSLib/HeaderAccess.ql b/javascript/ql/test/library-tests/frameworks/NodeJSLib/HeaderAccess.ql deleted file mode 100644 index a86349b65cbf..000000000000 --- a/javascript/ql/test/library-tests/frameworks/NodeJSLib/HeaderAccess.ql +++ /dev/null @@ -1,4 +0,0 @@ -import javascript - -from HTTP::RequestHeaderAccess access -select access, access.getAHeaderName() diff --git a/javascript/ql/test/library-tests/frameworks/NodeJSLib/HeaderAccess.qll b/javascript/ql/test/library-tests/frameworks/NodeJSLib/HeaderAccess.qll new file mode 100644 index 000000000000..22d1d6aee539 --- /dev/null +++ b/javascript/ql/test/library-tests/frameworks/NodeJSLib/HeaderAccess.qll @@ -0,0 +1,5 @@ +import javascript + +query predicate test_HeaderAccess(HTTP::RequestHeaderAccess access, string res) { + res = access.getAHeaderName() +} diff --git a/javascript/ql/test/library-tests/frameworks/NodeJSLib/HeaderDefinition.expected b/javascript/ql/test/library-tests/frameworks/NodeJSLib/HeaderDefinition.expected deleted file mode 100644 index 0faaecc6ae93..000000000000 --- a/javascript/ql/test/library-tests/frameworks/NodeJSLib/HeaderDefinition.expected +++ /dev/null @@ -1,5 +0,0 @@ -| src/http.js:7:3:7:42 | res.wri ... rget }) | src/http.js:4:32:10:1 | functio ... .foo;\\n} | -| src/http.js:13:3:13:44 | res.set ... /html') | src/http.js:12:19:16:1 | functio ... ar");\\n} | -| src/http.js:63:3:63:40 | res.set ... , "23") | src/http.js:62:19:65:1 | functio ... r2");\\n} | -| src/https.js:7:3:7:42 | res.wri ... rget }) | src/https.js:4:33:10:1 | functio ... .foo;\\n} | -| src/https.js:13:3:13:44 | res.set ... /html') | src/https.js:12:20:16:1 | functio ... ar");\\n} | diff --git a/javascript/ql/test/library-tests/frameworks/NodeJSLib/HeaderDefinition.ql b/javascript/ql/test/library-tests/frameworks/NodeJSLib/HeaderDefinition.ql deleted file mode 100644 index 24609ced17d0..000000000000 --- a/javascript/ql/test/library-tests/frameworks/NodeJSLib/HeaderDefinition.ql +++ /dev/null @@ -1,5 +0,0 @@ -import javascript - -from HTTP::HeaderDefinition hd, NodeJSLib::RouteHandler rh -where rh = hd.getRouteHandler() -select hd, rh diff --git a/javascript/ql/test/library-tests/frameworks/NodeJSLib/HeaderDefinition.qll b/javascript/ql/test/library-tests/frameworks/NodeJSLib/HeaderDefinition.qll new file mode 100644 index 000000000000..c1255a117c0a --- /dev/null +++ b/javascript/ql/test/library-tests/frameworks/NodeJSLib/HeaderDefinition.qll @@ -0,0 +1,5 @@ +import javascript + +query predicate test_HeaderDefinition(HTTP::HeaderDefinition hd, NodeJSLib::RouteHandler rh) { + rh = hd.getRouteHandler() +} diff --git a/javascript/ql/test/library-tests/frameworks/NodeJSLib/HeaderDefinition_defines.expected b/javascript/ql/test/library-tests/frameworks/NodeJSLib/HeaderDefinition_defines.expected deleted file mode 100644 index cc2eeb8237d7..000000000000 --- a/javascript/ql/test/library-tests/frameworks/NodeJSLib/HeaderDefinition_defines.expected +++ /dev/null @@ -1,2 +0,0 @@ -| src/http.js:13:3:13:44 | res.set ... /html') | content-type | text/html | -| src/https.js:13:3:13:44 | res.set ... /html') | content-type | text/html | diff --git a/javascript/ql/test/library-tests/frameworks/NodeJSLib/HeaderDefinition_defines.ql b/javascript/ql/test/library-tests/frameworks/NodeJSLib/HeaderDefinition_defines.ql deleted file mode 100644 index 929773c34fa2..000000000000 --- a/javascript/ql/test/library-tests/frameworks/NodeJSLib/HeaderDefinition_defines.ql +++ /dev/null @@ -1,7 +0,0 @@ -import javascript - -from HTTP::HeaderDefinition hd, string name, string value -where - hd.defines(name, value) and - hd.getRouteHandler() instanceof NodeJSLib::RouteHandler -select hd, name, value diff --git a/javascript/ql/test/library-tests/frameworks/NodeJSLib/HeaderDefinition_defines.qll b/javascript/ql/test/library-tests/frameworks/NodeJSLib/HeaderDefinition_defines.qll new file mode 100644 index 000000000000..a07c98b46be0 --- /dev/null +++ b/javascript/ql/test/library-tests/frameworks/NodeJSLib/HeaderDefinition_defines.qll @@ -0,0 +1,5 @@ +import javascript + +query predicate test_HeaderDefinition_defines(HTTP::HeaderDefinition hd, string name, string value) { + hd.defines(name, value) and hd.getRouteHandler() instanceof NodeJSLib::RouteHandler +} diff --git a/javascript/ql/test/library-tests/frameworks/NodeJSLib/HeaderDefinition_getAHeaderName.expected b/javascript/ql/test/library-tests/frameworks/NodeJSLib/HeaderDefinition_getAHeaderName.expected deleted file mode 100644 index 3a5d6e2934f5..000000000000 --- a/javascript/ql/test/library-tests/frameworks/NodeJSLib/HeaderDefinition_getAHeaderName.expected +++ /dev/null @@ -1,4 +0,0 @@ -| src/http.js:7:3:7:42 | res.wri ... rget }) | location | -| src/http.js:13:3:13:44 | res.set ... /html') | content-type | -| src/https.js:7:3:7:42 | res.wri ... rget }) | location | -| src/https.js:13:3:13:44 | res.set ... /html') | content-type | diff --git a/javascript/ql/test/library-tests/frameworks/NodeJSLib/HeaderDefinition_getAHeaderName.ql b/javascript/ql/test/library-tests/frameworks/NodeJSLib/HeaderDefinition_getAHeaderName.ql deleted file mode 100644 index 94d28acdf749..000000000000 --- a/javascript/ql/test/library-tests/frameworks/NodeJSLib/HeaderDefinition_getAHeaderName.ql +++ /dev/null @@ -1,5 +0,0 @@ -import javascript - -from HTTP::HeaderDefinition hd -where hd.getRouteHandler() instanceof NodeJSLib::RouteHandler -select hd, hd.getAHeaderName() diff --git a/javascript/ql/test/library-tests/frameworks/NodeJSLib/HeaderDefinition_getAHeaderName.qll b/javascript/ql/test/library-tests/frameworks/NodeJSLib/HeaderDefinition_getAHeaderName.qll new file mode 100644 index 000000000000..7fcda8127007 --- /dev/null +++ b/javascript/ql/test/library-tests/frameworks/NodeJSLib/HeaderDefinition_getAHeaderName.qll @@ -0,0 +1,5 @@ +import javascript + +query predicate test_HeaderDefinition_getAHeaderName(HTTP::HeaderDefinition hd, string res) { + hd.getRouteHandler() instanceof NodeJSLib::RouteHandler and res = hd.getAHeaderName() +} diff --git a/javascript/ql/test/library-tests/frameworks/NodeJSLib/HeaderDefinition_getNameExpr.expected b/javascript/ql/test/library-tests/frameworks/NodeJSLib/HeaderDefinition_getNameExpr.expected deleted file mode 100644 index bc08b0641608..000000000000 --- a/javascript/ql/test/library-tests/frameworks/NodeJSLib/HeaderDefinition_getNameExpr.expected +++ /dev/null @@ -1,5 +0,0 @@ -| src/http.js:7:3:7:42 | res.wri ... rget }) | src/http.js:7:17:7:19 | 302 | -| src/http.js:13:3:13:44 | res.set ... /html') | src/http.js:13:17:13:30 | 'Content-Type' | -| src/http.js:63:3:63:40 | res.set ... , "23") | src/http.js:63:17:63:33 | req.query.myParam | -| src/https.js:7:3:7:42 | res.wri ... rget }) | src/https.js:7:17:7:19 | 302 | -| src/https.js:13:3:13:44 | res.set ... /html') | src/https.js:13:17:13:30 | 'Content-Type' | diff --git a/javascript/ql/test/library-tests/frameworks/NodeJSLib/HeaderDefinition_getNameExpr.ql b/javascript/ql/test/library-tests/frameworks/NodeJSLib/HeaderDefinition_getNameExpr.ql deleted file mode 100644 index 58d6c811c1b4..000000000000 --- a/javascript/ql/test/library-tests/frameworks/NodeJSLib/HeaderDefinition_getNameExpr.ql +++ /dev/null @@ -1,5 +0,0 @@ -import javascript - -from HTTP::ExplicitHeaderDefinition hd -where hd.getRouteHandler() instanceof NodeJSLib::RouteHandler -select hd, hd.getNameExpr() diff --git a/javascript/ql/test/library-tests/frameworks/NodeJSLib/HeaderDefinition_getNameExpr.qll b/javascript/ql/test/library-tests/frameworks/NodeJSLib/HeaderDefinition_getNameExpr.qll new file mode 100644 index 000000000000..87f73f43770a --- /dev/null +++ b/javascript/ql/test/library-tests/frameworks/NodeJSLib/HeaderDefinition_getNameExpr.qll @@ -0,0 +1,5 @@ +import javascript + +query predicate test_HeaderDefinition_getNameExpr(HTTP::ExplicitHeaderDefinition hd, Expr res) { + hd.getRouteHandler() instanceof NodeJSLib::RouteHandler and res = hd.getNameExpr() +} diff --git a/javascript/ql/test/library-tests/frameworks/NodeJSLib/RemoteFlowSources.expected b/javascript/ql/test/library-tests/frameworks/NodeJSLib/RemoteFlowSources.expected deleted file mode 100644 index 776cfa02cd19..000000000000 --- a/javascript/ql/test/library-tests/frameworks/NodeJSLib/RemoteFlowSources.expected +++ /dev/null @@ -1,12 +0,0 @@ -| src/http.js:6:26:6:32 | req.url | -| src/http.js:8:3:8:20 | req.headers.cookie | -| src/http.js:9:3:9:17 | req.headers.foo | -| src/http.js:21:33:21:40 | response | -| src/http.js:23:28:23:32 | chunk | -| src/http.js:29:26:29:33 | response | -| src/http.js:30:28:30:32 | chunk | -| src/http.js:40:23:40:30 | authInfo | -| src/http.js:45:23:45:27 | error | -| src/https.js:6:26:6:32 | req.url | -| src/https.js:8:3:8:20 | req.headers.cookie | -| src/https.js:9:3:9:17 | req.headers.foo | diff --git a/javascript/ql/test/library-tests/frameworks/NodeJSLib/RemoteFlowSources.ql b/javascript/ql/test/library-tests/frameworks/NodeJSLib/RemoteFlowSources.ql deleted file mode 100644 index 8aecd8243356..000000000000 --- a/javascript/ql/test/library-tests/frameworks/NodeJSLib/RemoteFlowSources.ql +++ /dev/null @@ -1,4 +0,0 @@ -import javascript - -from RemoteFlowSource source -select source diff --git a/javascript/ql/test/library-tests/frameworks/NodeJSLib/RemoteFlowSources.qll b/javascript/ql/test/library-tests/frameworks/NodeJSLib/RemoteFlowSources.qll new file mode 100644 index 000000000000..97faf90a3679 --- /dev/null +++ b/javascript/ql/test/library-tests/frameworks/NodeJSLib/RemoteFlowSources.qll @@ -0,0 +1,3 @@ +import javascript + +query predicate test_RemoteFlowSources(RemoteFlowSource source) { any() } diff --git a/javascript/ql/test/library-tests/frameworks/NodeJSLib/RequestExpr.expected b/javascript/ql/test/library-tests/frameworks/NodeJSLib/RequestExpr.expected deleted file mode 100644 index 0c28dd67b476..000000000000 --- a/javascript/ql/test/library-tests/frameworks/NodeJSLib/RequestExpr.expected +++ /dev/null @@ -1,7 +0,0 @@ -| src/http.js:6:26:6:28 | req | src/http.js:4:32:10:1 | functio ... .foo;\\n} | -| src/http.js:8:3:8:5 | req | src/http.js:4:32:10:1 | functio ... .foo;\\n} | -| src/http.js:9:3:9:5 | req | src/http.js:4:32:10:1 | functio ... .foo;\\n} | -| src/http.js:63:17:63:19 | req | src/http.js:62:19:65:1 | functio ... r2");\\n} | -| src/https.js:6:26:6:28 | req | src/https.js:4:33:10:1 | functio ... .foo;\\n} | -| src/https.js:8:3:8:5 | req | src/https.js:4:33:10:1 | functio ... .foo;\\n} | -| src/https.js:9:3:9:5 | req | src/https.js:4:33:10:1 | functio ... .foo;\\n} | diff --git a/javascript/ql/test/library-tests/frameworks/NodeJSLib/RequestExpr.ql b/javascript/ql/test/library-tests/frameworks/NodeJSLib/RequestExpr.ql deleted file mode 100644 index c5972064c5b5..000000000000 --- a/javascript/ql/test/library-tests/frameworks/NodeJSLib/RequestExpr.ql +++ /dev/null @@ -1,4 +0,0 @@ -import javascript - -from NodeJSLib::RequestExpr e -select e, e.getRouteHandler() diff --git a/javascript/ql/test/library-tests/frameworks/NodeJSLib/RequestExpr.qll b/javascript/ql/test/library-tests/frameworks/NodeJSLib/RequestExpr.qll new file mode 100644 index 000000000000..50db052e6258 --- /dev/null +++ b/javascript/ql/test/library-tests/frameworks/NodeJSLib/RequestExpr.qll @@ -0,0 +1,5 @@ +import javascript + +query predicate test_RequestExpr(NodeJSLib::RequestExpr e, HTTP::RouteHandler res) { + res = e.getRouteHandler() +} diff --git a/javascript/ql/test/library-tests/frameworks/NodeJSLib/RequestInputAccess.expected b/javascript/ql/test/library-tests/frameworks/NodeJSLib/RequestInputAccess.expected deleted file mode 100644 index daeb0dc33714..000000000000 --- a/javascript/ql/test/library-tests/frameworks/NodeJSLib/RequestInputAccess.expected +++ /dev/null @@ -1,6 +0,0 @@ -| src/http.js:6:26:6:32 | req.url | url | src/http.js:4:32:10:1 | functio ... .foo;\\n} | -| src/http.js:8:3:8:20 | req.headers.cookie | cookie | src/http.js:4:32:10:1 | functio ... .foo;\\n} | -| src/http.js:9:3:9:17 | req.headers.foo | header | src/http.js:4:32:10:1 | functio ... .foo;\\n} | -| src/https.js:6:26:6:32 | req.url | url | src/https.js:4:33:10:1 | functio ... .foo;\\n} | -| src/https.js:8:3:8:20 | req.headers.cookie | cookie | src/https.js:4:33:10:1 | functio ... .foo;\\n} | -| src/https.js:9:3:9:17 | req.headers.foo | header | src/https.js:4:33:10:1 | functio ... .foo;\\n} | diff --git a/javascript/ql/test/library-tests/frameworks/NodeJSLib/RequestInputAccess.ql b/javascript/ql/test/library-tests/frameworks/NodeJSLib/RequestInputAccess.ql deleted file mode 100644 index 1c98591cb2fa..000000000000 --- a/javascript/ql/test/library-tests/frameworks/NodeJSLib/RequestInputAccess.ql +++ /dev/null @@ -1,5 +0,0 @@ -import javascript - -from HTTP::RequestInputAccess ria, NodeJSLib::RouteHandler rh -where ria.getRouteHandler() = rh -select ria, ria.getKind(), rh diff --git a/javascript/ql/test/library-tests/frameworks/NodeJSLib/RequestInputAccess.qll b/javascript/ql/test/library-tests/frameworks/NodeJSLib/RequestInputAccess.qll new file mode 100644 index 000000000000..7134c96d028f --- /dev/null +++ b/javascript/ql/test/library-tests/frameworks/NodeJSLib/RequestInputAccess.qll @@ -0,0 +1,7 @@ +import javascript + +query predicate test_RequestInputAccess( + HTTP::RequestInputAccess ria, string res, NodeJSLib::RouteHandler rh +) { + ria.getRouteHandler() = rh and res = ria.getKind() +} diff --git a/javascript/ql/test/library-tests/frameworks/NodeJSLib/ResponseExpr.expected b/javascript/ql/test/library-tests/frameworks/NodeJSLib/ResponseExpr.expected deleted file mode 100644 index 21ba58990567..000000000000 --- a/javascript/ql/test/library-tests/frameworks/NodeJSLib/ResponseExpr.expected +++ /dev/null @@ -1,10 +0,0 @@ -| src/http.js:7:3:7:5 | res | src/http.js:4:32:10:1 | functio ... .foo;\\n} | -| src/http.js:13:3:13:5 | res | src/http.js:12:19:16:1 | functio ... ar");\\n} | -| src/http.js:14:3:14:5 | res | src/http.js:12:19:16:1 | functio ... ar");\\n} | -| src/http.js:15:3:15:5 | res | src/http.js:12:19:16:1 | functio ... ar");\\n} | -| src/http.js:63:3:63:5 | res | src/http.js:62:19:65:1 | functio ... r2");\\n} | -| src/http.js:64:3:64:5 | res | src/http.js:62:19:65:1 | functio ... r2");\\n} | -| src/https.js:7:3:7:5 | res | src/https.js:4:33:10:1 | functio ... .foo;\\n} | -| src/https.js:13:3:13:5 | res | src/https.js:12:20:16:1 | functio ... ar");\\n} | -| src/https.js:14:3:14:5 | res | src/https.js:12:20:16:1 | functio ... ar");\\n} | -| src/https.js:15:3:15:5 | res | src/https.js:12:20:16:1 | functio ... ar");\\n} | diff --git a/javascript/ql/test/library-tests/frameworks/NodeJSLib/ResponseExpr.ql b/javascript/ql/test/library-tests/frameworks/NodeJSLib/ResponseExpr.ql deleted file mode 100644 index 4007f07d3c1b..000000000000 --- a/javascript/ql/test/library-tests/frameworks/NodeJSLib/ResponseExpr.ql +++ /dev/null @@ -1,4 +0,0 @@ -import javascript - -from NodeJSLib::ResponseExpr e -select e, e.getRouteHandler() diff --git a/javascript/ql/test/library-tests/frameworks/NodeJSLib/ResponseExpr.qll b/javascript/ql/test/library-tests/frameworks/NodeJSLib/ResponseExpr.qll new file mode 100644 index 000000000000..106b07d90062 --- /dev/null +++ b/javascript/ql/test/library-tests/frameworks/NodeJSLib/ResponseExpr.qll @@ -0,0 +1,5 @@ +import javascript + +query predicate test_ResponseExpr(NodeJSLib::ResponseExpr e, HTTP::RouteHandler res) { + res = e.getRouteHandler() +} diff --git a/javascript/ql/test/library-tests/frameworks/NodeJSLib/ResponseSendArgument.expected b/javascript/ql/test/library-tests/frameworks/NodeJSLib/ResponseSendArgument.expected deleted file mode 100644 index 5710a2e43733..000000000000 --- a/javascript/ql/test/library-tests/frameworks/NodeJSLib/ResponseSendArgument.expected +++ /dev/null @@ -1,5 +0,0 @@ -| src/http.js:14:13:14:17 | "foo" | src/http.js:12:19:16:1 | functio ... ar");\\n} | -| src/http.js:15:11:15:15 | "bar" | src/http.js:12:19:16:1 | functio ... ar");\\n} | -| src/http.js:64:11:64:16 | "bar2" | src/http.js:62:19:65:1 | functio ... r2");\\n} | -| src/https.js:14:13:14:17 | "foo" | src/https.js:12:20:16:1 | functio ... ar");\\n} | -| src/https.js:15:11:15:15 | "bar" | src/https.js:12:20:16:1 | functio ... ar");\\n} | diff --git a/javascript/ql/test/library-tests/frameworks/NodeJSLib/ResponseSendArgument.ql b/javascript/ql/test/library-tests/frameworks/NodeJSLib/ResponseSendArgument.ql deleted file mode 100644 index 799131f9066b..000000000000 --- a/javascript/ql/test/library-tests/frameworks/NodeJSLib/ResponseSendArgument.ql +++ /dev/null @@ -1,5 +0,0 @@ -import javascript - -from HTTP::ResponseSendArgument send, NodeJSLib::RouteHandler rh -where rh = send.getRouteHandler() -select send, rh diff --git a/javascript/ql/test/library-tests/frameworks/NodeJSLib/ResponseSendArgument.qll b/javascript/ql/test/library-tests/frameworks/NodeJSLib/ResponseSendArgument.qll new file mode 100644 index 000000000000..7d859f4d5692 --- /dev/null +++ b/javascript/ql/test/library-tests/frameworks/NodeJSLib/ResponseSendArgument.qll @@ -0,0 +1,7 @@ +import javascript + +query predicate test_ResponseSendArgument( + HTTP::ResponseSendArgument send, NodeJSLib::RouteHandler rh +) { + rh = send.getRouteHandler() +} diff --git a/javascript/ql/test/library-tests/frameworks/NodeJSLib/RouteHandler.expected b/javascript/ql/test/library-tests/frameworks/NodeJSLib/RouteHandler.expected deleted file mode 100644 index 20c82a181e64..000000000000 --- a/javascript/ql/test/library-tests/frameworks/NodeJSLib/RouteHandler.expected +++ /dev/null @@ -1,8 +0,0 @@ -| src/http.js:4:32:10:1 | functio ... .foo;\\n} | src/http.js:4:14:10:2 | http.cr ... foo;\\n}) | -| src/http.js:12:19:16:1 | functio ... ar");\\n} | src/http.js:12:1:16:2 | http.cr ... r");\\n}) | -| src/http.js:55:12:55:30 | function(req,res){} | src/http.js:57:1:57:31 | http.cr ... dler()) | -| src/http.js:60:14:60:32 | function(req,res){} | src/http.js:60:1:60:33 | createS ... res){}) | -| src/http.js:62:19:65:1 | functio ... r2");\\n} | src/http.js:62:1:65:2 | http.cr ... 2");\\n}) | -| src/http.js:68:12:68:27 | (req,res) => f() | src/http.js:70:1:70:36 | http.cr ... dler()) | -| src/https.js:4:33:10:1 | functio ... .foo;\\n} | src/https.js:4:14:10:2 | https.c ... foo;\\n}) | -| src/https.js:12:20:16:1 | functio ... ar");\\n} | src/https.js:12:1:16:2 | https.c ... r");\\n}) | diff --git a/javascript/ql/test/library-tests/frameworks/NodeJSLib/RouteHandler.ql b/javascript/ql/test/library-tests/frameworks/NodeJSLib/RouteHandler.ql deleted file mode 100644 index ed0b7d2a5b3c..000000000000 --- a/javascript/ql/test/library-tests/frameworks/NodeJSLib/RouteHandler.ql +++ /dev/null @@ -1,4 +0,0 @@ -import javascript - -from NodeJSLib::RouteHandler rh -select rh, rh.getServer() diff --git a/javascript/ql/test/library-tests/frameworks/NodeJSLib/RouteHandler.qll b/javascript/ql/test/library-tests/frameworks/NodeJSLib/RouteHandler.qll new file mode 100644 index 000000000000..61f7f8dea0e0 --- /dev/null +++ b/javascript/ql/test/library-tests/frameworks/NodeJSLib/RouteHandler.qll @@ -0,0 +1,3 @@ +import javascript + +query predicate test_RouteHandler(NodeJSLib::RouteHandler rh, Expr res) { res = rh.getServer() } diff --git a/javascript/ql/test/library-tests/frameworks/NodeJSLib/RouteHandler_getARequestExpr.expected b/javascript/ql/test/library-tests/frameworks/NodeJSLib/RouteHandler_getARequestExpr.expected deleted file mode 100644 index 55a726cb5a0b..000000000000 --- a/javascript/ql/test/library-tests/frameworks/NodeJSLib/RouteHandler_getARequestExpr.expected +++ /dev/null @@ -1,7 +0,0 @@ -| src/http.js:4:32:10:1 | functio ... .foo;\\n} | src/http.js:6:26:6:28 | req | -| src/http.js:4:32:10:1 | functio ... .foo;\\n} | src/http.js:8:3:8:5 | req | -| src/http.js:4:32:10:1 | functio ... .foo;\\n} | src/http.js:9:3:9:5 | req | -| src/http.js:62:19:65:1 | functio ... r2");\\n} | src/http.js:63:17:63:19 | req | -| src/https.js:4:33:10:1 | functio ... .foo;\\n} | src/https.js:6:26:6:28 | req | -| src/https.js:4:33:10:1 | functio ... .foo;\\n} | src/https.js:8:3:8:5 | req | -| src/https.js:4:33:10:1 | functio ... .foo;\\n} | src/https.js:9:3:9:5 | req | diff --git a/javascript/ql/test/library-tests/frameworks/NodeJSLib/RouteHandler_getARequestExpr.ql b/javascript/ql/test/library-tests/frameworks/NodeJSLib/RouteHandler_getARequestExpr.ql deleted file mode 100644 index c151bf17d973..000000000000 --- a/javascript/ql/test/library-tests/frameworks/NodeJSLib/RouteHandler_getARequestExpr.ql +++ /dev/null @@ -1,4 +0,0 @@ -import javascript - -from NodeJSLib::RouteHandler rh -select rh, rh.getARequestExpr() diff --git a/javascript/ql/test/library-tests/frameworks/NodeJSLib/RouteHandler_getARequestExpr.qll b/javascript/ql/test/library-tests/frameworks/NodeJSLib/RouteHandler_getARequestExpr.qll new file mode 100644 index 000000000000..e43789bb1a7f --- /dev/null +++ b/javascript/ql/test/library-tests/frameworks/NodeJSLib/RouteHandler_getARequestExpr.qll @@ -0,0 +1,5 @@ +import javascript + +query predicate test_RouteHandler_getARequestExpr(NodeJSLib::RouteHandler rh, HTTP::RequestExpr res) { + res = rh.getARequestExpr() +} diff --git a/javascript/ql/test/library-tests/frameworks/NodeJSLib/RouteHandler_getAResponseExpr.expected b/javascript/ql/test/library-tests/frameworks/NodeJSLib/RouteHandler_getAResponseExpr.expected deleted file mode 100644 index 5147b98bfc88..000000000000 --- a/javascript/ql/test/library-tests/frameworks/NodeJSLib/RouteHandler_getAResponseExpr.expected +++ /dev/null @@ -1,10 +0,0 @@ -| src/http.js:4:32:10:1 | functio ... .foo;\\n} | src/http.js:7:3:7:5 | res | -| src/http.js:12:19:16:1 | functio ... ar");\\n} | src/http.js:13:3:13:5 | res | -| src/http.js:12:19:16:1 | functio ... ar");\\n} | src/http.js:14:3:14:5 | res | -| src/http.js:12:19:16:1 | functio ... ar");\\n} | src/http.js:15:3:15:5 | res | -| src/http.js:62:19:65:1 | functio ... r2");\\n} | src/http.js:63:3:63:5 | res | -| src/http.js:62:19:65:1 | functio ... r2");\\n} | src/http.js:64:3:64:5 | res | -| src/https.js:4:33:10:1 | functio ... .foo;\\n} | src/https.js:7:3:7:5 | res | -| src/https.js:12:20:16:1 | functio ... ar");\\n} | src/https.js:13:3:13:5 | res | -| src/https.js:12:20:16:1 | functio ... ar");\\n} | src/https.js:14:3:14:5 | res | -| src/https.js:12:20:16:1 | functio ... ar");\\n} | src/https.js:15:3:15:5 | res | diff --git a/javascript/ql/test/library-tests/frameworks/NodeJSLib/RouteHandler_getAResponseExpr.ql b/javascript/ql/test/library-tests/frameworks/NodeJSLib/RouteHandler_getAResponseExpr.ql deleted file mode 100644 index 2915ae82a389..000000000000 --- a/javascript/ql/test/library-tests/frameworks/NodeJSLib/RouteHandler_getAResponseExpr.ql +++ /dev/null @@ -1,4 +0,0 @@ -import javascript - -from NodeJSLib::RouteHandler rh -select rh, rh.getAResponseExpr() diff --git a/javascript/ql/test/library-tests/frameworks/NodeJSLib/RouteHandler_getAResponseExpr.qll b/javascript/ql/test/library-tests/frameworks/NodeJSLib/RouteHandler_getAResponseExpr.qll new file mode 100644 index 000000000000..fcef32d90e9c --- /dev/null +++ b/javascript/ql/test/library-tests/frameworks/NodeJSLib/RouteHandler_getAResponseExpr.qll @@ -0,0 +1,7 @@ +import javascript + +query predicate test_RouteHandler_getAResponseExpr( + NodeJSLib::RouteHandler rh, HTTP::ResponseExpr res +) { + res = rh.getAResponseExpr() +} diff --git a/javascript/ql/test/library-tests/frameworks/NodeJSLib/RouteHandler_getAResponseHeader.expected b/javascript/ql/test/library-tests/frameworks/NodeJSLib/RouteHandler_getAResponseHeader.expected deleted file mode 100644 index dd34d809e46e..000000000000 --- a/javascript/ql/test/library-tests/frameworks/NodeJSLib/RouteHandler_getAResponseHeader.expected +++ /dev/null @@ -1,4 +0,0 @@ -| src/http.js:4:32:10:1 | functio ... .foo;\\n} | location | src/http.js:7:3:7:42 | res.wri ... rget }) | -| src/http.js:12:19:16:1 | functio ... ar");\\n} | content-type | src/http.js:13:3:13:44 | res.set ... /html') | -| src/https.js:4:33:10:1 | functio ... .foo;\\n} | location | src/https.js:7:3:7:42 | res.wri ... rget }) | -| src/https.js:12:20:16:1 | functio ... ar");\\n} | content-type | src/https.js:13:3:13:44 | res.set ... /html') | diff --git a/javascript/ql/test/library-tests/frameworks/NodeJSLib/RouteHandler_getAResponseHeader.ql b/javascript/ql/test/library-tests/frameworks/NodeJSLib/RouteHandler_getAResponseHeader.ql deleted file mode 100644 index c2679e22eae4..000000000000 --- a/javascript/ql/test/library-tests/frameworks/NodeJSLib/RouteHandler_getAResponseHeader.ql +++ /dev/null @@ -1,4 +0,0 @@ -import semmle.javascript.frameworks.Express - -from NodeJSLib::RouteHandler rh, string name -select rh, name, rh.getAResponseHeader(name) diff --git a/javascript/ql/test/library-tests/frameworks/NodeJSLib/RouteHandler_getAResponseHeader.qll b/javascript/ql/test/library-tests/frameworks/NodeJSLib/RouteHandler_getAResponseHeader.qll new file mode 100644 index 000000000000..6733b1bd917d --- /dev/null +++ b/javascript/ql/test/library-tests/frameworks/NodeJSLib/RouteHandler_getAResponseHeader.qll @@ -0,0 +1,7 @@ +import semmle.javascript.frameworks.Express + +query predicate test_RouteHandler_getAResponseHeader( + NodeJSLib::RouteHandler rh, string name, HTTP::HeaderDefinition res +) { + res = rh.getAResponseHeader(name) +} diff --git a/javascript/ql/test/library-tests/frameworks/NodeJSLib/RouteSetup_getARouteHandler.expected b/javascript/ql/test/library-tests/frameworks/NodeJSLib/RouteSetup_getARouteHandler.expected deleted file mode 100644 index b33ba5ec964b..000000000000 --- a/javascript/ql/test/library-tests/frameworks/NodeJSLib/RouteSetup_getARouteHandler.expected +++ /dev/null @@ -1,10 +0,0 @@ -| src/http.js:4:14:10:2 | http.cr ... foo;\\n}) | src/http.js:4:32:10:1 | functio ... .foo;\\n} | -| src/http.js:12:1:16:2 | http.cr ... r");\\n}) | src/http.js:12:19:16:1 | functio ... ar");\\n} | -| src/http.js:57:1:57:31 | http.cr ... dler()) | src/http.js:55:12:55:30 | function(req,res){} | -| src/http.js:57:1:57:31 | http.cr ... dler()) | src/http.js:57:19:57:30 | getHandler() | -| src/http.js:60:1:60:33 | createS ... res){}) | src/http.js:60:14:60:32 | function(req,res){} | -| src/http.js:62:1:65:2 | http.cr ... 2");\\n}) | src/http.js:62:19:65:1 | functio ... r2");\\n} | -| src/http.js:70:1:70:36 | http.cr ... dler()) | src/http.js:68:12:68:27 | (req,res) => f() | -| src/http.js:70:1:70:36 | http.cr ... dler()) | src/http.js:70:19:70:35 | getArrowHandler() | -| src/https.js:4:14:10:2 | https.c ... foo;\\n}) | src/https.js:4:33:10:1 | functio ... .foo;\\n} | -| src/https.js:12:1:16:2 | https.c ... r");\\n}) | src/https.js:12:20:16:1 | functio ... ar");\\n} | diff --git a/javascript/ql/test/library-tests/frameworks/NodeJSLib/RouteSetup_getARouteHandler.ql b/javascript/ql/test/library-tests/frameworks/NodeJSLib/RouteSetup_getARouteHandler.ql deleted file mode 100644 index 5b10f6862297..000000000000 --- a/javascript/ql/test/library-tests/frameworks/NodeJSLib/RouteSetup_getARouteHandler.ql +++ /dev/null @@ -1,4 +0,0 @@ -import javascript - -from NodeJSLib::RouteSetup r -select r, r.getARouteHandler() diff --git a/javascript/ql/test/library-tests/frameworks/NodeJSLib/RouteSetup_getARouteHandler.qll b/javascript/ql/test/library-tests/frameworks/NodeJSLib/RouteSetup_getARouteHandler.qll new file mode 100644 index 000000000000..b655b3b9e8a6 --- /dev/null +++ b/javascript/ql/test/library-tests/frameworks/NodeJSLib/RouteSetup_getARouteHandler.qll @@ -0,0 +1,5 @@ +import javascript + +query predicate test_RouteSetup_getARouteHandler(NodeJSLib::RouteSetup r, DataFlow::SourceNode res) { + res = r.getARouteHandler() +} diff --git a/javascript/ql/test/library-tests/frameworks/NodeJSLib/RouteSetup_getServer.expected b/javascript/ql/test/library-tests/frameworks/NodeJSLib/RouteSetup_getServer.expected deleted file mode 100644 index 0a44a2630fe4..000000000000 --- a/javascript/ql/test/library-tests/frameworks/NodeJSLib/RouteSetup_getServer.expected +++ /dev/null @@ -1,8 +0,0 @@ -| src/http.js:4:14:10:2 | http.cr ... foo;\\n}) | src/http.js:4:14:10:2 | http.cr ... foo;\\n}) | -| src/http.js:12:1:16:2 | http.cr ... r");\\n}) | src/http.js:12:1:16:2 | http.cr ... r");\\n}) | -| src/http.js:57:1:57:31 | http.cr ... dler()) | src/http.js:57:1:57:31 | http.cr ... dler()) | -| src/http.js:60:1:60:33 | createS ... res){}) | src/http.js:60:1:60:33 | createS ... res){}) | -| src/http.js:62:1:65:2 | http.cr ... 2");\\n}) | src/http.js:62:1:65:2 | http.cr ... 2");\\n}) | -| src/http.js:70:1:70:36 | http.cr ... dler()) | src/http.js:70:1:70:36 | http.cr ... dler()) | -| src/https.js:4:14:10:2 | https.c ... foo;\\n}) | src/https.js:4:14:10:2 | https.c ... foo;\\n}) | -| src/https.js:12:1:16:2 | https.c ... r");\\n}) | src/https.js:12:1:16:2 | https.c ... r");\\n}) | diff --git a/javascript/ql/test/library-tests/frameworks/NodeJSLib/RouteSetup_getServer.ql b/javascript/ql/test/library-tests/frameworks/NodeJSLib/RouteSetup_getServer.ql deleted file mode 100644 index 2ba5da8eba65..000000000000 --- a/javascript/ql/test/library-tests/frameworks/NodeJSLib/RouteSetup_getServer.ql +++ /dev/null @@ -1,4 +0,0 @@ -import javascript - -from NodeJSLib::RouteSetup r -select r, r.getServer() diff --git a/javascript/ql/test/library-tests/frameworks/NodeJSLib/RouteSetup_getServer.qll b/javascript/ql/test/library-tests/frameworks/NodeJSLib/RouteSetup_getServer.qll new file mode 100644 index 000000000000..a10c7e0da8e7 --- /dev/null +++ b/javascript/ql/test/library-tests/frameworks/NodeJSLib/RouteSetup_getServer.qll @@ -0,0 +1,3 @@ +import javascript + +query predicate test_RouteSetup_getServer(NodeJSLib::RouteSetup r, Expr res) { res = r.getServer() } diff --git a/javascript/ql/test/library-tests/frameworks/NodeJSLib/ServerDefinition.expected b/javascript/ql/test/library-tests/frameworks/NodeJSLib/ServerDefinition.expected deleted file mode 100644 index 66017986d4c7..000000000000 --- a/javascript/ql/test/library-tests/frameworks/NodeJSLib/ServerDefinition.expected +++ /dev/null @@ -1,8 +0,0 @@ -| src/http.js:4:14:10:2 | http.cr ... foo;\\n}) | -| src/http.js:12:1:16:2 | http.cr ... r");\\n}) | -| src/http.js:57:1:57:31 | http.cr ... dler()) | -| src/http.js:60:1:60:33 | createS ... res){}) | -| src/http.js:62:1:65:2 | http.cr ... 2");\\n}) | -| src/http.js:70:1:70:36 | http.cr ... dler()) | -| src/https.js:4:14:10:2 | https.c ... foo;\\n}) | -| src/https.js:12:1:16:2 | https.c ... r");\\n}) | diff --git a/javascript/ql/test/library-tests/frameworks/NodeJSLib/ServerDefinition.ql b/javascript/ql/test/library-tests/frameworks/NodeJSLib/ServerDefinition.ql deleted file mode 100644 index f0e646694ad5..000000000000 --- a/javascript/ql/test/library-tests/frameworks/NodeJSLib/ServerDefinition.ql +++ /dev/null @@ -1,4 +0,0 @@ -import javascript - -from NodeJSLib::ServerDefinition s -select s diff --git a/javascript/ql/test/library-tests/frameworks/NodeJSLib/ServerDefinition.qll b/javascript/ql/test/library-tests/frameworks/NodeJSLib/ServerDefinition.qll new file mode 100644 index 000000000000..2f77da4524e4 --- /dev/null +++ b/javascript/ql/test/library-tests/frameworks/NodeJSLib/ServerDefinition.qll @@ -0,0 +1,3 @@ +import javascript + +query predicate test_ServerDefinition(NodeJSLib::ServerDefinition s) { any() } diff --git a/javascript/ql/test/library-tests/frameworks/NodeJSLib/ServerDefinition_getARouteHandler.expected b/javascript/ql/test/library-tests/frameworks/NodeJSLib/ServerDefinition_getARouteHandler.expected deleted file mode 100644 index 722c13b5302c..000000000000 --- a/javascript/ql/test/library-tests/frameworks/NodeJSLib/ServerDefinition_getARouteHandler.expected +++ /dev/null @@ -1,8 +0,0 @@ -| src/http.js:4:14:10:2 | http.cr ... foo;\\n}) | src/http.js:4:32:10:1 | functio ... .foo;\\n} | -| src/http.js:12:1:16:2 | http.cr ... r");\\n}) | src/http.js:12:19:16:1 | functio ... ar");\\n} | -| src/http.js:57:1:57:31 | http.cr ... dler()) | src/http.js:55:12:55:30 | function(req,res){} | -| src/http.js:60:1:60:33 | createS ... res){}) | src/http.js:60:14:60:32 | function(req,res){} | -| src/http.js:62:1:65:2 | http.cr ... 2");\\n}) | src/http.js:62:19:65:1 | functio ... r2");\\n} | -| src/http.js:70:1:70:36 | http.cr ... dler()) | src/http.js:68:12:68:27 | (req,res) => f() | -| src/https.js:4:14:10:2 | https.c ... foo;\\n}) | src/https.js:4:33:10:1 | functio ... .foo;\\n} | -| src/https.js:12:1:16:2 | https.c ... r");\\n}) | src/https.js:12:20:16:1 | functio ... ar");\\n} | diff --git a/javascript/ql/test/library-tests/frameworks/NodeJSLib/ServerDefinition_getARouteHandler.ql b/javascript/ql/test/library-tests/frameworks/NodeJSLib/ServerDefinition_getARouteHandler.ql deleted file mode 100644 index ca175fa092a8..000000000000 --- a/javascript/ql/test/library-tests/frameworks/NodeJSLib/ServerDefinition_getARouteHandler.ql +++ /dev/null @@ -1,4 +0,0 @@ -import javascript - -from NodeJSLib::ServerDefinition s -select s, s.getARouteHandler() diff --git a/javascript/ql/test/library-tests/frameworks/NodeJSLib/ServerDefinition_getARouteHandler.qll b/javascript/ql/test/library-tests/frameworks/NodeJSLib/ServerDefinition_getARouteHandler.qll new file mode 100644 index 000000000000..1902689a53ee --- /dev/null +++ b/javascript/ql/test/library-tests/frameworks/NodeJSLib/ServerDefinition_getARouteHandler.qll @@ -0,0 +1,7 @@ +import javascript + +query predicate test_ServerDefinition_getARouteHandler( + NodeJSLib::ServerDefinition s, HTTP::RouteHandler res +) { + res = s.getARouteHandler() +} diff --git a/javascript/ql/test/library-tests/frameworks/NodeJSLib/SystemCommandExecution.expected b/javascript/ql/test/library-tests/frameworks/NodeJSLib/SystemCommandExecution.expected deleted file mode 100644 index c23266cb9166..000000000000 --- a/javascript/ql/test/library-tests/frameworks/NodeJSLib/SystemCommandExecution.expected +++ /dev/null @@ -1,6 +0,0 @@ -| es6-imported-exec.js:3:1:3:11 | exec("cmd") | es6-imported-exec.js:3:6:3:10 | "cmd" | -| exec.js:3:1:3:38 | cp.exec ... "], cb) | exec.js:3:13:3:18 | "node" | -| exec.js:4:1:4:47 | cp.exec ... sion"]) | exec.js:4:17:4:20 | "sh" | -| exec.js:5:1:5:23 | cp.fork ... "arg"]) | exec.js:5:9:5:13 | "foo" | -| exec.js:6:1:6:28 | cp.spaw ... "], cb) | exec.js:6:10:6:15 | "echo" | -| exec.js:7:1:7:37 | cp.spaw ... here"]) | exec.js:7:14:7:19 | "echo" | diff --git a/javascript/ql/test/library-tests/frameworks/NodeJSLib/SystemCommandExecution.ql b/javascript/ql/test/library-tests/frameworks/NodeJSLib/SystemCommandExecution.ql deleted file mode 100644 index 11754ec54c4c..000000000000 --- a/javascript/ql/test/library-tests/frameworks/NodeJSLib/SystemCommandExecution.ql +++ /dev/null @@ -1,4 +0,0 @@ -import javascript - -from SystemCommandExecution cmd -select cmd, cmd.getACommandArgument() diff --git a/javascript/ql/test/library-tests/frameworks/NodeJSLib/SystemCommandExecution.qll b/javascript/ql/test/library-tests/frameworks/NodeJSLib/SystemCommandExecution.qll new file mode 100644 index 000000000000..4df4b65d72cb --- /dev/null +++ b/javascript/ql/test/library-tests/frameworks/NodeJSLib/SystemCommandExecution.qll @@ -0,0 +1,5 @@ +import javascript + +query predicate test_SystemCommandExecution(SystemCommandExecution cmd, DataFlow::Node res) { + res = cmd.getACommandArgument() +} diff --git a/javascript/ql/test/library-tests/frameworks/NodeJSLib/SystemCommandExecution_getAnArgumentForCommand.expected b/javascript/ql/test/library-tests/frameworks/NodeJSLib/SystemCommandExecution_getAnArgumentForCommand.expected deleted file mode 100644 index 43dbd74f4add..000000000000 --- a/javascript/ql/test/library-tests/frameworks/NodeJSLib/SystemCommandExecution_getAnArgumentForCommand.expected +++ /dev/null @@ -1,5 +0,0 @@ -| exec.js:3:1:3:38 | cp.exec ... "], cb) | exec.js:3:21:3:33 | ["--version"] | -| exec.js:4:1:4:47 | cp.exec ... sion"]) | exec.js:4:23:4:46 | ["-c", ... rsion"] | -| exec.js:5:1:5:23 | cp.fork ... "arg"]) | exec.js:5:16:5:22 | ["arg"] | -| exec.js:6:1:6:28 | cp.spaw ... "], cb) | exec.js:6:18:6:23 | ["Hi"] | -| exec.js:7:1:7:37 | cp.spaw ... here"]) | exec.js:7:22:7:36 | ["Hi", "there"] | diff --git a/javascript/ql/test/library-tests/frameworks/NodeJSLib/SystemCommandExecution_getAnArgumentForCommand.ql b/javascript/ql/test/library-tests/frameworks/NodeJSLib/SystemCommandExecution_getAnArgumentForCommand.ql deleted file mode 100644 index 56166a9aab95..000000000000 --- a/javascript/ql/test/library-tests/frameworks/NodeJSLib/SystemCommandExecution_getAnArgumentForCommand.ql +++ /dev/null @@ -1,4 +0,0 @@ -import javascript - -from SystemCommandExecution cmd -select cmd, cmd.getArgumentList() diff --git a/javascript/ql/test/library-tests/frameworks/NodeJSLib/SystemCommandExecution_getAnArgumentForCommand.qll b/javascript/ql/test/library-tests/frameworks/NodeJSLib/SystemCommandExecution_getAnArgumentForCommand.qll new file mode 100644 index 000000000000..a8835dde4df7 --- /dev/null +++ b/javascript/ql/test/library-tests/frameworks/NodeJSLib/SystemCommandExecution_getAnArgumentForCommand.qll @@ -0,0 +1,7 @@ +import javascript + +query predicate test_SystemCommandExecution_getAnArgumentForCommand( + SystemCommandExecution cmd, DataFlow::Node res +) { + res = cmd.getArgumentList() +} diff --git a/javascript/ql/test/library-tests/frameworks/NodeJSLib/isCreateServer.expected b/javascript/ql/test/library-tests/frameworks/NodeJSLib/isCreateServer.expected deleted file mode 100644 index 66017986d4c7..000000000000 --- a/javascript/ql/test/library-tests/frameworks/NodeJSLib/isCreateServer.expected +++ /dev/null @@ -1,8 +0,0 @@ -| src/http.js:4:14:10:2 | http.cr ... foo;\\n}) | -| src/http.js:12:1:16:2 | http.cr ... r");\\n}) | -| src/http.js:57:1:57:31 | http.cr ... dler()) | -| src/http.js:60:1:60:33 | createS ... res){}) | -| src/http.js:62:1:65:2 | http.cr ... 2");\\n}) | -| src/http.js:70:1:70:36 | http.cr ... dler()) | -| src/https.js:4:14:10:2 | https.c ... foo;\\n}) | -| src/https.js:12:1:16:2 | https.c ... r");\\n}) | diff --git a/javascript/ql/test/library-tests/frameworks/NodeJSLib/isCreateServer.ql b/javascript/ql/test/library-tests/frameworks/NodeJSLib/isCreateServer.ql deleted file mode 100644 index c7ddeedd5b73..000000000000 --- a/javascript/ql/test/library-tests/frameworks/NodeJSLib/isCreateServer.ql +++ /dev/null @@ -1,5 +0,0 @@ -import javascript - -from CallExpr e -where NodeJSLib::isCreateServer(e) -select e diff --git a/javascript/ql/test/library-tests/frameworks/NodeJSLib/isCreateServer.qll b/javascript/ql/test/library-tests/frameworks/NodeJSLib/isCreateServer.qll new file mode 100644 index 000000000000..86bcb37b728c --- /dev/null +++ b/javascript/ql/test/library-tests/frameworks/NodeJSLib/isCreateServer.qll @@ -0,0 +1,3 @@ +import javascript + +query predicate test_isCreateServer(CallExpr e) { NodeJSLib::isCreateServer(e) } diff --git a/javascript/ql/test/library-tests/frameworks/NodeJSLib/tests.expected b/javascript/ql/test/library-tests/frameworks/NodeJSLib/tests.expected new file mode 100644 index 000000000000..eae1e1312907 --- /dev/null +++ b/javascript/ql/test/library-tests/frameworks/NodeJSLib/tests.expected @@ -0,0 +1,172 @@ +test_isCreateServer +| src/http.js:4:14:10:2 | http.cr ... foo;\\n}) | +| src/http.js:12:1:16:2 | http.cr ... r");\\n}) | +| src/http.js:57:1:57:31 | http.cr ... dler()) | +| src/http.js:60:1:60:33 | createS ... res){}) | +| src/http.js:62:1:65:2 | http.cr ... 2");\\n}) | +| src/http.js:70:1:70:36 | http.cr ... dler()) | +| src/https.js:4:14:10:2 | https.c ... foo;\\n}) | +| src/https.js:12:1:16:2 | https.c ... r");\\n}) | +test_RequestInputAccess +| src/http.js:6:26:6:32 | req.url | url | src/http.js:4:32:10:1 | functio ... .foo;\\n} | +| src/http.js:8:3:8:20 | req.headers.cookie | cookie | src/http.js:4:32:10:1 | functio ... .foo;\\n} | +| src/http.js:9:3:9:17 | req.headers.foo | header | src/http.js:4:32:10:1 | functio ... .foo;\\n} | +| src/https.js:6:26:6:32 | req.url | url | src/https.js:4:33:10:1 | functio ... .foo;\\n} | +| src/https.js:8:3:8:20 | req.headers.cookie | cookie | src/https.js:4:33:10:1 | functio ... .foo;\\n} | +| src/https.js:9:3:9:17 | req.headers.foo | header | src/https.js:4:33:10:1 | functio ... .foo;\\n} | +test_RouteHandler_getAResponseHeader +| src/http.js:4:32:10:1 | functio ... .foo;\\n} | location | src/http.js:7:3:7:42 | res.wri ... rget }) | +| src/http.js:12:19:16:1 | functio ... ar");\\n} | content-type | src/http.js:13:3:13:44 | res.set ... /html') | +| src/https.js:4:33:10:1 | functio ... .foo;\\n} | location | src/https.js:7:3:7:42 | res.wri ... rget }) | +| src/https.js:12:20:16:1 | functio ... ar");\\n} | content-type | src/https.js:13:3:13:44 | res.set ... /html') | +test_HeaderDefinition_defines +| src/http.js:13:3:13:44 | res.set ... /html') | content-type | text/html | +| src/https.js:13:3:13:44 | res.set ... /html') | content-type | text/html | +test_SystemCommandExecution +| es6-imported-exec.js:3:1:3:11 | exec("cmd") | es6-imported-exec.js:3:6:3:10 | "cmd" | +| exec.js:3:1:3:38 | cp.exec ... "], cb) | exec.js:3:13:3:18 | "node" | +| exec.js:4:1:4:47 | cp.exec ... sion"]) | exec.js:4:17:4:20 | "sh" | +| exec.js:5:1:5:23 | cp.fork ... "arg"]) | exec.js:5:9:5:13 | "foo" | +| exec.js:6:1:6:28 | cp.spaw ... "], cb) | exec.js:6:10:6:15 | "echo" | +| exec.js:7:1:7:37 | cp.spaw ... here"]) | exec.js:7:14:7:19 | "echo" | +test_ResponseExpr +| src/http.js:7:3:7:5 | res | src/http.js:4:32:10:1 | functio ... .foo;\\n} | +| src/http.js:13:3:13:5 | res | src/http.js:12:19:16:1 | functio ... ar");\\n} | +| src/http.js:14:3:14:5 | res | src/http.js:12:19:16:1 | functio ... ar");\\n} | +| src/http.js:15:3:15:5 | res | src/http.js:12:19:16:1 | functio ... ar");\\n} | +| src/http.js:63:3:63:5 | res | src/http.js:62:19:65:1 | functio ... r2");\\n} | +| src/http.js:64:3:64:5 | res | src/http.js:62:19:65:1 | functio ... r2");\\n} | +| src/https.js:7:3:7:5 | res | src/https.js:4:33:10:1 | functio ... .foo;\\n} | +| src/https.js:13:3:13:5 | res | src/https.js:12:20:16:1 | functio ... ar");\\n} | +| src/https.js:14:3:14:5 | res | src/https.js:12:20:16:1 | functio ... ar");\\n} | +| src/https.js:15:3:15:5 | res | src/https.js:12:20:16:1 | functio ... ar");\\n} | +test_HeaderDefinition +| src/http.js:7:3:7:42 | res.wri ... rget }) | src/http.js:4:32:10:1 | functio ... .foo;\\n} | +| src/http.js:13:3:13:44 | res.set ... /html') | src/http.js:12:19:16:1 | functio ... ar");\\n} | +| src/http.js:63:3:63:40 | res.set ... , "23") | src/http.js:62:19:65:1 | functio ... r2");\\n} | +| src/https.js:7:3:7:42 | res.wri ... rget }) | src/https.js:4:33:10:1 | functio ... .foo;\\n} | +| src/https.js:13:3:13:44 | res.set ... /html') | src/https.js:12:20:16:1 | functio ... ar");\\n} | +test_RouteSetup_getServer +| src/http.js:4:14:10:2 | http.cr ... foo;\\n}) | src/http.js:4:14:10:2 | http.cr ... foo;\\n}) | +| src/http.js:12:1:16:2 | http.cr ... r");\\n}) | src/http.js:12:1:16:2 | http.cr ... r");\\n}) | +| src/http.js:57:1:57:31 | http.cr ... dler()) | src/http.js:57:1:57:31 | http.cr ... dler()) | +| src/http.js:60:1:60:33 | createS ... res){}) | src/http.js:60:1:60:33 | createS ... res){}) | +| src/http.js:62:1:65:2 | http.cr ... 2");\\n}) | src/http.js:62:1:65:2 | http.cr ... 2");\\n}) | +| src/http.js:70:1:70:36 | http.cr ... dler()) | src/http.js:70:1:70:36 | http.cr ... dler()) | +| src/https.js:4:14:10:2 | https.c ... foo;\\n}) | src/https.js:4:14:10:2 | https.c ... foo;\\n}) | +| src/https.js:12:1:16:2 | https.c ... r");\\n}) | src/https.js:12:1:16:2 | https.c ... r");\\n}) | +test_ClientRequest +| src/http.js:18:1:18:30 | http.re ... uth" }) | +| src/http.js:21:15:26:6 | http.re ... \\n }) | +| src/http.js:27:16:27:73 | http.re ... POST'}) | +| src/https.js:18:1:18:31 | https.r ... uth" }) | +test_HeaderDefinition_getAHeaderName +| src/http.js:7:3:7:42 | res.wri ... rget }) | location | +| src/http.js:13:3:13:44 | res.set ... /html') | content-type | +| src/https.js:7:3:7:42 | res.wri ... rget }) | location | +| src/https.js:13:3:13:44 | res.set ... /html') | content-type | +test_ServerDefinition +| src/http.js:4:14:10:2 | http.cr ... foo;\\n}) | +| src/http.js:12:1:16:2 | http.cr ... r");\\n}) | +| src/http.js:57:1:57:31 | http.cr ... dler()) | +| src/http.js:60:1:60:33 | createS ... res){}) | +| src/http.js:62:1:65:2 | http.cr ... 2");\\n}) | +| src/http.js:70:1:70:36 | http.cr ... dler()) | +| src/https.js:4:14:10:2 | https.c ... foo;\\n}) | +| src/https.js:12:1:16:2 | https.c ... r");\\n}) | +test_HeaderAccess +| src/http.js:9:3:9:17 | req.headers.foo | foo | +| src/https.js:9:3:9:17 | req.headers.foo | foo | +test_HeaderDefinition_getNameExpr +| src/http.js:7:3:7:42 | res.wri ... rget }) | src/http.js:7:17:7:19 | 302 | +| src/http.js:13:3:13:44 | res.set ... /html') | src/http.js:13:17:13:30 | 'Content-Type' | +| src/http.js:63:3:63:40 | res.set ... , "23") | src/http.js:63:17:63:33 | req.query.myParam | +| src/https.js:7:3:7:42 | res.wri ... rget }) | src/https.js:7:17:7:19 | 302 | +| src/https.js:13:3:13:44 | res.set ... /html') | src/https.js:13:17:13:30 | 'Content-Type' | +test_RouteHandler_getAResponseExpr +| src/http.js:4:32:10:1 | functio ... .foo;\\n} | src/http.js:7:3:7:5 | res | +| src/http.js:12:19:16:1 | functio ... ar");\\n} | src/http.js:13:3:13:5 | res | +| src/http.js:12:19:16:1 | functio ... ar");\\n} | src/http.js:14:3:14:5 | res | +| src/http.js:12:19:16:1 | functio ... ar");\\n} | src/http.js:15:3:15:5 | res | +| src/http.js:62:19:65:1 | functio ... r2");\\n} | src/http.js:63:3:63:5 | res | +| src/http.js:62:19:65:1 | functio ... r2");\\n} | src/http.js:64:3:64:5 | res | +| src/https.js:4:33:10:1 | functio ... .foo;\\n} | src/https.js:7:3:7:5 | res | +| src/https.js:12:20:16:1 | functio ... ar");\\n} | src/https.js:13:3:13:5 | res | +| src/https.js:12:20:16:1 | functio ... ar");\\n} | src/https.js:14:3:14:5 | res | +| src/https.js:12:20:16:1 | functio ... ar");\\n} | src/https.js:15:3:15:5 | res | +test_ServerDefinition_getARouteHandler +| src/http.js:4:14:10:2 | http.cr ... foo;\\n}) | src/http.js:4:32:10:1 | functio ... .foo;\\n} | +| src/http.js:12:1:16:2 | http.cr ... r");\\n}) | src/http.js:12:19:16:1 | functio ... ar");\\n} | +| src/http.js:57:1:57:31 | http.cr ... dler()) | src/http.js:55:12:55:30 | function(req,res){} | +| src/http.js:60:1:60:33 | createS ... res){}) | src/http.js:60:14:60:32 | function(req,res){} | +| src/http.js:62:1:65:2 | http.cr ... 2");\\n}) | src/http.js:62:19:65:1 | functio ... r2");\\n} | +| src/http.js:70:1:70:36 | http.cr ... dler()) | src/http.js:68:12:68:27 | (req,res) => f() | +| src/https.js:4:14:10:2 | https.c ... foo;\\n}) | src/https.js:4:33:10:1 | functio ... .foo;\\n} | +| src/https.js:12:1:16:2 | https.c ... r");\\n}) | src/https.js:12:20:16:1 | functio ... ar");\\n} | +test_ResponseSendArgument +| src/http.js:14:13:14:17 | "foo" | src/http.js:12:19:16:1 | functio ... ar");\\n} | +| src/http.js:15:11:15:15 | "bar" | src/http.js:12:19:16:1 | functio ... ar");\\n} | +| src/http.js:64:11:64:16 | "bar2" | src/http.js:62:19:65:1 | functio ... r2");\\n} | +| src/https.js:14:13:14:17 | "foo" | src/https.js:12:20:16:1 | functio ... ar");\\n} | +| src/https.js:15:11:15:15 | "bar" | src/https.js:12:20:16:1 | functio ... ar");\\n} | +test_RouteSetup_getARouteHandler +| src/http.js:4:14:10:2 | http.cr ... foo;\\n}) | src/http.js:4:32:10:1 | functio ... .foo;\\n} | +| src/http.js:12:1:16:2 | http.cr ... r");\\n}) | src/http.js:12:19:16:1 | functio ... ar");\\n} | +| src/http.js:57:1:57:31 | http.cr ... dler()) | src/http.js:55:12:55:30 | function(req,res){} | +| src/http.js:57:1:57:31 | http.cr ... dler()) | src/http.js:57:19:57:30 | getHandler() | +| src/http.js:60:1:60:33 | createS ... res){}) | src/http.js:60:14:60:32 | function(req,res){} | +| src/http.js:62:1:65:2 | http.cr ... 2");\\n}) | src/http.js:62:19:65:1 | functio ... r2");\\n} | +| src/http.js:70:1:70:36 | http.cr ... dler()) | src/http.js:68:12:68:27 | (req,res) => f() | +| src/http.js:70:1:70:36 | http.cr ... dler()) | src/http.js:70:19:70:35 | getArrowHandler() | +| src/https.js:4:14:10:2 | https.c ... foo;\\n}) | src/https.js:4:33:10:1 | functio ... .foo;\\n} | +| src/https.js:12:1:16:2 | https.c ... r");\\n}) | src/https.js:12:20:16:1 | functio ... ar");\\n} | +test_ClientRequest_getADataNode +| src/http.js:27:16:27:73 | http.re ... POST'}) | src/http.js:50:16:50:22 | 'stuff' | +| src/http.js:27:16:27:73 | http.re ... POST'}) | src/http.js:51:14:51:25 | 'more stuff' | +test_RemoteFlowSources +| src/http.js:6:26:6:32 | req.url | +| src/http.js:8:3:8:20 | req.headers.cookie | +| src/http.js:9:3:9:17 | req.headers.foo | +| src/http.js:21:33:21:40 | response | +| src/http.js:23:28:23:32 | chunk | +| src/http.js:29:26:29:33 | response | +| src/http.js:30:28:30:32 | chunk | +| src/http.js:40:23:40:30 | authInfo | +| src/http.js:45:23:45:27 | error | +| src/https.js:6:26:6:32 | req.url | +| src/https.js:8:3:8:20 | req.headers.cookie | +| src/https.js:9:3:9:17 | req.headers.foo | +test_RouteHandler +| src/http.js:4:32:10:1 | functio ... .foo;\\n} | src/http.js:4:14:10:2 | http.cr ... foo;\\n}) | +| src/http.js:12:19:16:1 | functio ... ar");\\n} | src/http.js:12:1:16:2 | http.cr ... r");\\n}) | +| src/http.js:55:12:55:30 | function(req,res){} | src/http.js:57:1:57:31 | http.cr ... dler()) | +| src/http.js:60:14:60:32 | function(req,res){} | src/http.js:60:1:60:33 | createS ... res){}) | +| src/http.js:62:19:65:1 | functio ... r2");\\n} | src/http.js:62:1:65:2 | http.cr ... 2");\\n}) | +| src/http.js:68:12:68:27 | (req,res) => f() | src/http.js:70:1:70:36 | http.cr ... dler()) | +| src/https.js:4:33:10:1 | functio ... .foo;\\n} | src/https.js:4:14:10:2 | https.c ... foo;\\n}) | +| src/https.js:12:20:16:1 | functio ... ar");\\n} | src/https.js:12:1:16:2 | https.c ... r");\\n}) | +test_RequestExpr +| src/http.js:6:26:6:28 | req | src/http.js:4:32:10:1 | functio ... .foo;\\n} | +| src/http.js:8:3:8:5 | req | src/http.js:4:32:10:1 | functio ... .foo;\\n} | +| src/http.js:9:3:9:5 | req | src/http.js:4:32:10:1 | functio ... .foo;\\n} | +| src/http.js:63:17:63:19 | req | src/http.js:62:19:65:1 | functio ... r2");\\n} | +| src/https.js:6:26:6:28 | req | src/https.js:4:33:10:1 | functio ... .foo;\\n} | +| src/https.js:8:3:8:5 | req | src/https.js:4:33:10:1 | functio ... .foo;\\n} | +| src/https.js:9:3:9:5 | req | src/https.js:4:33:10:1 | functio ... .foo;\\n} | +test_SystemCommandExecution_getAnArgumentForCommand +| exec.js:3:1:3:38 | cp.exec ... "], cb) | exec.js:3:21:3:33 | ["--version"] | +| exec.js:4:1:4:47 | cp.exec ... sion"]) | exec.js:4:23:4:46 | ["-c", ... rsion"] | +| exec.js:5:1:5:23 | cp.fork ... "arg"]) | exec.js:5:16:5:22 | ["arg"] | +| exec.js:6:1:6:28 | cp.spaw ... "], cb) | exec.js:6:18:6:23 | ["Hi"] | +| exec.js:7:1:7:37 | cp.spaw ... here"]) | exec.js:7:22:7:36 | ["Hi", "there"] | +test_Credentials +| src/http.js:18:22:18:27 | "auth" | credentials | +| src/https.js:18:23:18:28 | "auth" | credentials | +test_RouteHandler_getARequestExpr +| src/http.js:4:32:10:1 | functio ... .foo;\\n} | src/http.js:6:26:6:28 | req | +| src/http.js:4:32:10:1 | functio ... .foo;\\n} | src/http.js:8:3:8:5 | req | +| src/http.js:4:32:10:1 | functio ... .foo;\\n} | src/http.js:9:3:9:5 | req | +| src/http.js:62:19:65:1 | functio ... r2");\\n} | src/http.js:63:17:63:19 | req | +| src/https.js:4:33:10:1 | functio ... .foo;\\n} | src/https.js:6:26:6:28 | req | +| src/https.js:4:33:10:1 | functio ... .foo;\\n} | src/https.js:8:3:8:5 | req | +| src/https.js:4:33:10:1 | functio ... .foo;\\n} | src/https.js:9:3:9:5 | req | diff --git a/javascript/ql/test/library-tests/frameworks/NodeJSLib/tests.ql b/javascript/ql/test/library-tests/frameworks/NodeJSLib/tests.ql new file mode 100644 index 000000000000..e0fb90f8c630 --- /dev/null +++ b/javascript/ql/test/library-tests/frameworks/NodeJSLib/tests.ql @@ -0,0 +1,24 @@ +import isCreateServer +import RequestInputAccess +import RouteHandler_getAResponseHeader +import HeaderDefinition_defines +import SystemCommandExecution +import ResponseExpr +import HeaderDefinition +import RouteSetup_getServer +import ClientRequest +import HeaderDefinition_getAHeaderName +import ServerDefinition +import HeaderAccess +import HeaderDefinition_getNameExpr +import RouteHandler_getAResponseExpr +import ServerDefinition_getARouteHandler +import ResponseSendArgument +import RouteSetup_getARouteHandler +import ClientRequest_getADataNode +import RemoteFlowSources +import RouteHandler +import RequestExpr +import SystemCommandExecution_getAnArgumentForCommand +import Credentials +import RouteHandler_getARequestExpr diff --git a/javascript/ql/test/library-tests/frameworks/ReactJS/ReactComponent.expected b/javascript/ql/test/library-tests/frameworks/ReactJS/ReactComponent.expected deleted file mode 100644 index cf3d382e0f55..000000000000 --- a/javascript/ql/test/library-tests/frameworks/ReactJS/ReactComponent.expected +++ /dev/null @@ -1,26 +0,0 @@ -| es5.js:1:31:11:1 | {\\n dis ... ;\\n }\\n} | -| es5.js:18:33:22:1 | {\\n ren ... ;\\n }\\n} | -| es6.js:1:1:8:1 | class H ... ;\\n }\\n} | -| es6.js:14:1:20:1 | class H ... }\\n} | -| namedImport.js:3:1:3:28 | class C ... nent {} | -| namedImport.js:5:1:5:20 | class D extends C {} | -| plainfn.js:1:1:3:1 | functio ... div>;\\n} | -| plainfn.js:5:1:7:1 | functio ... iv");\\n} | -| plainfn.js:9:1:12:1 | functio ... rn x;\\n} | -| plainfn.js:20:1:24:1 | functio ... n 42;\\n} | -| preact.js:1:1:7:1 | class H ... }\\n} | -| preact.js:9:1:11:1 | class H ... nt {\\n\\n} | -| probably-a-component.js:1:1:6:1 | class H ... }\\n} | -| props.js:2:5:3:5 | class C ... {\\n } | -| props.js:13:31:17:5 | {\\n ... }\\n } | -| props.js:26:5:28:5 | functio ... ;\\n } | -| rare-lifecycle-methods.js:1:1:11:1 | class C ... }\\n} | -| statePropertyReads.js:1:1:13:1 | class R ... }\\n} | -| statePropertyWrites.js:1:1:34:1 | class W ... };\\n} | -| statePropertyWrites.js:36:19:45:1 | {\\n ren ... ;\\n }\\n} | -| thisAccesses.js:1:1:16:1 | class C ... }\\n} | -| thisAccesses.js:18:19:29:1 | {\\n r ... }\\n} | -| thisAccesses.js:31:2:36:1 | functio ... iv/>;\\n} | -| thisAccesses.js:38:19:45:1 | {\\n r ... },\\n} | -| thisAccesses.js:47:1:52:1 | class C ... }\\n} | -| thisAccesses_importedMappers.js:4:19:15:1 | {\\n r ... },\\n} | diff --git a/javascript/ql/test/library-tests/frameworks/ReactJS/ReactComponent.ql b/javascript/ql/test/library-tests/frameworks/ReactJS/ReactComponent.ql deleted file mode 100644 index 69e4d9b20b05..000000000000 --- a/javascript/ql/test/library-tests/frameworks/ReactJS/ReactComponent.ql +++ /dev/null @@ -1,4 +0,0 @@ -import semmle.javascript.frameworks.React - -from ReactComponent c -select c diff --git a/javascript/ql/test/library-tests/frameworks/ReactJS/ReactComponent.qll b/javascript/ql/test/library-tests/frameworks/ReactJS/ReactComponent.qll new file mode 100644 index 000000000000..a48c6b8f1c94 --- /dev/null +++ b/javascript/ql/test/library-tests/frameworks/ReactJS/ReactComponent.qll @@ -0,0 +1,3 @@ +import semmle.javascript.frameworks.React + +query predicate test_ReactComponent(ReactComponent c) { any() } diff --git a/javascript/ql/test/library-tests/frameworks/ReactJS/ReactComponent_getACandidatePropsValue.expected b/javascript/ql/test/library-tests/frameworks/ReactJS/ReactComponent_getACandidatePropsValue.expected deleted file mode 100644 index c92d3dea4f45..000000000000 --- a/javascript/ql/test/library-tests/frameworks/ReactJS/ReactComponent_getACandidatePropsValue.expected +++ /dev/null @@ -1,10 +0,0 @@ -| es5.js:8:13:8:19 | 'world' | -| props.js:5:46:5:67 | "propFr ... tProps" | -| props.js:7:22:7:34 | "propFromJSX" | -| props.js:9:33:9:53 | "propFr ... ructor" | -| props.js:15:44:15:65 | "propFr ... tProps" | -| props.js:19:22:19:34 | "propFromJSX" | -| props.js:21:29:21:49 | "propFr ... ructor" | -| props.js:30:46:30:67 | "propFr ... tProps" | -| props.js:32:22:32:34 | "propFromJSX" | -| props.js:34:33:34:53 | "propFr ... ructor" | diff --git a/javascript/ql/test/library-tests/frameworks/ReactJS/ReactComponent_getACandidatePropsValue.ql b/javascript/ql/test/library-tests/frameworks/ReactJS/ReactComponent_getACandidatePropsValue.ql deleted file mode 100644 index 6a29fba7e1bd..000000000000 --- a/javascript/ql/test/library-tests/frameworks/ReactJS/ReactComponent_getACandidatePropsValue.ql +++ /dev/null @@ -1,4 +0,0 @@ -import javascript - -from ReactComponent c -select c.getACandidatePropsValue(_) diff --git a/javascript/ql/test/library-tests/frameworks/ReactJS/ReactComponent_getACandidatePropsValue.qll b/javascript/ql/test/library-tests/frameworks/ReactJS/ReactComponent_getACandidatePropsValue.qll new file mode 100644 index 000000000000..a551aa457eca --- /dev/null +++ b/javascript/ql/test/library-tests/frameworks/ReactJS/ReactComponent_getACandidatePropsValue.qll @@ -0,0 +1,5 @@ +import javascript + +query predicate test_ReactComponent_getACandidatePropsValue(DataFlow::Node res) { + exists(ReactComponent c | res = c.getACandidatePropsValue(_)) +} diff --git a/javascript/ql/test/library-tests/frameworks/ReactJS/ReactComponent_getACandidateStateSource.expected b/javascript/ql/test/library-tests/frameworks/ReactJS/ReactComponent_getACandidateStateSource.expected deleted file mode 100644 index c5fa0e3e513b..000000000000 --- a/javascript/ql/test/library-tests/frameworks/ReactJS/ReactComponent_getACandidateStateSource.expected +++ /dev/null @@ -1,12 +0,0 @@ -| es6.js:14:1:20:1 | class H ... }\\n} | es6.js:18:22:18:31 | { baz: 42} | -| rare-lifecycle-methods.js:1:1:11:1 | class C ... }\\n} | rare-lifecycle-methods.js:3:16:3:17 | {} | -| rare-lifecycle-methods.js:1:1:11:1 | class C ... }\\n} | rare-lifecycle-methods.js:5:38:5:46 | nextState | -| statePropertyReads.js:1:1:13:1 | class R ... }\\n} | statePropertyReads.js:7:45:7:56 | prevState.p3 | -| statePropertyWrites.js:1:1:34:1 | class W ... };\\n} | statePropertyWrites.js:8:18:8:19 | {} | -| statePropertyWrites.js:1:1:34:1 | class W ... };\\n} | statePropertyWrites.js:12:18:12:19 | {} | -| statePropertyWrites.js:1:1:34:1 | class W ... };\\n} | statePropertyWrites.js:16:18:16:19 | {} | -| statePropertyWrites.js:1:1:34:1 | class W ... };\\n} | statePropertyWrites.js:20:18:20:19 | {} | -| statePropertyWrites.js:1:1:34:1 | class W ... };\\n} | statePropertyWrites.js:31:13:33:5 | {\\n ... 2\\n } | -| statePropertyWrites.js:36:19:45:1 | {\\n ren ... ;\\n }\\n} | statePropertyWrites.js:41:12:43:5 | {\\n p8: 42\\n } | -| thisAccesses.js:47:1:52:1 | class C ... }\\n} | thisAccesses.js:48:18:48:18 | y | -| thisAccesses.js:47:1:52:1 | class C ... }\\n} | thisAccesses.js:49:22:49:22 | x | diff --git a/javascript/ql/test/library-tests/frameworks/ReactJS/ReactComponent_getACandidateStateSource.ql b/javascript/ql/test/library-tests/frameworks/ReactJS/ReactComponent_getACandidateStateSource.ql deleted file mode 100644 index bd0251ff2a9a..000000000000 --- a/javascript/ql/test/library-tests/frameworks/ReactJS/ReactComponent_getACandidateStateSource.ql +++ /dev/null @@ -1,4 +0,0 @@ -import semmle.javascript.frameworks.React - -from ReactComponent c -select c, c.getACandidateStateSource() diff --git a/javascript/ql/test/library-tests/frameworks/ReactJS/ReactComponent_getACandidateStateSource.qll b/javascript/ql/test/library-tests/frameworks/ReactJS/ReactComponent_getACandidateStateSource.qll new file mode 100644 index 000000000000..af6597ab96cf --- /dev/null +++ b/javascript/ql/test/library-tests/frameworks/ReactJS/ReactComponent_getACandidateStateSource.qll @@ -0,0 +1,7 @@ +import semmle.javascript.frameworks.React + +query predicate test_ReactComponent_getACandidateStateSource( + ReactComponent c, DataFlow::SourceNode res +) { + res = c.getACandidateStateSource() +} diff --git a/javascript/ql/test/library-tests/frameworks/ReactJS/ReactComponent_getADirectPropsSource.expected b/javascript/ql/test/library-tests/frameworks/ReactJS/ReactComponent_getADirectPropsSource.expected deleted file mode 100644 index 9015a11045a2..000000000000 --- a/javascript/ql/test/library-tests/frameworks/ReactJS/ReactComponent_getADirectPropsSource.expected +++ /dev/null @@ -1,21 +0,0 @@ -| es5.js:1:31:11:1 | {\\n dis ... ;\\n }\\n} | es5.js:4:24:4:33 | this.props | -| es5.js:18:33:22:1 | {\\n ren ... ;\\n }\\n} | es5.js:20:24:20:33 | this.props | -| es6.js:1:1:8:1 | class H ... ;\\n }\\n} | es6.js:1:37:1:36 | args | -| es6.js:1:1:8:1 | class H ... ;\\n }\\n} | es6.js:3:24:3:33 | this.props | -| namedImport.js:3:1:3:28 | class C ... nent {} | namedImport.js:3:27:3:26 | args | -| namedImport.js:5:1:5:20 | class D extends C {} | namedImport.js:5:19:5:18 | args | -| plainfn.js:1:1:3:1 | functio ... div>;\\n} | plainfn.js:1:16:1:20 | props | -| plainfn.js:5:1:7:1 | functio ... iv");\\n} | plainfn.js:5:17:5:21 | props | -| plainfn.js:9:1:12:1 | functio ... rn x;\\n} | plainfn.js:9:17:9:21 | props | -| plainfn.js:20:1:24:1 | functio ... n 42;\\n} | plainfn.js:20:28:20:32 | props | -| preact.js:1:1:7:1 | class H ... }\\n} | preact.js:1:38:1:37 | args | -| preact.js:1:1:7:1 | class H ... }\\n} | preact.js:2:12:2:16 | props | -| preact.js:9:1:11:1 | class H ... nt {\\n\\n} | preact.js:9:38:9:37 | args | -| probably-a-component.js:1:1:6:1 | class H ... }\\n} | probably-a-component.js:1:31:1:30 | args | -| probably-a-component.js:1:1:6:1 | class H ... }\\n} | probably-a-component.js:3:9:3:18 | this.props | -| props.js:2:5:3:5 | class C ... {\\n } | props.js:2:37:2:36 | args | -| props.js:26:5:28:5 | functio ... ;\\n } | props.js:26:16:26:20 | props | -| rare-lifecycle-methods.js:1:1:11:1 | class C ... }\\n} | rare-lifecycle-methods.js:1:33:1:32 | args | -| statePropertyWrites.js:36:19:45:1 | {\\n ren ... ;\\n }\\n} | statePropertyWrites.js:38:24:38:33 | this.props | -| thisAccesses.js:31:2:36:1 | functio ... iv/>;\\n} | thisAccesses.js:31:12:31:16 | props | -| thisAccesses.js:47:1:52:1 | class C ... }\\n} | thisAccesses.js:48:18:48:18 | y | diff --git a/javascript/ql/test/library-tests/frameworks/ReactJS/ReactComponent_getADirectPropsSource.ql b/javascript/ql/test/library-tests/frameworks/ReactJS/ReactComponent_getADirectPropsSource.ql deleted file mode 100644 index d42ecf9d6819..000000000000 --- a/javascript/ql/test/library-tests/frameworks/ReactJS/ReactComponent_getADirectPropsSource.ql +++ /dev/null @@ -1,4 +0,0 @@ -import semmle.javascript.frameworks.React - -from ReactComponent c -select c, c.getADirectPropsAccess() diff --git a/javascript/ql/test/library-tests/frameworks/ReactJS/ReactComponent_getADirectPropsSource.qll b/javascript/ql/test/library-tests/frameworks/ReactJS/ReactComponent_getADirectPropsSource.qll new file mode 100644 index 000000000000..9f9ebd89f8de --- /dev/null +++ b/javascript/ql/test/library-tests/frameworks/ReactJS/ReactComponent_getADirectPropsSource.qll @@ -0,0 +1,5 @@ +import semmle.javascript.frameworks.React + +query predicate test_ReactComponent_getADirectPropsSource(ReactComponent c, DataFlow::SourceNode res) { + res = c.getADirectPropsAccess() +} diff --git a/javascript/ql/test/library-tests/frameworks/ReactJS/ReactComponent_getAPreviousStateSource.expected b/javascript/ql/test/library-tests/frameworks/ReactJS/ReactComponent_getAPreviousStateSource.expected deleted file mode 100644 index f4e6c367ee7d..000000000000 --- a/javascript/ql/test/library-tests/frameworks/ReactJS/ReactComponent_getAPreviousStateSource.expected +++ /dev/null @@ -1,4 +0,0 @@ -| rare-lifecycle-methods.js:1:1:11:1 | class C ... }\\n} | rare-lifecycle-methods.js:2:44:2:48 | state | -| rare-lifecycle-methods.js:1:1:11:1 | class C ... }\\n} | rare-lifecycle-methods.js:8:40:8:48 | prevState | -| statePropertyReads.js:1:1:13:1 | class R ... }\\n} | statePropertyReads.js:7:24:7:32 | prevState | -| statePropertyReads.js:1:1:13:1 | class R ... }\\n} | statePropertyReads.js:10:35:10:43 | prevState | diff --git a/javascript/ql/test/library-tests/frameworks/ReactJS/ReactComponent_getAPreviousStateSource.ql b/javascript/ql/test/library-tests/frameworks/ReactJS/ReactComponent_getAPreviousStateSource.ql deleted file mode 100644 index c36d89d1b9b6..000000000000 --- a/javascript/ql/test/library-tests/frameworks/ReactJS/ReactComponent_getAPreviousStateSource.ql +++ /dev/null @@ -1,4 +0,0 @@ -import semmle.javascript.frameworks.React - -from ReactComponent c -select c, c.getAPreviousStateSource() diff --git a/javascript/ql/test/library-tests/frameworks/ReactJS/ReactComponent_getAPreviousStateSource.qll b/javascript/ql/test/library-tests/frameworks/ReactJS/ReactComponent_getAPreviousStateSource.qll new file mode 100644 index 000000000000..b1bfe312dae2 --- /dev/null +++ b/javascript/ql/test/library-tests/frameworks/ReactJS/ReactComponent_getAPreviousStateSource.qll @@ -0,0 +1,7 @@ +import semmle.javascript.frameworks.React + +query predicate test_ReactComponent_getAPreviousStateSource( + ReactComponent c, DataFlow::SourceNode res +) { + res = c.getAPreviousStateSource() +} diff --git a/javascript/ql/test/library-tests/frameworks/ReactJS/ReactComponent_getAPropRead.expected b/javascript/ql/test/library-tests/frameworks/ReactJS/ReactComponent_getAPropRead.expected deleted file mode 100644 index 1211b75f25e5..000000000000 --- a/javascript/ql/test/library-tests/frameworks/ReactJS/ReactComponent_getAPropRead.expected +++ /dev/null @@ -1,7 +0,0 @@ -| es5.js:1:31:11:1 | {\\n dis ... ;\\n }\\n} | name | es5.js:4:24:4:38 | this.props.name | -| es5.js:18:33:22:1 | {\\n ren ... ;\\n }\\n} | name | es5.js:20:24:20:38 | this.props.name | -| es6.js:1:1:8:1 | class H ... ;\\n }\\n} | name | es6.js:3:24:3:38 | this.props.name | -| plainfn.js:1:1:3:1 | functio ... div>;\\n} | name | plainfn.js:2:22:2:31 | props.name | -| preact.js:1:1:7:1 | class H ... }\\n} | name | preact.js:3:9:3:18 | props.name | -| probably-a-component.js:1:1:6:1 | class H ... }\\n} | name | probably-a-component.js:3:9:3:23 | this.props.name | -| statePropertyWrites.js:36:19:45:1 | {\\n ren ... ;\\n }\\n} | name | statePropertyWrites.js:38:24:38:38 | this.props.name | diff --git a/javascript/ql/test/library-tests/frameworks/ReactJS/ReactComponent_getAPropRead.ql b/javascript/ql/test/library-tests/frameworks/ReactJS/ReactComponent_getAPropRead.ql deleted file mode 100644 index f82a56f02739..000000000000 --- a/javascript/ql/test/library-tests/frameworks/ReactJS/ReactComponent_getAPropRead.ql +++ /dev/null @@ -1,4 +0,0 @@ -import semmle.javascript.frameworks.React - -from ReactComponent c, string n -select c, n, c.getAPropRead(n) diff --git a/javascript/ql/test/library-tests/frameworks/ReactJS/ReactComponent_getAPropRead.qll b/javascript/ql/test/library-tests/frameworks/ReactJS/ReactComponent_getAPropRead.qll new file mode 100644 index 000000000000..0ff2a588a029 --- /dev/null +++ b/javascript/ql/test/library-tests/frameworks/ReactJS/ReactComponent_getAPropRead.qll @@ -0,0 +1,5 @@ +import semmle.javascript.frameworks.React + +query predicate test_ReactComponent_getAPropRead(ReactComponent c, string n, DataFlow::PropRead res) { + res = c.getAPropRead(n) +} diff --git a/javascript/ql/test/library-tests/frameworks/ReactJS/ReactComponent_getInstanceMethod.expected b/javascript/ql/test/library-tests/frameworks/ReactJS/ReactComponent_getInstanceMethod.expected deleted file mode 100644 index 97c86efb4bb4..000000000000 --- a/javascript/ql/test/library-tests/frameworks/ReactJS/ReactComponent_getInstanceMethod.expected +++ /dev/null @@ -1,24 +0,0 @@ -| es5.js:1:31:11:1 | {\\n dis ... ;\\n }\\n} | getDefaultProps | es5.js:6:20:10:3 | functio ... };\\n } | -| es5.js:1:31:11:1 | {\\n dis ... ;\\n }\\n} | render | es5.js:3:11:5:3 | functio ... v>;\\n } | -| es5.js:18:33:22:1 | {\\n ren ... ;\\n }\\n} | render | es5.js:19:11:21:3 | functio ... 1>;\\n } | -| es6.js:1:1:8:1 | class H ... ;\\n }\\n} | render | es6.js:2:9:4:3 | () {\\n ... v>;\\n } | -| plainfn.js:1:1:3:1 | functio ... div>;\\n} | render | plainfn.js:1:1:3:1 | functio ... div>;\\n} | -| plainfn.js:5:1:7:1 | functio ... iv");\\n} | render | plainfn.js:5:1:7:1 | functio ... iv");\\n} | -| plainfn.js:9:1:12:1 | functio ... rn x;\\n} | render | plainfn.js:9:1:12:1 | functio ... rn x;\\n} | -| plainfn.js:20:1:24:1 | functio ... n 42;\\n} | render | plainfn.js:20:1:24:1 | functio ... n 42;\\n} | -| preact.js:1:1:7:1 | class H ... }\\n} | render | preact.js:2:11:6:5 | (props, ... ;\\n } | -| probably-a-component.js:1:1:6:1 | class H ... }\\n} | render | probably-a-component.js:2:11:5:5 | () {\\n ... ;\\n } | -| props.js:13:31:17:5 | {\\n ... }\\n } | getDefaultProps | props.js:14:24:16:9 | () {\\n ... } | -| props.js:26:5:28:5 | functio ... ;\\n } | render | props.js:26:5:28:5 | functio ... ;\\n } | -| rare-lifecycle-methods.js:1:1:11:1 | class C ... }\\n} | getSnapshotBeforeUpdate | rare-lifecycle-methods.js:8:28:10:5 | (prevPr ... ;\\n } | -| rare-lifecycle-methods.js:1:1:11:1 | class C ... }\\n} | shouldComponentUpdate | rare-lifecycle-methods.js:5:26:7:5 | (nextPr ... ;\\n } | -| statePropertyReads.js:1:1:13:1 | class R ... }\\n} | componentDidUpdate | statePropertyReads.js:10:23:12:5 | (prevPr ... ;\\n } | -| statePropertyWrites.js:1:1:34:1 | class W ... };\\n} | getInitialState | statePropertyWrites.js:25:20:29:5 | () { // ... ;\\n } | -| statePropertyWrites.js:36:19:45:1 | {\\n ren ... ;\\n }\\n} | getInitialState | statePropertyWrites.js:40:20:44:3 | functio ... };\\n } | -| statePropertyWrites.js:36:19:45:1 | {\\n ren ... ;\\n }\\n} | render | statePropertyWrites.js:37:11:39:3 | functio ... v>;\\n } | -| thisAccesses.js:1:1:16:1 | class C ... }\\n} | someInstanceMethod | thisAccesses.js:13:23:15:5 | () {\\n ... ;\\n } | -| thisAccesses.js:18:19:29:1 | {\\n r ... }\\n} | render | thisAccesses.js:19:13:24:5 | functio ... ;\\n } | -| thisAccesses.js:18:19:29:1 | {\\n r ... }\\n} | someInstanceMethod | thisAccesses.js:26:25:28:5 | functio ... ;\\n } | -| thisAccesses.js:31:2:36:1 | functio ... iv/>;\\n} | render | thisAccesses.js:31:2:36:1 | functio ... iv/>;\\n} | -| thisAccesses.js:38:19:45:1 | {\\n r ... },\\n} | render | thisAccesses.js:39:13:44:5 | functio ... ;\\n } | -| thisAccesses_importedMappers.js:4:19:15:1 | {\\n r ... },\\n} | render | thisAccesses_importedMappers.js:5:13:14:5 | functio ... ;\\n } | diff --git a/javascript/ql/test/library-tests/frameworks/ReactJS/ReactComponent_getInstanceMethod.ql b/javascript/ql/test/library-tests/frameworks/ReactJS/ReactComponent_getInstanceMethod.ql deleted file mode 100644 index 6da70c42944c..000000000000 --- a/javascript/ql/test/library-tests/frameworks/ReactJS/ReactComponent_getInstanceMethod.ql +++ /dev/null @@ -1,4 +0,0 @@ -import semmle.javascript.frameworks.React - -from ReactComponent c, string n -select c, n, c.getInstanceMethod(n) diff --git a/javascript/ql/test/library-tests/frameworks/ReactJS/ReactComponent_getInstanceMethod.qll b/javascript/ql/test/library-tests/frameworks/ReactJS/ReactComponent_getInstanceMethod.qll new file mode 100644 index 000000000000..b813e19539b5 --- /dev/null +++ b/javascript/ql/test/library-tests/frameworks/ReactJS/ReactComponent_getInstanceMethod.qll @@ -0,0 +1,5 @@ +import semmle.javascript.frameworks.React + +query predicate test_ReactComponent_getInstanceMethod(ReactComponent c, string n, Function res) { + res = c.getInstanceMethod(n) +} diff --git a/javascript/ql/test/library-tests/frameworks/ReactJS/ReactComponent_ref.expected b/javascript/ql/test/library-tests/frameworks/ReactJS/ReactComponent_ref.expected deleted file mode 100644 index a746de41f9a6..000000000000 --- a/javascript/ql/test/library-tests/frameworks/ReactJS/ReactComponent_ref.expected +++ /dev/null @@ -1,93 +0,0 @@ -| es5.js:1:31:11:1 | {\\n dis ... ;\\n }\\n} | es5.js:1:31:11:1 | {\\n dis ... ;\\n }\\n} | -| es5.js:1:31:11:1 | {\\n dis ... ;\\n }\\n} | es5.js:3:11:3:10 | this | -| es5.js:1:31:11:1 | {\\n dis ... ;\\n }\\n} | es5.js:4:24:4:27 | this | -| es5.js:1:31:11:1 | {\\n dis ... ;\\n }\\n} | es5.js:6:20:6:19 | this | -| es5.js:18:33:22:1 | {\\n ren ... ;\\n }\\n} | es5.js:18:33:22:1 | {\\n ren ... ;\\n }\\n} | -| es5.js:18:33:22:1 | {\\n ren ... ;\\n }\\n} | es5.js:19:11:19:10 | this | -| es5.js:18:33:22:1 | {\\n ren ... ;\\n }\\n} | es5.js:20:24:20:27 | this | -| es6.js:1:1:8:1 | class H ... ;\\n }\\n} | es6.js:1:37:1:36 | this | -| es6.js:1:1:8:1 | class H ... ;\\n }\\n} | es6.js:2:9:2:8 | this | -| es6.js:1:1:8:1 | class H ... ;\\n }\\n} | es6.js:3:24:3:27 | this | -| es6.js:1:1:8:1 | class H ... ;\\n }\\n} | es6.js:5:14:5:13 | this | -| es6.js:14:1:20:1 | class H ... }\\n} | es6.js:15:16:15:15 | this | -| es6.js:14:1:20:1 | class H ... }\\n} | es6.js:16:9:16:12 | this | -| es6.js:14:1:20:1 | class H ... }\\n} | es6.js:17:9:17:12 | this | -| es6.js:14:1:20:1 | class H ... }\\n} | es6.js:18:9:18:12 | this | -| namedImport.js:3:1:3:28 | class C ... nent {} | namedImport.js:3:27:3:26 | this | -| namedImport.js:5:1:5:20 | class D extends C {} | namedImport.js:5:19:5:18 | this | -| plainfn.js:1:1:3:1 | functio ... div>;\\n} | plainfn.js:1:1:1:0 | this | -| plainfn.js:5:1:7:1 | functio ... iv");\\n} | plainfn.js:5:1:5:0 | this | -| plainfn.js:9:1:12:1 | functio ... rn x;\\n} | plainfn.js:9:1:9:0 | this | -| plainfn.js:20:1:24:1 | functio ... n 42;\\n} | plainfn.js:20:1:20:0 | this | -| preact.js:1:1:7:1 | class H ... }\\n} | preact.js:1:38:1:37 | this | -| preact.js:1:1:7:1 | class H ... }\\n} | preact.js:2:11:2:10 | this | -| preact.js:9:1:11:1 | class H ... nt {\\n\\n} | preact.js:9:38:9:37 | this | -| probably-a-component.js:1:1:6:1 | class H ... }\\n} | probably-a-component.js:1:31:1:30 | this | -| probably-a-component.js:1:1:6:1 | class H ... }\\n} | probably-a-component.js:2:11:2:10 | this | -| probably-a-component.js:1:1:6:1 | class H ... }\\n} | probably-a-component.js:3:9:3:12 | this | -| props.js:2:5:3:5 | class C ... {\\n } | props.js:2:37:2:36 | this | -| props.js:2:5:3:5 | class C ... {\\n } | props.js:9:5:9:55 | new C({ ... ctor"}) | -| props.js:13:31:17:5 | {\\n ... }\\n } | props.js:13:31:17:5 | {\\n ... }\\n } | -| props.js:13:31:17:5 | {\\n ... }\\n } | props.js:14:24:14:23 | this | -| props.js:26:5:28:5 | functio ... ;\\n } | props.js:26:5:26:4 | this | -| props.js:26:5:28:5 | functio ... ;\\n } | props.js:34:5:34:55 | new C({ ... ctor"}) | -| rare-lifecycle-methods.js:1:1:11:1 | class C ... }\\n} | rare-lifecycle-methods.js:1:33:1:32 | this | -| rare-lifecycle-methods.js:1:1:11:1 | class C ... }\\n} | rare-lifecycle-methods.js:2:36:2:35 | this | -| rare-lifecycle-methods.js:1:1:11:1 | class C ... }\\n} | rare-lifecycle-methods.js:5:26:5:25 | this | -| rare-lifecycle-methods.js:1:1:11:1 | class C ... }\\n} | rare-lifecycle-methods.js:8:28:8:27 | this | -| statePropertyReads.js:1:1:13:1 | class R ... }\\n} | statePropertyReads.js:2:16:2:15 | this | -| statePropertyReads.js:1:1:13:1 | class R ... }\\n} | statePropertyReads.js:3:9:3:12 | this | -| statePropertyReads.js:1:1:13:1 | class R ... }\\n} | statePropertyReads.js:5:9:5:12 | this | -| statePropertyReads.js:1:1:13:1 | class R ... }\\n} | statePropertyReads.js:7:9:7:12 | this | -| statePropertyReads.js:1:1:13:1 | class R ... }\\n} | statePropertyReads.js:10:23:10:22 | this | -| statePropertyWrites.js:1:1:34:1 | class W ... };\\n} | statePropertyWrites.js:2:16:2:15 | this | -| statePropertyWrites.js:1:1:34:1 | class W ... };\\n} | statePropertyWrites.js:3:13:3:22 | cmp | -| statePropertyWrites.js:1:1:34:1 | class W ... };\\n} | statePropertyWrites.js:3:19:3:22 | this | -| statePropertyWrites.js:1:1:34:1 | class W ... };\\n} | statePropertyWrites.js:4:9:4:11 | cmp | -| statePropertyWrites.js:1:1:34:1 | class W ... };\\n} | statePropertyWrites.js:6:9:6:11 | cmp | -| statePropertyWrites.js:1:1:34:1 | class W ... };\\n} | statePropertyWrites.js:10:9:10:11 | cmp | -| statePropertyWrites.js:1:1:34:1 | class W ... };\\n} | statePropertyWrites.js:14:9:14:11 | cmp | -| statePropertyWrites.js:1:1:34:1 | class W ... };\\n} | statePropertyWrites.js:18:9:18:11 | cmp | -| statePropertyWrites.js:1:1:34:1 | class W ... };\\n} | statePropertyWrites.js:22:9:22:11 | cmp | -| statePropertyWrites.js:1:1:34:1 | class W ... };\\n} | statePropertyWrites.js:25:20:25:19 | this | -| statePropertyWrites.js:36:19:45:1 | {\\n ren ... ;\\n }\\n} | statePropertyWrites.js:36:19:45:1 | {\\n ren ... ;\\n }\\n} | -| statePropertyWrites.js:36:19:45:1 | {\\n ren ... ;\\n }\\n} | statePropertyWrites.js:37:11:37:10 | this | -| statePropertyWrites.js:36:19:45:1 | {\\n ren ... ;\\n }\\n} | statePropertyWrites.js:38:24:38:27 | this | -| statePropertyWrites.js:36:19:45:1 | {\\n ren ... ;\\n }\\n} | statePropertyWrites.js:40:20:40:19 | this | -| thisAccesses.js:1:1:16:1 | class C ... }\\n} | thisAccesses.js:2:17:2:16 | this | -| thisAccesses.js:1:1:16:1 | class C ... }\\n} | thisAccesses.js:3:9:3:12 | this | -| thisAccesses.js:1:1:16:1 | class C ... }\\n} | thisAccesses.js:5:13:5:22 | dis | -| thisAccesses.js:1:1:16:1 | class C ... }\\n} | thisAccesses.js:5:19:5:22 | this | -| thisAccesses.js:1:1:16:1 | class C ... }\\n} | thisAccesses.js:6:9:6:11 | dis | -| thisAccesses.js:1:1:16:1 | class C ... }\\n} | thisAccesses.js:8:10:8:9 | this | -| thisAccesses.js:1:1:16:1 | class C ... }\\n} | thisAccesses.js:9:13:9:16 | this | -| thisAccesses.js:1:1:16:1 | class C ... }\\n} | thisAccesses.js:10:17:10:20 | this | -| thisAccesses.js:1:1:16:1 | class C ... }\\n} | thisAccesses.js:13:23:13:22 | this | -| thisAccesses.js:1:1:16:1 | class C ... }\\n} | thisAccesses.js:14:9:14:12 | this | -| thisAccesses.js:18:19:29:1 | {\\n r ... }\\n} | thisAccesses.js:18:19:29:1 | {\\n r ... }\\n} | -| thisAccesses.js:18:19:29:1 | {\\n r ... }\\n} | thisAccesses.js:19:13:19:12 | this | -| thisAccesses.js:18:19:29:1 | {\\n r ... }\\n} | thisAccesses.js:20:10:20:9 | this | -| thisAccesses.js:18:19:29:1 | {\\n r ... }\\n} | thisAccesses.js:21:13:21:16 | this | -| thisAccesses.js:18:19:29:1 | {\\n r ... }\\n} | thisAccesses.js:22:17:22:20 | this | -| thisAccesses.js:18:19:29:1 | {\\n r ... }\\n} | thisAccesses.js:26:25:26:24 | this | -| thisAccesses.js:18:19:29:1 | {\\n r ... }\\n} | thisAccesses.js:27:9:27:12 | this | -| thisAccesses.js:31:2:36:1 | functio ... iv/>;\\n} | thisAccesses.js:31:2:31:1 | this | -| thisAccesses.js:31:2:36:1 | functio ... iv/>;\\n} | thisAccesses.js:32:6:32:5 | this | -| thisAccesses.js:31:2:36:1 | functio ... iv/>;\\n} | thisAccesses.js:33:9:33:12 | this | -| thisAccesses.js:31:2:36:1 | functio ... iv/>;\\n} | thisAccesses.js:34:13:34:16 | this | -| thisAccesses.js:38:19:45:1 | {\\n r ... },\\n} | thisAccesses.js:38:19:45:1 | {\\n r ... },\\n} | -| thisAccesses.js:38:19:45:1 | {\\n r ... },\\n} | thisAccesses.js:39:13:39:12 | this | -| thisAccesses.js:38:19:45:1 | {\\n r ... },\\n} | thisAccesses.js:40:38:40:37 | this | -| thisAccesses.js:38:19:45:1 | {\\n r ... },\\n} | thisAccesses.js:41:13:41:16 | this | -| thisAccesses.js:38:19:45:1 | {\\n r ... },\\n} | thisAccesses.js:42:12:42:15 | this | -| thisAccesses.js:47:1:52:1 | class C ... }\\n} | thisAccesses.js:48:17:48:16 | this | -| thisAccesses.js:47:1:52:1 | class C ... }\\n} | thisAccesses.js:49:9:49:12 | this | -| thisAccesses.js:47:1:52:1 | class C ... }\\n} | thisAccesses.js:50:9:50:12 | this | -| thisAccesses_importedMappers.js:4:19:15:1 | {\\n r ... },\\n} | thisAccesses_importedMappers.js:4:19:15:1 | {\\n r ... },\\n} | -| thisAccesses_importedMappers.js:4:19:15:1 | {\\n r ... },\\n} | thisAccesses_importedMappers.js:5:13:5:12 | this | -| thisAccesses_importedMappers.js:4:19:15:1 | {\\n r ... },\\n} | thisAccesses_importedMappers.js:6:38:6:37 | this | -| thisAccesses_importedMappers.js:4:19:15:1 | {\\n r ... },\\n} | thisAccesses_importedMappers.js:7:13:7:16 | this | -| thisAccesses_importedMappers.js:4:19:15:1 | {\\n r ... },\\n} | thisAccesses_importedMappers.js:8:12:8:15 | this | -| thisAccesses_importedMappers.js:4:19:15:1 | {\\n r ... },\\n} | thisAccesses_importedMappers.js:9:25:9:24 | this | -| thisAccesses_importedMappers.js:4:19:15:1 | {\\n r ... },\\n} | thisAccesses_importedMappers.js:10:13:10:16 | this | -| thisAccesses_importedMappers.js:4:19:15:1 | {\\n r ... },\\n} | thisAccesses_importedMappers.js:11:12:11:15 | this | diff --git a/javascript/ql/test/library-tests/frameworks/ReactJS/ReactComponent_ref.ql b/javascript/ql/test/library-tests/frameworks/ReactJS/ReactComponent_ref.ql deleted file mode 100644 index c75184ddc5be..000000000000 --- a/javascript/ql/test/library-tests/frameworks/ReactJS/ReactComponent_ref.ql +++ /dev/null @@ -1,4 +0,0 @@ -import semmle.javascript.frameworks.React - -from ReactComponent c -select c, c.ref() diff --git a/javascript/ql/test/library-tests/frameworks/ReactJS/ReactComponent_ref.qll b/javascript/ql/test/library-tests/frameworks/ReactJS/ReactComponent_ref.qll new file mode 100644 index 000000000000..a017a0715feb --- /dev/null +++ b/javascript/ql/test/library-tests/frameworks/ReactJS/ReactComponent_ref.qll @@ -0,0 +1,3 @@ +import semmle.javascript.frameworks.React + +query predicate test_ReactComponent_ref(ReactComponent c, DataFlow::Node res) { res = c.ref() } diff --git a/javascript/ql/test/library-tests/frameworks/ReactJS/getADirectStateAccess.expected b/javascript/ql/test/library-tests/frameworks/ReactJS/getADirectStateAccess.expected deleted file mode 100644 index ea754bf188e4..000000000000 --- a/javascript/ql/test/library-tests/frameworks/ReactJS/getADirectStateAccess.expected +++ /dev/null @@ -1,11 +0,0 @@ -| es6.js:14:1:20:1 | class H ... }\\n} | es6.js:16:9:16:18 | this.state | -| es6.js:14:1:20:1 | class H ... }\\n} | es6.js:17:9:17:18 | this.state | -| es6.js:14:1:20:1 | class H ... }\\n} | es6.js:18:9:18:18 | this.state | -| preact.js:1:1:7:1 | class H ... }\\n} | preact.js:2:19:2:23 | state | -| statePropertyReads.js:1:1:13:1 | class R ... }\\n} | statePropertyReads.js:3:9:3:18 | this.state | -| statePropertyReads.js:1:1:13:1 | class R ... }\\n} | statePropertyReads.js:5:9:5:18 | this.state | -| statePropertyWrites.js:1:1:34:1 | class W ... };\\n} | statePropertyWrites.js:4:9:4:17 | cmp.state | -| statePropertyWrites.js:1:1:34:1 | class W ... };\\n} | statePropertyWrites.js:6:9:6:17 | cmp.state | -| statePropertyWrites.js:1:1:34:1 | class W ... };\\n} | statePropertyWrites.js:10:9:10:17 | cmp.state | -| thisAccesses.js:47:1:52:1 | class C ... }\\n} | thisAccesses.js:49:9:49:18 | this.state | -| thisAccesses.js:47:1:52:1 | class C ... }\\n} | thisAccesses.js:50:9:50:18 | this.state | diff --git a/javascript/ql/test/library-tests/frameworks/ReactJS/getADirectStateAccess.ql b/javascript/ql/test/library-tests/frameworks/ReactJS/getADirectStateAccess.ql deleted file mode 100644 index b280358b1e94..000000000000 --- a/javascript/ql/test/library-tests/frameworks/ReactJS/getADirectStateAccess.ql +++ /dev/null @@ -1,4 +0,0 @@ -import semmle.javascript.frameworks.React - -from ReactComponent c -select c, c.getADirectStateAccess() diff --git a/javascript/ql/test/library-tests/frameworks/ReactJS/getADirectStateAccess.qll b/javascript/ql/test/library-tests/frameworks/ReactJS/getADirectStateAccess.qll new file mode 100644 index 000000000000..b43f3e487d77 --- /dev/null +++ b/javascript/ql/test/library-tests/frameworks/ReactJS/getADirectStateAccess.qll @@ -0,0 +1,5 @@ +import semmle.javascript.frameworks.React + +query predicate test_getADirectStateAccess(ReactComponent c, DataFlow::SourceNode res) { + res = c.getADirectStateAccess() +} diff --git a/javascript/ql/test/library-tests/frameworks/ReactJS/react.expected b/javascript/ql/test/library-tests/frameworks/ReactJS/react.expected deleted file mode 100644 index bbafaf5b6798..000000000000 --- a/javascript/ql/test/library-tests/frameworks/ReactJS/react.expected +++ /dev/null @@ -1,34 +0,0 @@ -| es5.js:1:13:1:17 | React | -| es6.js:1:21:1:25 | React | -| es6.js:14:22:14:26 | React | -| globalReactRefs.js:1:1:1:5 | React | -| globalReactRefs.js:4:5:4:9 | React | -| globalReactRefs.js:7:1:7:5 | React | -| importedReactRefs.js:3:1:3:5 | React | -| importedReactRefs.js:6:5:6:9 | React | -| importedReactRefs.js:9:1:9:5 | React | -| plainfn.js:6:12:6:16 | React | -| plainfn.js:10:13:10:17 | React | -| plainfn.js:16:16:16:20 | React | -| plainfn.js:22:16:22:20 | React | -| props.js:2:21:2:25 | React | -| props.js:13:13:13:17 | React | -| rare-lifecycle-methods.js:1:17:1:21 | React | -| requiredReactRefs.js:1:13:1:28 | require("react") | -| requiredReactRefs.js:3:1:3:5 | React | -| requiredReactRefs.js:6:5:6:9 | React | -| requiredReactRefs.js:9:1:9:5 | React | -| requiredReactRefs.js:12:17:12:32 | require("react") | -| requiredReactRefs.js:14:5:14:9 | React | -| requiredReactRefs.js:17:9:17:13 | React | -| requiredReactRefs.js:20:5:20:9 | React | -| statePropertyReads.js:1:21:1:25 | React | -| statePropertyWrites.js:1:22:1:26 | React | -| statePropertyWrites.js:36:1:36:5 | React | -| thisAccesses.js:1:17:1:21 | React | -| thisAccesses.js:18:1:18:5 | React | -| thisAccesses.js:38:1:38:5 | React | -| thisAccesses.js:40:9:40:13 | React | -| thisAccesses.js:47:18:47:22 | React | -| thisAccesses_importedMappers.js:4:1:4:5 | React | -| thisAccesses_importedMappers.js:6:9:6:13 | React | diff --git a/javascript/ql/test/library-tests/frameworks/ReactJS/react.ql b/javascript/ql/test/library-tests/frameworks/ReactJS/react.ql deleted file mode 100644 index 665373534c45..000000000000 --- a/javascript/ql/test/library-tests/frameworks/ReactJS/react.ql +++ /dev/null @@ -1,5 +0,0 @@ -import javascript - -from DataFlow::ValueNode nd -where react().flowsTo(nd) -select nd diff --git a/javascript/ql/test/library-tests/frameworks/ReactJS/react.qll b/javascript/ql/test/library-tests/frameworks/ReactJS/react.qll new file mode 100644 index 000000000000..a5f254b79707 --- /dev/null +++ b/javascript/ql/test/library-tests/frameworks/ReactJS/react.qll @@ -0,0 +1,3 @@ +import javascript + +query predicate test_react(DataFlow::ValueNode nd) { react().flowsTo(nd) } diff --git a/javascript/ql/test/library-tests/frameworks/ReactJS/tests.expected b/javascript/ql/test/library-tests/frameworks/ReactJS/tests.expected new file mode 100644 index 000000000000..d0241cea599f --- /dev/null +++ b/javascript/ql/test/library-tests/frameworks/ReactJS/tests.expected @@ -0,0 +1,252 @@ +test_getADirectStateAccess +| es6.js:14:1:20:1 | class H ... }\\n} | es6.js:16:9:16:18 | this.state | +| es6.js:14:1:20:1 | class H ... }\\n} | es6.js:17:9:17:18 | this.state | +| es6.js:14:1:20:1 | class H ... }\\n} | es6.js:18:9:18:18 | this.state | +| preact.js:1:1:7:1 | class H ... }\\n} | preact.js:2:19:2:23 | state | +| statePropertyReads.js:1:1:13:1 | class R ... }\\n} | statePropertyReads.js:3:9:3:18 | this.state | +| statePropertyReads.js:1:1:13:1 | class R ... }\\n} | statePropertyReads.js:5:9:5:18 | this.state | +| statePropertyWrites.js:1:1:34:1 | class W ... };\\n} | statePropertyWrites.js:4:9:4:17 | cmp.state | +| statePropertyWrites.js:1:1:34:1 | class W ... };\\n} | statePropertyWrites.js:6:9:6:17 | cmp.state | +| statePropertyWrites.js:1:1:34:1 | class W ... };\\n} | statePropertyWrites.js:10:9:10:17 | cmp.state | +| thisAccesses.js:47:1:52:1 | class C ... }\\n} | thisAccesses.js:49:9:49:18 | this.state | +| thisAccesses.js:47:1:52:1 | class C ... }\\n} | thisAccesses.js:50:9:50:18 | this.state | +test_ReactComponent_getInstanceMethod +| es5.js:1:31:11:1 | {\\n dis ... ;\\n }\\n} | getDefaultProps | es5.js:6:20:10:3 | functio ... };\\n } | +| es5.js:1:31:11:1 | {\\n dis ... ;\\n }\\n} | render | es5.js:3:11:5:3 | functio ... v>;\\n } | +| es5.js:18:33:22:1 | {\\n ren ... ;\\n }\\n} | render | es5.js:19:11:21:3 | functio ... 1>;\\n } | +| es6.js:1:1:8:1 | class H ... ;\\n }\\n} | render | es6.js:2:9:4:3 | () {\\n ... v>;\\n } | +| plainfn.js:1:1:3:1 | functio ... div>;\\n} | render | plainfn.js:1:1:3:1 | functio ... div>;\\n} | +| plainfn.js:5:1:7:1 | functio ... iv");\\n} | render | plainfn.js:5:1:7:1 | functio ... iv");\\n} | +| plainfn.js:9:1:12:1 | functio ... rn x;\\n} | render | plainfn.js:9:1:12:1 | functio ... rn x;\\n} | +| plainfn.js:20:1:24:1 | functio ... n 42;\\n} | render | plainfn.js:20:1:24:1 | functio ... n 42;\\n} | +| preact.js:1:1:7:1 | class H ... }\\n} | render | preact.js:2:11:6:5 | (props, ... ;\\n } | +| probably-a-component.js:1:1:6:1 | class H ... }\\n} | render | probably-a-component.js:2:11:5:5 | () {\\n ... ;\\n } | +| props.js:13:31:17:5 | {\\n ... }\\n } | getDefaultProps | props.js:14:24:16:9 | () {\\n ... } | +| props.js:26:5:28:5 | functio ... ;\\n } | render | props.js:26:5:28:5 | functio ... ;\\n } | +| rare-lifecycle-methods.js:1:1:11:1 | class C ... }\\n} | getSnapshotBeforeUpdate | rare-lifecycle-methods.js:8:28:10:5 | (prevPr ... ;\\n } | +| rare-lifecycle-methods.js:1:1:11:1 | class C ... }\\n} | shouldComponentUpdate | rare-lifecycle-methods.js:5:26:7:5 | (nextPr ... ;\\n } | +| statePropertyReads.js:1:1:13:1 | class R ... }\\n} | componentDidUpdate | statePropertyReads.js:10:23:12:5 | (prevPr ... ;\\n } | +| statePropertyWrites.js:1:1:34:1 | class W ... };\\n} | getInitialState | statePropertyWrites.js:25:20:29:5 | () { // ... ;\\n } | +| statePropertyWrites.js:36:19:45:1 | {\\n ren ... ;\\n }\\n} | getInitialState | statePropertyWrites.js:40:20:44:3 | functio ... };\\n } | +| statePropertyWrites.js:36:19:45:1 | {\\n ren ... ;\\n }\\n} | render | statePropertyWrites.js:37:11:39:3 | functio ... v>;\\n } | +| thisAccesses.js:1:1:16:1 | class C ... }\\n} | someInstanceMethod | thisAccesses.js:13:23:15:5 | () {\\n ... ;\\n } | +| thisAccesses.js:18:19:29:1 | {\\n r ... }\\n} | render | thisAccesses.js:19:13:24:5 | functio ... ;\\n } | +| thisAccesses.js:18:19:29:1 | {\\n r ... }\\n} | someInstanceMethod | thisAccesses.js:26:25:28:5 | functio ... ;\\n } | +| thisAccesses.js:31:2:36:1 | functio ... iv/>;\\n} | render | thisAccesses.js:31:2:36:1 | functio ... iv/>;\\n} | +| thisAccesses.js:38:19:45:1 | {\\n r ... },\\n} | render | thisAccesses.js:39:13:44:5 | functio ... ;\\n } | +| thisAccesses_importedMappers.js:4:19:15:1 | {\\n r ... },\\n} | render | thisAccesses_importedMappers.js:5:13:14:5 | functio ... ;\\n } | +test_react +| es5.js:1:13:1:17 | React | +| es6.js:1:21:1:25 | React | +| es6.js:14:22:14:26 | React | +| globalReactRefs.js:1:1:1:5 | React | +| globalReactRefs.js:4:5:4:9 | React | +| globalReactRefs.js:7:1:7:5 | React | +| importedReactRefs.js:3:1:3:5 | React | +| importedReactRefs.js:6:5:6:9 | React | +| importedReactRefs.js:9:1:9:5 | React | +| plainfn.js:6:12:6:16 | React | +| plainfn.js:10:13:10:17 | React | +| plainfn.js:16:16:16:20 | React | +| plainfn.js:22:16:22:20 | React | +| props.js:2:21:2:25 | React | +| props.js:13:13:13:17 | React | +| rare-lifecycle-methods.js:1:17:1:21 | React | +| requiredReactRefs.js:1:13:1:28 | require("react") | +| requiredReactRefs.js:3:1:3:5 | React | +| requiredReactRefs.js:6:5:6:9 | React | +| requiredReactRefs.js:9:1:9:5 | React | +| requiredReactRefs.js:12:17:12:32 | require("react") | +| requiredReactRefs.js:14:5:14:9 | React | +| requiredReactRefs.js:17:9:17:13 | React | +| requiredReactRefs.js:20:5:20:9 | React | +| statePropertyReads.js:1:21:1:25 | React | +| statePropertyWrites.js:1:22:1:26 | React | +| statePropertyWrites.js:36:1:36:5 | React | +| thisAccesses.js:1:17:1:21 | React | +| thisAccesses.js:18:1:18:5 | React | +| thisAccesses.js:38:1:38:5 | React | +| thisAccesses.js:40:9:40:13 | React | +| thisAccesses.js:47:18:47:22 | React | +| thisAccesses_importedMappers.js:4:1:4:5 | React | +| thisAccesses_importedMappers.js:6:9:6:13 | React | +test_ReactComponent_getAPreviousStateSource +| rare-lifecycle-methods.js:1:1:11:1 | class C ... }\\n} | rare-lifecycle-methods.js:2:44:2:48 | state | +| rare-lifecycle-methods.js:1:1:11:1 | class C ... }\\n} | rare-lifecycle-methods.js:8:40:8:48 | prevState | +| statePropertyReads.js:1:1:13:1 | class R ... }\\n} | statePropertyReads.js:7:24:7:32 | prevState | +| statePropertyReads.js:1:1:13:1 | class R ... }\\n} | statePropertyReads.js:10:35:10:43 | prevState | +test_ReactComponent_ref +| es5.js:1:31:11:1 | {\\n dis ... ;\\n }\\n} | es5.js:1:31:11:1 | {\\n dis ... ;\\n }\\n} | +| es5.js:1:31:11:1 | {\\n dis ... ;\\n }\\n} | es5.js:3:11:3:10 | this | +| es5.js:1:31:11:1 | {\\n dis ... ;\\n }\\n} | es5.js:4:24:4:27 | this | +| es5.js:1:31:11:1 | {\\n dis ... ;\\n }\\n} | es5.js:6:20:6:19 | this | +| es5.js:18:33:22:1 | {\\n ren ... ;\\n }\\n} | es5.js:18:33:22:1 | {\\n ren ... ;\\n }\\n} | +| es5.js:18:33:22:1 | {\\n ren ... ;\\n }\\n} | es5.js:19:11:19:10 | this | +| es5.js:18:33:22:1 | {\\n ren ... ;\\n }\\n} | es5.js:20:24:20:27 | this | +| es6.js:1:1:8:1 | class H ... ;\\n }\\n} | es6.js:1:37:1:36 | this | +| es6.js:1:1:8:1 | class H ... ;\\n }\\n} | es6.js:2:9:2:8 | this | +| es6.js:1:1:8:1 | class H ... ;\\n }\\n} | es6.js:3:24:3:27 | this | +| es6.js:1:1:8:1 | class H ... ;\\n }\\n} | es6.js:5:14:5:13 | this | +| es6.js:14:1:20:1 | class H ... }\\n} | es6.js:15:16:15:15 | this | +| es6.js:14:1:20:1 | class H ... }\\n} | es6.js:16:9:16:12 | this | +| es6.js:14:1:20:1 | class H ... }\\n} | es6.js:17:9:17:12 | this | +| es6.js:14:1:20:1 | class H ... }\\n} | es6.js:18:9:18:12 | this | +| namedImport.js:3:1:3:28 | class C ... nent {} | namedImport.js:3:27:3:26 | this | +| namedImport.js:5:1:5:20 | class D extends C {} | namedImport.js:5:19:5:18 | this | +| plainfn.js:1:1:3:1 | functio ... div>;\\n} | plainfn.js:1:1:1:0 | this | +| plainfn.js:5:1:7:1 | functio ... iv");\\n} | plainfn.js:5:1:5:0 | this | +| plainfn.js:9:1:12:1 | functio ... rn x;\\n} | plainfn.js:9:1:9:0 | this | +| plainfn.js:20:1:24:1 | functio ... n 42;\\n} | plainfn.js:20:1:20:0 | this | +| preact.js:1:1:7:1 | class H ... }\\n} | preact.js:1:38:1:37 | this | +| preact.js:1:1:7:1 | class H ... }\\n} | preact.js:2:11:2:10 | this | +| preact.js:9:1:11:1 | class H ... nt {\\n\\n} | preact.js:9:38:9:37 | this | +| probably-a-component.js:1:1:6:1 | class H ... }\\n} | probably-a-component.js:1:31:1:30 | this | +| probably-a-component.js:1:1:6:1 | class H ... }\\n} | probably-a-component.js:2:11:2:10 | this | +| probably-a-component.js:1:1:6:1 | class H ... }\\n} | probably-a-component.js:3:9:3:12 | this | +| props.js:2:5:3:5 | class C ... {\\n } | props.js:2:37:2:36 | this | +| props.js:2:5:3:5 | class C ... {\\n } | props.js:9:5:9:55 | new C({ ... ctor"}) | +| props.js:13:31:17:5 | {\\n ... }\\n } | props.js:13:31:17:5 | {\\n ... }\\n } | +| props.js:13:31:17:5 | {\\n ... }\\n } | props.js:14:24:14:23 | this | +| props.js:26:5:28:5 | functio ... ;\\n } | props.js:26:5:26:4 | this | +| props.js:26:5:28:5 | functio ... ;\\n } | props.js:34:5:34:55 | new C({ ... ctor"}) | +| rare-lifecycle-methods.js:1:1:11:1 | class C ... }\\n} | rare-lifecycle-methods.js:1:33:1:32 | this | +| rare-lifecycle-methods.js:1:1:11:1 | class C ... }\\n} | rare-lifecycle-methods.js:2:36:2:35 | this | +| rare-lifecycle-methods.js:1:1:11:1 | class C ... }\\n} | rare-lifecycle-methods.js:5:26:5:25 | this | +| rare-lifecycle-methods.js:1:1:11:1 | class C ... }\\n} | rare-lifecycle-methods.js:8:28:8:27 | this | +| statePropertyReads.js:1:1:13:1 | class R ... }\\n} | statePropertyReads.js:2:16:2:15 | this | +| statePropertyReads.js:1:1:13:1 | class R ... }\\n} | statePropertyReads.js:3:9:3:12 | this | +| statePropertyReads.js:1:1:13:1 | class R ... }\\n} | statePropertyReads.js:5:9:5:12 | this | +| statePropertyReads.js:1:1:13:1 | class R ... }\\n} | statePropertyReads.js:7:9:7:12 | this | +| statePropertyReads.js:1:1:13:1 | class R ... }\\n} | statePropertyReads.js:10:23:10:22 | this | +| statePropertyWrites.js:1:1:34:1 | class W ... };\\n} | statePropertyWrites.js:2:16:2:15 | this | +| statePropertyWrites.js:1:1:34:1 | class W ... };\\n} | statePropertyWrites.js:3:13:3:22 | cmp | +| statePropertyWrites.js:1:1:34:1 | class W ... };\\n} | statePropertyWrites.js:3:19:3:22 | this | +| statePropertyWrites.js:1:1:34:1 | class W ... };\\n} | statePropertyWrites.js:4:9:4:11 | cmp | +| statePropertyWrites.js:1:1:34:1 | class W ... };\\n} | statePropertyWrites.js:6:9:6:11 | cmp | +| statePropertyWrites.js:1:1:34:1 | class W ... };\\n} | statePropertyWrites.js:10:9:10:11 | cmp | +| statePropertyWrites.js:1:1:34:1 | class W ... };\\n} | statePropertyWrites.js:14:9:14:11 | cmp | +| statePropertyWrites.js:1:1:34:1 | class W ... };\\n} | statePropertyWrites.js:18:9:18:11 | cmp | +| statePropertyWrites.js:1:1:34:1 | class W ... };\\n} | statePropertyWrites.js:22:9:22:11 | cmp | +| statePropertyWrites.js:1:1:34:1 | class W ... };\\n} | statePropertyWrites.js:25:20:25:19 | this | +| statePropertyWrites.js:36:19:45:1 | {\\n ren ... ;\\n }\\n} | statePropertyWrites.js:36:19:45:1 | {\\n ren ... ;\\n }\\n} | +| statePropertyWrites.js:36:19:45:1 | {\\n ren ... ;\\n }\\n} | statePropertyWrites.js:37:11:37:10 | this | +| statePropertyWrites.js:36:19:45:1 | {\\n ren ... ;\\n }\\n} | statePropertyWrites.js:38:24:38:27 | this | +| statePropertyWrites.js:36:19:45:1 | {\\n ren ... ;\\n }\\n} | statePropertyWrites.js:40:20:40:19 | this | +| thisAccesses.js:1:1:16:1 | class C ... }\\n} | thisAccesses.js:2:17:2:16 | this | +| thisAccesses.js:1:1:16:1 | class C ... }\\n} | thisAccesses.js:3:9:3:12 | this | +| thisAccesses.js:1:1:16:1 | class C ... }\\n} | thisAccesses.js:5:13:5:22 | dis | +| thisAccesses.js:1:1:16:1 | class C ... }\\n} | thisAccesses.js:5:19:5:22 | this | +| thisAccesses.js:1:1:16:1 | class C ... }\\n} | thisAccesses.js:6:9:6:11 | dis | +| thisAccesses.js:1:1:16:1 | class C ... }\\n} | thisAccesses.js:8:10:8:9 | this | +| thisAccesses.js:1:1:16:1 | class C ... }\\n} | thisAccesses.js:9:13:9:16 | this | +| thisAccesses.js:1:1:16:1 | class C ... }\\n} | thisAccesses.js:10:17:10:20 | this | +| thisAccesses.js:1:1:16:1 | class C ... }\\n} | thisAccesses.js:13:23:13:22 | this | +| thisAccesses.js:1:1:16:1 | class C ... }\\n} | thisAccesses.js:14:9:14:12 | this | +| thisAccesses.js:18:19:29:1 | {\\n r ... }\\n} | thisAccesses.js:18:19:29:1 | {\\n r ... }\\n} | +| thisAccesses.js:18:19:29:1 | {\\n r ... }\\n} | thisAccesses.js:19:13:19:12 | this | +| thisAccesses.js:18:19:29:1 | {\\n r ... }\\n} | thisAccesses.js:20:10:20:9 | this | +| thisAccesses.js:18:19:29:1 | {\\n r ... }\\n} | thisAccesses.js:21:13:21:16 | this | +| thisAccesses.js:18:19:29:1 | {\\n r ... }\\n} | thisAccesses.js:22:17:22:20 | this | +| thisAccesses.js:18:19:29:1 | {\\n r ... }\\n} | thisAccesses.js:26:25:26:24 | this | +| thisAccesses.js:18:19:29:1 | {\\n r ... }\\n} | thisAccesses.js:27:9:27:12 | this | +| thisAccesses.js:31:2:36:1 | functio ... iv/>;\\n} | thisAccesses.js:31:2:31:1 | this | +| thisAccesses.js:31:2:36:1 | functio ... iv/>;\\n} | thisAccesses.js:32:6:32:5 | this | +| thisAccesses.js:31:2:36:1 | functio ... iv/>;\\n} | thisAccesses.js:33:9:33:12 | this | +| thisAccesses.js:31:2:36:1 | functio ... iv/>;\\n} | thisAccesses.js:34:13:34:16 | this | +| thisAccesses.js:38:19:45:1 | {\\n r ... },\\n} | thisAccesses.js:38:19:45:1 | {\\n r ... },\\n} | +| thisAccesses.js:38:19:45:1 | {\\n r ... },\\n} | thisAccesses.js:39:13:39:12 | this | +| thisAccesses.js:38:19:45:1 | {\\n r ... },\\n} | thisAccesses.js:40:38:40:37 | this | +| thisAccesses.js:38:19:45:1 | {\\n r ... },\\n} | thisAccesses.js:41:13:41:16 | this | +| thisAccesses.js:38:19:45:1 | {\\n r ... },\\n} | thisAccesses.js:42:12:42:15 | this | +| thisAccesses.js:47:1:52:1 | class C ... }\\n} | thisAccesses.js:48:17:48:16 | this | +| thisAccesses.js:47:1:52:1 | class C ... }\\n} | thisAccesses.js:49:9:49:12 | this | +| thisAccesses.js:47:1:52:1 | class C ... }\\n} | thisAccesses.js:50:9:50:12 | this | +| thisAccesses_importedMappers.js:4:19:15:1 | {\\n r ... },\\n} | thisAccesses_importedMappers.js:4:19:15:1 | {\\n r ... },\\n} | +| thisAccesses_importedMappers.js:4:19:15:1 | {\\n r ... },\\n} | thisAccesses_importedMappers.js:5:13:5:12 | this | +| thisAccesses_importedMappers.js:4:19:15:1 | {\\n r ... },\\n} | thisAccesses_importedMappers.js:6:38:6:37 | this | +| thisAccesses_importedMappers.js:4:19:15:1 | {\\n r ... },\\n} | thisAccesses_importedMappers.js:7:13:7:16 | this | +| thisAccesses_importedMappers.js:4:19:15:1 | {\\n r ... },\\n} | thisAccesses_importedMappers.js:8:12:8:15 | this | +| thisAccesses_importedMappers.js:4:19:15:1 | {\\n r ... },\\n} | thisAccesses_importedMappers.js:9:25:9:24 | this | +| thisAccesses_importedMappers.js:4:19:15:1 | {\\n r ... },\\n} | thisAccesses_importedMappers.js:10:13:10:16 | this | +| thisAccesses_importedMappers.js:4:19:15:1 | {\\n r ... },\\n} | thisAccesses_importedMappers.js:11:12:11:15 | this | +test_ReactComponent_getACandidateStateSource +| es6.js:14:1:20:1 | class H ... }\\n} | es6.js:18:22:18:31 | { baz: 42} | +| rare-lifecycle-methods.js:1:1:11:1 | class C ... }\\n} | rare-lifecycle-methods.js:3:16:3:17 | {} | +| rare-lifecycle-methods.js:1:1:11:1 | class C ... }\\n} | rare-lifecycle-methods.js:5:38:5:46 | nextState | +| statePropertyReads.js:1:1:13:1 | class R ... }\\n} | statePropertyReads.js:7:45:7:56 | prevState.p3 | +| statePropertyWrites.js:1:1:34:1 | class W ... };\\n} | statePropertyWrites.js:8:18:8:19 | {} | +| statePropertyWrites.js:1:1:34:1 | class W ... };\\n} | statePropertyWrites.js:12:18:12:19 | {} | +| statePropertyWrites.js:1:1:34:1 | class W ... };\\n} | statePropertyWrites.js:16:18:16:19 | {} | +| statePropertyWrites.js:1:1:34:1 | class W ... };\\n} | statePropertyWrites.js:20:18:20:19 | {} | +| statePropertyWrites.js:1:1:34:1 | class W ... };\\n} | statePropertyWrites.js:31:13:33:5 | {\\n ... 2\\n } | +| statePropertyWrites.js:36:19:45:1 | {\\n ren ... ;\\n }\\n} | statePropertyWrites.js:41:12:43:5 | {\\n p8: 42\\n } | +| thisAccesses.js:47:1:52:1 | class C ... }\\n} | thisAccesses.js:48:18:48:18 | y | +| thisAccesses.js:47:1:52:1 | class C ... }\\n} | thisAccesses.js:49:22:49:22 | x | +test_ReactComponent_getADirectPropsSource +| es5.js:1:31:11:1 | {\\n dis ... ;\\n }\\n} | es5.js:4:24:4:33 | this.props | +| es5.js:18:33:22:1 | {\\n ren ... ;\\n }\\n} | es5.js:20:24:20:33 | this.props | +| es6.js:1:1:8:1 | class H ... ;\\n }\\n} | es6.js:1:37:1:36 | args | +| es6.js:1:1:8:1 | class H ... ;\\n }\\n} | es6.js:3:24:3:33 | this.props | +| namedImport.js:3:1:3:28 | class C ... nent {} | namedImport.js:3:27:3:26 | args | +| namedImport.js:5:1:5:20 | class D extends C {} | namedImport.js:5:19:5:18 | args | +| plainfn.js:1:1:3:1 | functio ... div>;\\n} | plainfn.js:1:16:1:20 | props | +| plainfn.js:5:1:7:1 | functio ... iv");\\n} | plainfn.js:5:17:5:21 | props | +| plainfn.js:9:1:12:1 | functio ... rn x;\\n} | plainfn.js:9:17:9:21 | props | +| plainfn.js:20:1:24:1 | functio ... n 42;\\n} | plainfn.js:20:28:20:32 | props | +| preact.js:1:1:7:1 | class H ... }\\n} | preact.js:1:38:1:37 | args | +| preact.js:1:1:7:1 | class H ... }\\n} | preact.js:2:12:2:16 | props | +| preact.js:9:1:11:1 | class H ... nt {\\n\\n} | preact.js:9:38:9:37 | args | +| probably-a-component.js:1:1:6:1 | class H ... }\\n} | probably-a-component.js:1:31:1:30 | args | +| probably-a-component.js:1:1:6:1 | class H ... }\\n} | probably-a-component.js:3:9:3:18 | this.props | +| props.js:2:5:3:5 | class C ... {\\n } | props.js:2:37:2:36 | args | +| props.js:26:5:28:5 | functio ... ;\\n } | props.js:26:16:26:20 | props | +| rare-lifecycle-methods.js:1:1:11:1 | class C ... }\\n} | rare-lifecycle-methods.js:1:33:1:32 | args | +| statePropertyWrites.js:36:19:45:1 | {\\n ren ... ;\\n }\\n} | statePropertyWrites.js:38:24:38:33 | this.props | +| thisAccesses.js:31:2:36:1 | functio ... iv/>;\\n} | thisAccesses.js:31:12:31:16 | props | +| thisAccesses.js:47:1:52:1 | class C ... }\\n} | thisAccesses.js:48:18:48:18 | y | +test_ReactComponent_getACandidatePropsValue +| es5.js:8:13:8:19 | 'world' | +| props.js:5:46:5:67 | "propFr ... tProps" | +| props.js:7:22:7:34 | "propFromJSX" | +| props.js:9:33:9:53 | "propFr ... ructor" | +| props.js:15:44:15:65 | "propFr ... tProps" | +| props.js:19:22:19:34 | "propFromJSX" | +| props.js:21:29:21:49 | "propFr ... ructor" | +| props.js:30:46:30:67 | "propFr ... tProps" | +| props.js:32:22:32:34 | "propFromJSX" | +| props.js:34:33:34:53 | "propFr ... ructor" | +test_ReactComponent +| es5.js:1:31:11:1 | {\\n dis ... ;\\n }\\n} | +| es5.js:18:33:22:1 | {\\n ren ... ;\\n }\\n} | +| es6.js:1:1:8:1 | class H ... ;\\n }\\n} | +| es6.js:14:1:20:1 | class H ... }\\n} | +| namedImport.js:3:1:3:28 | class C ... nent {} | +| namedImport.js:5:1:5:20 | class D extends C {} | +| plainfn.js:1:1:3:1 | functio ... div>;\\n} | +| plainfn.js:5:1:7:1 | functio ... iv");\\n} | +| plainfn.js:9:1:12:1 | functio ... rn x;\\n} | +| plainfn.js:20:1:24:1 | functio ... n 42;\\n} | +| preact.js:1:1:7:1 | class H ... }\\n} | +| preact.js:9:1:11:1 | class H ... nt {\\n\\n} | +| probably-a-component.js:1:1:6:1 | class H ... }\\n} | +| props.js:2:5:3:5 | class C ... {\\n } | +| props.js:13:31:17:5 | {\\n ... }\\n } | +| props.js:26:5:28:5 | functio ... ;\\n } | +| rare-lifecycle-methods.js:1:1:11:1 | class C ... }\\n} | +| statePropertyReads.js:1:1:13:1 | class R ... }\\n} | +| statePropertyWrites.js:1:1:34:1 | class W ... };\\n} | +| statePropertyWrites.js:36:19:45:1 | {\\n ren ... ;\\n }\\n} | +| thisAccesses.js:1:1:16:1 | class C ... }\\n} | +| thisAccesses.js:18:19:29:1 | {\\n r ... }\\n} | +| thisAccesses.js:31:2:36:1 | functio ... iv/>;\\n} | +| thisAccesses.js:38:19:45:1 | {\\n r ... },\\n} | +| thisAccesses.js:47:1:52:1 | class C ... }\\n} | +| thisAccesses_importedMappers.js:4:19:15:1 | {\\n r ... },\\n} | +test_ReactComponent_getAPropRead +| es5.js:1:31:11:1 | {\\n dis ... ;\\n }\\n} | name | es5.js:4:24:4:38 | this.props.name | +| es5.js:18:33:22:1 | {\\n ren ... ;\\n }\\n} | name | es5.js:20:24:20:38 | this.props.name | +| es6.js:1:1:8:1 | class H ... ;\\n }\\n} | name | es6.js:3:24:3:38 | this.props.name | +| plainfn.js:1:1:3:1 | functio ... div>;\\n} | name | plainfn.js:2:22:2:31 | props.name | +| preact.js:1:1:7:1 | class H ... }\\n} | name | preact.js:3:9:3:18 | props.name | +| probably-a-component.js:1:1:6:1 | class H ... }\\n} | name | probably-a-component.js:3:9:3:23 | this.props.name | +| statePropertyWrites.js:36:19:45:1 | {\\n ren ... ;\\n }\\n} | name | statePropertyWrites.js:38:24:38:38 | this.props.name | diff --git a/javascript/ql/test/library-tests/frameworks/ReactJS/tests.ql b/javascript/ql/test/library-tests/frameworks/ReactJS/tests.ql new file mode 100644 index 000000000000..21a3b40bd258 --- /dev/null +++ b/javascript/ql/test/library-tests/frameworks/ReactJS/tests.ql @@ -0,0 +1,10 @@ +import getADirectStateAccess +import ReactComponent_getInstanceMethod +import react +import ReactComponent_getAPreviousStateSource +import ReactComponent_ref +import ReactComponent_getACandidateStateSource +import ReactComponent_getADirectPropsSource +import ReactComponent_getACandidatePropsValue +import ReactComponent +import ReactComponent_getAPropRead diff --git a/javascript/ql/test/library-tests/frameworks/connect/Credentials.expected b/javascript/ql/test/library-tests/frameworks/connect/Credentials.expected deleted file mode 100644 index 541e8917fc23..000000000000 --- a/javascript/ql/test/library-tests/frameworks/connect/Credentials.expected +++ /dev/null @@ -1,2 +0,0 @@ -| src/test.js:12:19:12:28 | 'username' | user name | -| src/test.js:12:31:12:40 | 'password' | password | diff --git a/javascript/ql/test/library-tests/frameworks/connect/Credentials.ql b/javascript/ql/test/library-tests/frameworks/connect/Credentials.ql deleted file mode 100644 index df60229bb63b..000000000000 --- a/javascript/ql/test/library-tests/frameworks/connect/Credentials.ql +++ /dev/null @@ -1,4 +0,0 @@ -import javascript - -from Connect::Credentials cr -select cr, cr.getCredentialsKind() diff --git a/javascript/ql/test/library-tests/frameworks/connect/Credentials.qll b/javascript/ql/test/library-tests/frameworks/connect/Credentials.qll new file mode 100644 index 000000000000..11ba980db942 --- /dev/null +++ b/javascript/ql/test/library-tests/frameworks/connect/Credentials.qll @@ -0,0 +1,5 @@ +import javascript + +query predicate test_Credentials(Connect::Credentials cr, string res) { + res = cr.getCredentialsKind() +} diff --git a/javascript/ql/test/library-tests/frameworks/connect/HeaderDefinition.expected b/javascript/ql/test/library-tests/frameworks/connect/HeaderDefinition.expected deleted file mode 100644 index a22b69d98f7e..000000000000 --- a/javascript/ql/test/library-tests/frameworks/connect/HeaderDefinition.expected +++ /dev/null @@ -1,2 +0,0 @@ -| src/test.js:7:5:7:32 | res.set ... 1', '') | src/test.js:6:9:9:1 | functio ... oo');\\n} | -| src/test.js:25:5:25:32 | res.set ... 2', '') | src/test.js:24:9:26:1 | functio ... '');\\n} | diff --git a/javascript/ql/test/library-tests/frameworks/connect/HeaderDefinition.ql b/javascript/ql/test/library-tests/frameworks/connect/HeaderDefinition.ql deleted file mode 100644 index 78c0b939874b..000000000000 --- a/javascript/ql/test/library-tests/frameworks/connect/HeaderDefinition.ql +++ /dev/null @@ -1,5 +0,0 @@ -import javascript - -from HTTP::HeaderDefinition hd, Connect::RouteHandler rh -where rh = hd.getRouteHandler() -select hd, rh diff --git a/javascript/ql/test/library-tests/frameworks/connect/HeaderDefinition.qll b/javascript/ql/test/library-tests/frameworks/connect/HeaderDefinition.qll new file mode 100644 index 000000000000..022fcaba3477 --- /dev/null +++ b/javascript/ql/test/library-tests/frameworks/connect/HeaderDefinition.qll @@ -0,0 +1,5 @@ +import javascript + +query predicate test_HeaderDefinition(HTTP::HeaderDefinition hd, Connect::RouteHandler rh) { + rh = hd.getRouteHandler() +} diff --git a/javascript/ql/test/library-tests/frameworks/connect/HeaderDefinition_defines.expected b/javascript/ql/test/library-tests/frameworks/connect/HeaderDefinition_defines.expected deleted file mode 100644 index a517832aa216..000000000000 --- a/javascript/ql/test/library-tests/frameworks/connect/HeaderDefinition_defines.expected +++ /dev/null @@ -1,2 +0,0 @@ -| src/test.js:7:5:7:32 | res.set ... 1', '') | header1 | | -| src/test.js:25:5:25:32 | res.set ... 2', '') | header2 | | diff --git a/javascript/ql/test/library-tests/frameworks/connect/HeaderDefinition_defines.ql b/javascript/ql/test/library-tests/frameworks/connect/HeaderDefinition_defines.ql deleted file mode 100644 index 4701cf4cb28c..000000000000 --- a/javascript/ql/test/library-tests/frameworks/connect/HeaderDefinition_defines.ql +++ /dev/null @@ -1,7 +0,0 @@ -import javascript - -from HTTP::HeaderDefinition hd, string name, string value -where - hd.defines(name, value) and - hd.getRouteHandler() instanceof Connect::RouteHandler -select hd, name, value diff --git a/javascript/ql/test/library-tests/frameworks/connect/HeaderDefinition_defines.qll b/javascript/ql/test/library-tests/frameworks/connect/HeaderDefinition_defines.qll new file mode 100644 index 000000000000..72a211ccc306 --- /dev/null +++ b/javascript/ql/test/library-tests/frameworks/connect/HeaderDefinition_defines.qll @@ -0,0 +1,5 @@ +import javascript + +query predicate test_HeaderDefinition_defines(HTTP::HeaderDefinition hd, string name, string value) { + hd.defines(name, value) and hd.getRouteHandler() instanceof Connect::RouteHandler +} diff --git a/javascript/ql/test/library-tests/frameworks/connect/HeaderDefinition_getAHeaderName.expected b/javascript/ql/test/library-tests/frameworks/connect/HeaderDefinition_getAHeaderName.expected deleted file mode 100644 index 48b84e2c73f0..000000000000 --- a/javascript/ql/test/library-tests/frameworks/connect/HeaderDefinition_getAHeaderName.expected +++ /dev/null @@ -1,2 +0,0 @@ -| src/test.js:7:5:7:32 | res.set ... 1', '') | header1 | -| src/test.js:25:5:25:32 | res.set ... 2', '') | header2 | diff --git a/javascript/ql/test/library-tests/frameworks/connect/HeaderDefinition_getAHeaderName.ql b/javascript/ql/test/library-tests/frameworks/connect/HeaderDefinition_getAHeaderName.ql deleted file mode 100644 index eb59dade552d..000000000000 --- a/javascript/ql/test/library-tests/frameworks/connect/HeaderDefinition_getAHeaderName.ql +++ /dev/null @@ -1,5 +0,0 @@ -import javascript - -from HTTP::HeaderDefinition hd -where hd.getRouteHandler() instanceof Connect::RouteHandler -select hd, hd.getAHeaderName() diff --git a/javascript/ql/test/library-tests/frameworks/connect/HeaderDefinition_getAHeaderName.qll b/javascript/ql/test/library-tests/frameworks/connect/HeaderDefinition_getAHeaderName.qll new file mode 100644 index 000000000000..1f6438a51301 --- /dev/null +++ b/javascript/ql/test/library-tests/frameworks/connect/HeaderDefinition_getAHeaderName.qll @@ -0,0 +1,5 @@ +import javascript + +query predicate test_HeaderDefinition_getAHeaderName(HTTP::HeaderDefinition hd, string res) { + hd.getRouteHandler() instanceof Connect::RouteHandler and res = hd.getAHeaderName() +} diff --git a/javascript/ql/test/library-tests/frameworks/connect/RequestExpr.expected b/javascript/ql/test/library-tests/frameworks/connect/RequestExpr.expected deleted file mode 100644 index d723446ddce1..000000000000 --- a/javascript/ql/test/library-tests/frameworks/connect/RequestExpr.expected +++ /dev/null @@ -1 +0,0 @@ -| src/test.js:8:5:8:7 | req | src/test.js:6:9:9:1 | functio ... oo');\\n} | diff --git a/javascript/ql/test/library-tests/frameworks/connect/RequestExpr.ql b/javascript/ql/test/library-tests/frameworks/connect/RequestExpr.ql deleted file mode 100644 index 2a063d7225b2..000000000000 --- a/javascript/ql/test/library-tests/frameworks/connect/RequestExpr.ql +++ /dev/null @@ -1,4 +0,0 @@ -import javascript - -from Connect::RequestExpr e -select e, e.getRouteHandler() diff --git a/javascript/ql/test/library-tests/frameworks/connect/RequestExpr.qll b/javascript/ql/test/library-tests/frameworks/connect/RequestExpr.qll new file mode 100644 index 000000000000..272b7d3a0c90 --- /dev/null +++ b/javascript/ql/test/library-tests/frameworks/connect/RequestExpr.qll @@ -0,0 +1,5 @@ +import javascript + +query predicate test_RequestExpr(Connect::RequestExpr e, HTTP::RouteHandler res) { + res = e.getRouteHandler() +} diff --git a/javascript/ql/test/library-tests/frameworks/connect/RequestInputAccess.expected b/javascript/ql/test/library-tests/frameworks/connect/RequestInputAccess.expected deleted file mode 100644 index a4dfe4bedcc9..000000000000 --- a/javascript/ql/test/library-tests/frameworks/connect/RequestInputAccess.expected +++ /dev/null @@ -1 +0,0 @@ -| src/test.js:8:5:8:26 | req.coo ... ('foo') | cookie | src/test.js:6:9:9:1 | functio ... oo');\\n} | diff --git a/javascript/ql/test/library-tests/frameworks/connect/RequestInputAccess.ql b/javascript/ql/test/library-tests/frameworks/connect/RequestInputAccess.ql deleted file mode 100644 index 0c9c9de08824..000000000000 --- a/javascript/ql/test/library-tests/frameworks/connect/RequestInputAccess.ql +++ /dev/null @@ -1,5 +0,0 @@ -import javascript - -from HTTP::RequestInputAccess ria, Connect::RouteHandler rh -where ria.getRouteHandler() = rh -select ria, ria.getKind(), rh diff --git a/javascript/ql/test/library-tests/frameworks/connect/RequestInputAccess.qll b/javascript/ql/test/library-tests/frameworks/connect/RequestInputAccess.qll new file mode 100644 index 000000000000..92afccc9bda5 --- /dev/null +++ b/javascript/ql/test/library-tests/frameworks/connect/RequestInputAccess.qll @@ -0,0 +1,7 @@ +import javascript + +query predicate test_RequestInputAccess( + HTTP::RequestInputAccess ria, string res, Connect::RouteHandler rh +) { + ria.getRouteHandler() = rh and res = ria.getKind() +} diff --git a/javascript/ql/test/library-tests/frameworks/connect/ResponseExpr.expected b/javascript/ql/test/library-tests/frameworks/connect/ResponseExpr.expected deleted file mode 100644 index bf4422063c93..000000000000 --- a/javascript/ql/test/library-tests/frameworks/connect/ResponseExpr.expected +++ /dev/null @@ -1,2 +0,0 @@ -| src/test.js:7:5:7:7 | res | src/test.js:6:9:9:1 | functio ... oo');\\n} | -| src/test.js:25:5:25:7 | res | src/test.js:24:9:26:1 | functio ... '');\\n} | diff --git a/javascript/ql/test/library-tests/frameworks/connect/ResponseExpr.ql b/javascript/ql/test/library-tests/frameworks/connect/ResponseExpr.ql deleted file mode 100644 index d704affdeb95..000000000000 --- a/javascript/ql/test/library-tests/frameworks/connect/ResponseExpr.ql +++ /dev/null @@ -1,4 +0,0 @@ -import javascript - -from Connect::ResponseExpr e -select e, e.getRouteHandler() diff --git a/javascript/ql/test/library-tests/frameworks/connect/ResponseExpr.qll b/javascript/ql/test/library-tests/frameworks/connect/ResponseExpr.qll new file mode 100644 index 000000000000..6094e131af7f --- /dev/null +++ b/javascript/ql/test/library-tests/frameworks/connect/ResponseExpr.qll @@ -0,0 +1,5 @@ +import javascript + +query predicate test_ResponseExpr(Connect::ResponseExpr e, HTTP::RouteHandler res) { + res = e.getRouteHandler() +} diff --git a/javascript/ql/test/library-tests/frameworks/connect/RouteHandler.expected b/javascript/ql/test/library-tests/frameworks/connect/RouteHandler.expected deleted file mode 100644 index 209c97913ad1..000000000000 --- a/javascript/ql/test/library-tests/frameworks/connect/RouteHandler.expected +++ /dev/null @@ -1,5 +0,0 @@ -| src/test.js:6:9:9:1 | functio ... oo');\\n} | src/test.js:4:11:4:19 | connect() | -| src/test.js:15:12:15:32 | functio ... res){} | src/test.js:4:11:4:19 | connect() | -| src/test.js:19:9:19:27 | function(req,res){} | src/test.js:4:11:4:19 | connect() | -| src/test.js:20:10:20:28 | function(req,res){} | src/test.js:4:11:4:19 | connect() | -| src/test.js:24:9:26:1 | functio ... '');\\n} | src/test.js:4:11:4:19 | connect() | diff --git a/javascript/ql/test/library-tests/frameworks/connect/RouteHandler.ql b/javascript/ql/test/library-tests/frameworks/connect/RouteHandler.ql deleted file mode 100644 index 0bda9c067288..000000000000 --- a/javascript/ql/test/library-tests/frameworks/connect/RouteHandler.ql +++ /dev/null @@ -1,4 +0,0 @@ -import javascript - -from Connect::RouteHandler rh -select rh, rh.getServer() diff --git a/javascript/ql/test/library-tests/frameworks/connect/RouteHandler.qll b/javascript/ql/test/library-tests/frameworks/connect/RouteHandler.qll new file mode 100644 index 000000000000..77d95f676c27 --- /dev/null +++ b/javascript/ql/test/library-tests/frameworks/connect/RouteHandler.qll @@ -0,0 +1,3 @@ +import javascript + +query predicate test_RouteHandler(Connect::RouteHandler rh, Expr res) { res = rh.getServer() } diff --git a/javascript/ql/test/library-tests/frameworks/connect/RouteHandler_getARequestExpr.expected b/javascript/ql/test/library-tests/frameworks/connect/RouteHandler_getARequestExpr.expected deleted file mode 100644 index 8e45a6639de1..000000000000 --- a/javascript/ql/test/library-tests/frameworks/connect/RouteHandler_getARequestExpr.expected +++ /dev/null @@ -1 +0,0 @@ -| src/test.js:6:9:9:1 | functio ... oo');\\n} | src/test.js:8:5:8:7 | req | diff --git a/javascript/ql/test/library-tests/frameworks/connect/RouteHandler_getARequestExpr.ql b/javascript/ql/test/library-tests/frameworks/connect/RouteHandler_getARequestExpr.ql deleted file mode 100644 index 1e79bf934669..000000000000 --- a/javascript/ql/test/library-tests/frameworks/connect/RouteHandler_getARequestExpr.ql +++ /dev/null @@ -1,4 +0,0 @@ -import semmle.javascript.frameworks.Express - -from Connect::RouteHandler rh -select rh, rh.getARequestExpr() diff --git a/javascript/ql/test/library-tests/frameworks/connect/RouteHandler_getARequestExpr.qll b/javascript/ql/test/library-tests/frameworks/connect/RouteHandler_getARequestExpr.qll new file mode 100644 index 000000000000..26ad5db877e3 --- /dev/null +++ b/javascript/ql/test/library-tests/frameworks/connect/RouteHandler_getARequestExpr.qll @@ -0,0 +1,5 @@ +import semmle.javascript.frameworks.Express + +query predicate test_RouteHandler_getARequestExpr(Connect::RouteHandler rh, HTTP::RequestExpr res) { + res = rh.getARequestExpr() +} diff --git a/javascript/ql/test/library-tests/frameworks/connect/RouteHandler_getAResponseExpr.expected b/javascript/ql/test/library-tests/frameworks/connect/RouteHandler_getAResponseExpr.expected deleted file mode 100644 index 025d61c64a4a..000000000000 --- a/javascript/ql/test/library-tests/frameworks/connect/RouteHandler_getAResponseExpr.expected +++ /dev/null @@ -1,2 +0,0 @@ -| src/test.js:6:9:9:1 | functio ... oo');\\n} | src/test.js:7:5:7:7 | res | -| src/test.js:24:9:26:1 | functio ... '');\\n} | src/test.js:25:5:25:7 | res | diff --git a/javascript/ql/test/library-tests/frameworks/connect/RouteHandler_getAResponseExpr.ql b/javascript/ql/test/library-tests/frameworks/connect/RouteHandler_getAResponseExpr.ql deleted file mode 100644 index 2dcab34f6d5d..000000000000 --- a/javascript/ql/test/library-tests/frameworks/connect/RouteHandler_getAResponseExpr.ql +++ /dev/null @@ -1,4 +0,0 @@ -import semmle.javascript.frameworks.Express - -from Connect::RouteHandler rh -select rh, rh.getAResponseExpr() diff --git a/javascript/ql/test/library-tests/frameworks/connect/RouteHandler_getAResponseExpr.qll b/javascript/ql/test/library-tests/frameworks/connect/RouteHandler_getAResponseExpr.qll new file mode 100644 index 000000000000..48674882b7cc --- /dev/null +++ b/javascript/ql/test/library-tests/frameworks/connect/RouteHandler_getAResponseExpr.qll @@ -0,0 +1,5 @@ +import semmle.javascript.frameworks.Express + +query predicate test_RouteHandler_getAResponseExpr(Connect::RouteHandler rh, HTTP::ResponseExpr res) { + res = rh.getAResponseExpr() +} diff --git a/javascript/ql/test/library-tests/frameworks/connect/RouteHandler_getAResponseHeader.expected b/javascript/ql/test/library-tests/frameworks/connect/RouteHandler_getAResponseHeader.expected deleted file mode 100644 index ff1ceaac90ca..000000000000 --- a/javascript/ql/test/library-tests/frameworks/connect/RouteHandler_getAResponseHeader.expected +++ /dev/null @@ -1,2 +0,0 @@ -| src/test.js:6:9:9:1 | functio ... oo');\\n} | header1 | src/test.js:7:5:7:32 | res.set ... 1', '') | -| src/test.js:24:9:26:1 | functio ... '');\\n} | header2 | src/test.js:25:5:25:32 | res.set ... 2', '') | diff --git a/javascript/ql/test/library-tests/frameworks/connect/RouteHandler_getAResponseHeader.ql b/javascript/ql/test/library-tests/frameworks/connect/RouteHandler_getAResponseHeader.ql deleted file mode 100644 index 61fedd6b1936..000000000000 --- a/javascript/ql/test/library-tests/frameworks/connect/RouteHandler_getAResponseHeader.ql +++ /dev/null @@ -1,4 +0,0 @@ -import semmle.javascript.frameworks.Express - -from Connect::RouteHandler rh, string name -select rh, name, rh.getAResponseHeader(name) diff --git a/javascript/ql/test/library-tests/frameworks/connect/RouteHandler_getAResponseHeader.qll b/javascript/ql/test/library-tests/frameworks/connect/RouteHandler_getAResponseHeader.qll new file mode 100644 index 000000000000..d3a3cbd8fe4a --- /dev/null +++ b/javascript/ql/test/library-tests/frameworks/connect/RouteHandler_getAResponseHeader.qll @@ -0,0 +1,7 @@ +import semmle.javascript.frameworks.Express + +query predicate test_RouteHandler_getAResponseHeader( + Connect::RouteHandler rh, string name, HTTP::HeaderDefinition res +) { + res = rh.getAResponseHeader(name) +} diff --git a/javascript/ql/test/library-tests/frameworks/connect/RouteSetup.expected b/javascript/ql/test/library-tests/frameworks/connect/RouteSetup.expected deleted file mode 100644 index ac0a0ef53f17..000000000000 --- a/javascript/ql/test/library-tests/frameworks/connect/RouteSetup.expected +++ /dev/null @@ -1,6 +0,0 @@ -| src/test.js:6:1:9:2 | app.use ... o');\\n}) | -| src/test.js:12:1:12:42 | app.use ... word')) | -| src/test.js:17:1:17:21 | app.use ... dler()) | -| src/test.js:19:1:19:28 | app.use ... res){}) | -| src/test.js:19:1:20:29 | app.use ... res){}) | -| src/test.js:24:1:26:2 | app.use ... '');\\n}) | diff --git a/javascript/ql/test/library-tests/frameworks/connect/RouteSetup.ql b/javascript/ql/test/library-tests/frameworks/connect/RouteSetup.ql deleted file mode 100644 index 091f9c87201f..000000000000 --- a/javascript/ql/test/library-tests/frameworks/connect/RouteSetup.ql +++ /dev/null @@ -1,4 +0,0 @@ -import javascript - -from Connect::RouteSetup rs -select rs diff --git a/javascript/ql/test/library-tests/frameworks/connect/RouteSetup.qll b/javascript/ql/test/library-tests/frameworks/connect/RouteSetup.qll new file mode 100644 index 000000000000..29fea40d5184 --- /dev/null +++ b/javascript/ql/test/library-tests/frameworks/connect/RouteSetup.qll @@ -0,0 +1,3 @@ +import javascript + +query predicate test_RouteSetup(Connect::RouteSetup rs) { any() } diff --git a/javascript/ql/test/library-tests/frameworks/connect/RouteSetup_getARouteHandler.expected b/javascript/ql/test/library-tests/frameworks/connect/RouteSetup_getARouteHandler.expected deleted file mode 100644 index f20eddef0808..000000000000 --- a/javascript/ql/test/library-tests/frameworks/connect/RouteSetup_getARouteHandler.expected +++ /dev/null @@ -1,7 +0,0 @@ -| src/test.js:6:1:9:2 | app.use ... o');\\n}) | src/test.js:6:9:9:1 | functio ... oo');\\n} | -| src/test.js:12:1:12:42 | app.use ... word')) | src/test.js:12:9:12:41 | basicAu ... sword') | -| src/test.js:17:1:17:21 | app.use ... dler()) | src/test.js:15:12:15:32 | functio ... res){} | -| src/test.js:17:1:17:21 | app.use ... dler()) | src/test.js:17:9:17:20 | getHandler() | -| src/test.js:19:1:19:28 | app.use ... res){}) | src/test.js:19:9:19:27 | function(req,res){} | -| src/test.js:19:1:20:29 | app.use ... res){}) | src/test.js:20:10:20:28 | function(req,res){} | -| src/test.js:24:1:26:2 | app.use ... '');\\n}) | src/test.js:24:9:26:1 | functio ... '');\\n} | diff --git a/javascript/ql/test/library-tests/frameworks/connect/RouteSetup_getARouteHandler.ql b/javascript/ql/test/library-tests/frameworks/connect/RouteSetup_getARouteHandler.ql deleted file mode 100644 index a108850b4b3e..000000000000 --- a/javascript/ql/test/library-tests/frameworks/connect/RouteSetup_getARouteHandler.ql +++ /dev/null @@ -1,4 +0,0 @@ -import javascript - -from Connect::RouteSetup r -select r, r.getARouteHandler() diff --git a/javascript/ql/test/library-tests/frameworks/connect/RouteSetup_getARouteHandler.qll b/javascript/ql/test/library-tests/frameworks/connect/RouteSetup_getARouteHandler.qll new file mode 100644 index 000000000000..6e3d66abb5ca --- /dev/null +++ b/javascript/ql/test/library-tests/frameworks/connect/RouteSetup_getARouteHandler.qll @@ -0,0 +1,5 @@ +import javascript + +query predicate test_RouteSetup_getARouteHandler(Connect::RouteSetup r, DataFlow::SourceNode res) { + res = r.getARouteHandler() +} diff --git a/javascript/ql/test/library-tests/frameworks/connect/RouteSetup_getServer.expected b/javascript/ql/test/library-tests/frameworks/connect/RouteSetup_getServer.expected deleted file mode 100644 index 4156e030962f..000000000000 --- a/javascript/ql/test/library-tests/frameworks/connect/RouteSetup_getServer.expected +++ /dev/null @@ -1,6 +0,0 @@ -| src/test.js:6:1:9:2 | app.use ... o');\\n}) | src/test.js:4:11:4:19 | connect() | -| src/test.js:12:1:12:42 | app.use ... word')) | src/test.js:4:11:4:19 | connect() | -| src/test.js:17:1:17:21 | app.use ... dler()) | src/test.js:4:11:4:19 | connect() | -| src/test.js:19:1:19:28 | app.use ... res){}) | src/test.js:4:11:4:19 | connect() | -| src/test.js:19:1:20:29 | app.use ... res){}) | src/test.js:4:11:4:19 | connect() | -| src/test.js:24:1:26:2 | app.use ... '');\\n}) | src/test.js:4:11:4:19 | connect() | diff --git a/javascript/ql/test/library-tests/frameworks/connect/RouteSetup_getServer.ql b/javascript/ql/test/library-tests/frameworks/connect/RouteSetup_getServer.ql deleted file mode 100644 index 89aa3cf19f2c..000000000000 --- a/javascript/ql/test/library-tests/frameworks/connect/RouteSetup_getServer.ql +++ /dev/null @@ -1,4 +0,0 @@ -import javascript - -from Connect::RouteSetup rs -select rs, rs.getServer() diff --git a/javascript/ql/test/library-tests/frameworks/connect/RouteSetup_getServer.qll b/javascript/ql/test/library-tests/frameworks/connect/RouteSetup_getServer.qll new file mode 100644 index 000000000000..58f208d5f450 --- /dev/null +++ b/javascript/ql/test/library-tests/frameworks/connect/RouteSetup_getServer.qll @@ -0,0 +1,3 @@ +import javascript + +query predicate test_RouteSetup_getServer(Connect::RouteSetup rs, Expr res) { res = rs.getServer() } diff --git a/javascript/ql/test/library-tests/frameworks/connect/ServerDefinition.expected b/javascript/ql/test/library-tests/frameworks/connect/ServerDefinition.expected deleted file mode 100644 index d34ea865b483..000000000000 --- a/javascript/ql/test/library-tests/frameworks/connect/ServerDefinition.expected +++ /dev/null @@ -1 +0,0 @@ -| src/test.js:4:11:4:19 | connect() | diff --git a/javascript/ql/test/library-tests/frameworks/connect/ServerDefinition.ql b/javascript/ql/test/library-tests/frameworks/connect/ServerDefinition.ql deleted file mode 100644 index a9fd70dd4bdc..000000000000 --- a/javascript/ql/test/library-tests/frameworks/connect/ServerDefinition.ql +++ /dev/null @@ -1,4 +0,0 @@ -import javascript - -from Connect::ServerDefinition s -select s diff --git a/javascript/ql/test/library-tests/frameworks/connect/ServerDefinition.qll b/javascript/ql/test/library-tests/frameworks/connect/ServerDefinition.qll new file mode 100644 index 000000000000..b21f5bc196fa --- /dev/null +++ b/javascript/ql/test/library-tests/frameworks/connect/ServerDefinition.qll @@ -0,0 +1,3 @@ +import javascript + +query predicate test_ServerDefinition(Connect::ServerDefinition s) { any() } diff --git a/javascript/ql/test/library-tests/frameworks/connect/tests.expected b/javascript/ql/test/library-tests/frameworks/connect/tests.expected new file mode 100644 index 000000000000..4ebaa53a87f1 --- /dev/null +++ b/javascript/ql/test/library-tests/frameworks/connect/tests.expected @@ -0,0 +1,57 @@ +test_RouteSetup +| src/test.js:6:1:9:2 | app.use ... o');\\n}) | +| src/test.js:12:1:12:42 | app.use ... word')) | +| src/test.js:17:1:17:21 | app.use ... dler()) | +| src/test.js:19:1:19:28 | app.use ... res){}) | +| src/test.js:19:1:20:29 | app.use ... res){}) | +| src/test.js:24:1:26:2 | app.use ... '');\\n}) | +test_RequestInputAccess +| src/test.js:8:5:8:26 | req.coo ... ('foo') | cookie | src/test.js:6:9:9:1 | functio ... oo');\\n} | +test_RouteHandler_getAResponseHeader +| src/test.js:6:9:9:1 | functio ... oo');\\n} | header1 | src/test.js:7:5:7:32 | res.set ... 1', '') | +| src/test.js:24:9:26:1 | functio ... '');\\n} | header2 | src/test.js:25:5:25:32 | res.set ... 2', '') | +test_HeaderDefinition_defines +| src/test.js:7:5:7:32 | res.set ... 1', '') | header1 | | +| src/test.js:25:5:25:32 | res.set ... 2', '') | header2 | | +test_ResponseExpr +| src/test.js:7:5:7:7 | res | src/test.js:6:9:9:1 | functio ... oo');\\n} | +| src/test.js:25:5:25:7 | res | src/test.js:24:9:26:1 | functio ... '');\\n} | +test_HeaderDefinition +| src/test.js:7:5:7:32 | res.set ... 1', '') | src/test.js:6:9:9:1 | functio ... oo');\\n} | +| src/test.js:25:5:25:32 | res.set ... 2', '') | src/test.js:24:9:26:1 | functio ... '');\\n} | +test_RouteSetup_getServer +| src/test.js:6:1:9:2 | app.use ... o');\\n}) | src/test.js:4:11:4:19 | connect() | +| src/test.js:12:1:12:42 | app.use ... word')) | src/test.js:4:11:4:19 | connect() | +| src/test.js:17:1:17:21 | app.use ... dler()) | src/test.js:4:11:4:19 | connect() | +| src/test.js:19:1:19:28 | app.use ... res){}) | src/test.js:4:11:4:19 | connect() | +| src/test.js:19:1:20:29 | app.use ... res){}) | src/test.js:4:11:4:19 | connect() | +| src/test.js:24:1:26:2 | app.use ... '');\\n}) | src/test.js:4:11:4:19 | connect() | +test_HeaderDefinition_getAHeaderName +| src/test.js:7:5:7:32 | res.set ... 1', '') | header1 | +| src/test.js:25:5:25:32 | res.set ... 2', '') | header2 | +test_ServerDefinition +| src/test.js:4:11:4:19 | connect() | +test_RouteHandler_getAResponseExpr +| src/test.js:6:9:9:1 | functio ... oo');\\n} | src/test.js:7:5:7:7 | res | +| src/test.js:24:9:26:1 | functio ... '');\\n} | src/test.js:25:5:25:7 | res | +test_RouteSetup_getARouteHandler +| src/test.js:6:1:9:2 | app.use ... o');\\n}) | src/test.js:6:9:9:1 | functio ... oo');\\n} | +| src/test.js:12:1:12:42 | app.use ... word')) | src/test.js:12:9:12:41 | basicAu ... sword') | +| src/test.js:17:1:17:21 | app.use ... dler()) | src/test.js:15:12:15:32 | functio ... res){} | +| src/test.js:17:1:17:21 | app.use ... dler()) | src/test.js:17:9:17:20 | getHandler() | +| src/test.js:19:1:19:28 | app.use ... res){}) | src/test.js:19:9:19:27 | function(req,res){} | +| src/test.js:19:1:20:29 | app.use ... res){}) | src/test.js:20:10:20:28 | function(req,res){} | +| src/test.js:24:1:26:2 | app.use ... '');\\n}) | src/test.js:24:9:26:1 | functio ... '');\\n} | +test_RouteHandler +| src/test.js:6:9:9:1 | functio ... oo');\\n} | src/test.js:4:11:4:19 | connect() | +| src/test.js:15:12:15:32 | functio ... res){} | src/test.js:4:11:4:19 | connect() | +| src/test.js:19:9:19:27 | function(req,res){} | src/test.js:4:11:4:19 | connect() | +| src/test.js:20:10:20:28 | function(req,res){} | src/test.js:4:11:4:19 | connect() | +| src/test.js:24:9:26:1 | functio ... '');\\n} | src/test.js:4:11:4:19 | connect() | +test_RequestExpr +| src/test.js:8:5:8:7 | req | src/test.js:6:9:9:1 | functio ... oo');\\n} | +test_Credentials +| src/test.js:12:19:12:28 | 'username' | user name | +| src/test.js:12:31:12:40 | 'password' | password | +test_RouteHandler_getARequestExpr +| src/test.js:6:9:9:1 | functio ... oo');\\n} | src/test.js:8:5:8:7 | req | diff --git a/javascript/ql/test/library-tests/frameworks/connect/tests.ql b/javascript/ql/test/library-tests/frameworks/connect/tests.ql new file mode 100644 index 000000000000..a99bef7726fa --- /dev/null +++ b/javascript/ql/test/library-tests/frameworks/connect/tests.ql @@ -0,0 +1,15 @@ +import RouteSetup +import RequestInputAccess +import RouteHandler_getAResponseHeader +import HeaderDefinition_defines +import ResponseExpr +import HeaderDefinition +import RouteSetup_getServer +import HeaderDefinition_getAHeaderName +import ServerDefinition +import RouteHandler_getAResponseExpr +import RouteSetup_getARouteHandler +import RouteHandler +import RequestExpr +import Credentials +import RouteHandler_getARequestExpr diff --git a/javascript/ql/test/library-tests/frameworks/hapi/HeaderAccess.expected b/javascript/ql/test/library-tests/frameworks/hapi/HeaderAccess.expected deleted file mode 100644 index d1c319fe36ab..000000000000 --- a/javascript/ql/test/library-tests/frameworks/hapi/HeaderAccess.expected +++ /dev/null @@ -1 +0,0 @@ -| src/hapi.js:25:3:25:21 | request.headers.baz | baz | diff --git a/javascript/ql/test/library-tests/frameworks/hapi/HeaderAccess.ql b/javascript/ql/test/library-tests/frameworks/hapi/HeaderAccess.ql deleted file mode 100644 index a86349b65cbf..000000000000 --- a/javascript/ql/test/library-tests/frameworks/hapi/HeaderAccess.ql +++ /dev/null @@ -1,4 +0,0 @@ -import javascript - -from HTTP::RequestHeaderAccess access -select access, access.getAHeaderName() diff --git a/javascript/ql/test/library-tests/frameworks/hapi/HeaderAccess.qll b/javascript/ql/test/library-tests/frameworks/hapi/HeaderAccess.qll new file mode 100644 index 000000000000..22d1d6aee539 --- /dev/null +++ b/javascript/ql/test/library-tests/frameworks/hapi/HeaderAccess.qll @@ -0,0 +1,5 @@ +import javascript + +query predicate test_HeaderAccess(HTTP::RequestHeaderAccess access, string res) { + res = access.getAHeaderName() +} diff --git a/javascript/ql/test/library-tests/frameworks/hapi/HeaderDefinition.expected b/javascript/ql/test/library-tests/frameworks/hapi/HeaderDefinition.expected deleted file mode 100644 index 12030dc41b7f..000000000000 --- a/javascript/ql/test/library-tests/frameworks/hapi/HeaderDefinition.expected +++ /dev/null @@ -1 +0,0 @@ -| src/hapi.js:14:9:14:46 | request ... 1', '') | src/hapi.js:13:14:15:5 | functio ... n\\n } | diff --git a/javascript/ql/test/library-tests/frameworks/hapi/HeaderDefinition.ql b/javascript/ql/test/library-tests/frameworks/hapi/HeaderDefinition.ql deleted file mode 100644 index 58197538710f..000000000000 --- a/javascript/ql/test/library-tests/frameworks/hapi/HeaderDefinition.ql +++ /dev/null @@ -1,5 +0,0 @@ -import javascript - -from HTTP::HeaderDefinition hd, Hapi::RouteHandler rh -where rh = hd.getRouteHandler() -select hd, rh diff --git a/javascript/ql/test/library-tests/frameworks/hapi/HeaderDefinition.qll b/javascript/ql/test/library-tests/frameworks/hapi/HeaderDefinition.qll new file mode 100644 index 000000000000..5ed82a5f5913 --- /dev/null +++ b/javascript/ql/test/library-tests/frameworks/hapi/HeaderDefinition.qll @@ -0,0 +1,5 @@ +import javascript + +query predicate test_HeaderDefinition(HTTP::HeaderDefinition hd, Hapi::RouteHandler rh) { + rh = hd.getRouteHandler() +} diff --git a/javascript/ql/test/library-tests/frameworks/hapi/HeaderDefinition_defines.expected b/javascript/ql/test/library-tests/frameworks/hapi/HeaderDefinition_defines.expected deleted file mode 100644 index 2998ea449f5d..000000000000 --- a/javascript/ql/test/library-tests/frameworks/hapi/HeaderDefinition_defines.expected +++ /dev/null @@ -1 +0,0 @@ -| src/hapi.js:14:9:14:46 | request ... 1', '') | header1 | | diff --git a/javascript/ql/test/library-tests/frameworks/hapi/HeaderDefinition_defines.ql b/javascript/ql/test/library-tests/frameworks/hapi/HeaderDefinition_defines.ql deleted file mode 100644 index d3c2c2c788c7..000000000000 --- a/javascript/ql/test/library-tests/frameworks/hapi/HeaderDefinition_defines.ql +++ /dev/null @@ -1,7 +0,0 @@ -import javascript - -from HTTP::HeaderDefinition hd, string name, string value -where - hd.defines(name, value) and - hd.getRouteHandler() instanceof Hapi::RouteHandler -select hd, name, value diff --git a/javascript/ql/test/library-tests/frameworks/hapi/HeaderDefinition_defines.qll b/javascript/ql/test/library-tests/frameworks/hapi/HeaderDefinition_defines.qll new file mode 100644 index 000000000000..56ccb45dcfbf --- /dev/null +++ b/javascript/ql/test/library-tests/frameworks/hapi/HeaderDefinition_defines.qll @@ -0,0 +1,5 @@ +import javascript + +query predicate test_HeaderDefinition_defines(HTTP::HeaderDefinition hd, string name, string value) { + hd.defines(name, value) and hd.getRouteHandler() instanceof Hapi::RouteHandler +} diff --git a/javascript/ql/test/library-tests/frameworks/hapi/HeaderDefinition_getAHeaderName.expected b/javascript/ql/test/library-tests/frameworks/hapi/HeaderDefinition_getAHeaderName.expected deleted file mode 100644 index 9b6a868d8416..000000000000 --- a/javascript/ql/test/library-tests/frameworks/hapi/HeaderDefinition_getAHeaderName.expected +++ /dev/null @@ -1 +0,0 @@ -| src/hapi.js:14:9:14:46 | request ... 1', '') | header1 | diff --git a/javascript/ql/test/library-tests/frameworks/hapi/HeaderDefinition_getAHeaderName.ql b/javascript/ql/test/library-tests/frameworks/hapi/HeaderDefinition_getAHeaderName.ql deleted file mode 100644 index c2658cb32223..000000000000 --- a/javascript/ql/test/library-tests/frameworks/hapi/HeaderDefinition_getAHeaderName.ql +++ /dev/null @@ -1,5 +0,0 @@ -import javascript - -from HTTP::HeaderDefinition hd -where hd.getRouteHandler() instanceof Hapi::RouteHandler -select hd, hd.getAHeaderName() diff --git a/javascript/ql/test/library-tests/frameworks/hapi/HeaderDefinition_getAHeaderName.qll b/javascript/ql/test/library-tests/frameworks/hapi/HeaderDefinition_getAHeaderName.qll new file mode 100644 index 000000000000..7bc108da9737 --- /dev/null +++ b/javascript/ql/test/library-tests/frameworks/hapi/HeaderDefinition_getAHeaderName.qll @@ -0,0 +1,5 @@ +import javascript + +query predicate test_HeaderDefinition_getAHeaderName(HTTP::HeaderDefinition hd, string res) { + hd.getRouteHandler() instanceof Hapi::RouteHandler and res = hd.getAHeaderName() +} diff --git a/javascript/ql/test/library-tests/frameworks/hapi/RequestExpr.expected b/javascript/ql/test/library-tests/frameworks/hapi/RequestExpr.expected deleted file mode 100644 index 781ad30cefcf..000000000000 --- a/javascript/ql/test/library-tests/frameworks/hapi/RequestExpr.expected +++ /dev/null @@ -1,7 +0,0 @@ -| src/hapi.js:14:9:14:15 | request | src/hapi.js:13:14:15:5 | functio ... n\\n } | -| src/hapi.js:21:3:21:9 | request | src/hapi.js:20:1:27:1 | functio ... oken;\\n} | -| src/hapi.js:22:3:22:9 | request | src/hapi.js:20:1:27:1 | functio ... oken;\\n} | -| src/hapi.js:23:3:23:9 | request | src/hapi.js:20:1:27:1 | functio ... oken;\\n} | -| src/hapi.js:24:3:24:9 | request | src/hapi.js:20:1:27:1 | functio ... oken;\\n} | -| src/hapi.js:25:3:25:9 | request | src/hapi.js:20:1:27:1 | functio ... oken;\\n} | -| src/hapi.js:26:3:26:9 | request | src/hapi.js:20:1:27:1 | functio ... oken;\\n} | diff --git a/javascript/ql/test/library-tests/frameworks/hapi/RequestExpr.ql b/javascript/ql/test/library-tests/frameworks/hapi/RequestExpr.ql deleted file mode 100644 index 5f634919c6d4..000000000000 --- a/javascript/ql/test/library-tests/frameworks/hapi/RequestExpr.ql +++ /dev/null @@ -1,4 +0,0 @@ -import javascript - -from Hapi::RequestExpr e -select e, e.getRouteHandler() diff --git a/javascript/ql/test/library-tests/frameworks/hapi/RequestExpr.qll b/javascript/ql/test/library-tests/frameworks/hapi/RequestExpr.qll new file mode 100644 index 000000000000..d412847a950e --- /dev/null +++ b/javascript/ql/test/library-tests/frameworks/hapi/RequestExpr.qll @@ -0,0 +1,5 @@ +import javascript + +query predicate test_RequestExpr(Hapi::RequestExpr e, HTTP::RouteHandler res) { + res = e.getRouteHandler() +} diff --git a/javascript/ql/test/library-tests/frameworks/hapi/RequestInputAccess.expected b/javascript/ql/test/library-tests/frameworks/hapi/RequestInputAccess.expected deleted file mode 100644 index cb7d50852a50..000000000000 --- a/javascript/ql/test/library-tests/frameworks/hapi/RequestInputAccess.expected +++ /dev/null @@ -1,6 +0,0 @@ -| src/hapi.js:21:3:21:20 | request.rawPayload | body | src/hapi.js:20:1:27:1 | functio ... oken;\\n} | -| src/hapi.js:22:3:22:21 | request.payload.foo | body | src/hapi.js:20:1:27:1 | functio ... oken;\\n} | -| src/hapi.js:23:3:23:19 | request.query.bar | parameter | src/hapi.js:20:1:27:1 | functio ... oken;\\n} | -| src/hapi.js:24:3:24:18 | request.url.path | url | src/hapi.js:20:1:27:1 | functio ... oken;\\n} | -| src/hapi.js:25:3:25:21 | request.headers.baz | header | src/hapi.js:20:1:27:1 | functio ... oken;\\n} | -| src/hapi.js:26:3:26:21 | request.state.token | cookie | src/hapi.js:20:1:27:1 | functio ... oken;\\n} | diff --git a/javascript/ql/test/library-tests/frameworks/hapi/RequestInputAccess.ql b/javascript/ql/test/library-tests/frameworks/hapi/RequestInputAccess.ql deleted file mode 100644 index d484c39a5661..000000000000 --- a/javascript/ql/test/library-tests/frameworks/hapi/RequestInputAccess.ql +++ /dev/null @@ -1,5 +0,0 @@ -import javascript - -from HTTP::RequestInputAccess ria, Hapi::RouteHandler rh -where ria.getRouteHandler() = rh -select ria, ria.getKind(), rh diff --git a/javascript/ql/test/library-tests/frameworks/hapi/RequestInputAccess.qll b/javascript/ql/test/library-tests/frameworks/hapi/RequestInputAccess.qll new file mode 100644 index 000000000000..4146cb91cb6b --- /dev/null +++ b/javascript/ql/test/library-tests/frameworks/hapi/RequestInputAccess.qll @@ -0,0 +1,7 @@ +import javascript + +query predicate test_RequestInputAccess( + HTTP::RequestInputAccess ria, string res, Hapi::RouteHandler rh +) { + ria.getRouteHandler() = rh and res = ria.getKind() +} diff --git a/javascript/ql/test/library-tests/frameworks/hapi/ResponseExpr.expected b/javascript/ql/test/library-tests/frameworks/hapi/ResponseExpr.expected deleted file mode 100644 index 37635079befb..000000000000 --- a/javascript/ql/test/library-tests/frameworks/hapi/ResponseExpr.expected +++ /dev/null @@ -1 +0,0 @@ -| src/hapi.js:14:9:14:24 | request.response | src/hapi.js:13:14:15:5 | functio ... n\\n } | diff --git a/javascript/ql/test/library-tests/frameworks/hapi/ResponseExpr.ql b/javascript/ql/test/library-tests/frameworks/hapi/ResponseExpr.ql deleted file mode 100644 index d71ba7db559f..000000000000 --- a/javascript/ql/test/library-tests/frameworks/hapi/ResponseExpr.ql +++ /dev/null @@ -1,4 +0,0 @@ -import javascript - -from Hapi::ResponseExpr e -select e, e.getRouteHandler() diff --git a/javascript/ql/test/library-tests/frameworks/hapi/ResponseExpr.qll b/javascript/ql/test/library-tests/frameworks/hapi/ResponseExpr.qll new file mode 100644 index 000000000000..9acfedd73f79 --- /dev/null +++ b/javascript/ql/test/library-tests/frameworks/hapi/ResponseExpr.qll @@ -0,0 +1,5 @@ +import javascript + +query predicate test_ResponseExpr(Hapi::ResponseExpr e, HTTP::RouteHandler res) { + res = e.getRouteHandler() +} diff --git a/javascript/ql/test/library-tests/frameworks/hapi/RouteHandler.expected b/javascript/ql/test/library-tests/frameworks/hapi/RouteHandler.expected deleted file mode 100644 index d514a6d76f3c..000000000000 --- a/javascript/ql/test/library-tests/frameworks/hapi/RouteHandler.expected +++ /dev/null @@ -1,5 +0,0 @@ -| src/hapi.js:6:1:6:21 | functio ... er1(){} | src/hapi.js:4:15:4:31 | new Hapi.Server() | -| src/hapi.js:13:14:15:5 | functio ... n\\n } | src/hapi.js:4:15:4:31 | new Hapi.Server() | -| src/hapi.js:17:30:18:1 | functio ... ndler\\n} | src/hapi.js:4:15:4:31 | new Hapi.Server() | -| src/hapi.js:20:1:27:1 | functio ... oken;\\n} | src/hapi.js:4:15:4:31 | new Hapi.Server() | -| src/hapi.js:34:12:34:30 | function (req, h){} | src/hapi.js:4:15:4:31 | new Hapi.Server() | diff --git a/javascript/ql/test/library-tests/frameworks/hapi/RouteHandler.ql b/javascript/ql/test/library-tests/frameworks/hapi/RouteHandler.ql deleted file mode 100644 index 2b4835f8e1e9..000000000000 --- a/javascript/ql/test/library-tests/frameworks/hapi/RouteHandler.ql +++ /dev/null @@ -1,4 +0,0 @@ -import javascript - -from Hapi::RouteHandler rh -select rh, rh.getServer() diff --git a/javascript/ql/test/library-tests/frameworks/hapi/RouteHandler.qll b/javascript/ql/test/library-tests/frameworks/hapi/RouteHandler.qll new file mode 100644 index 000000000000..45e51d1b9995 --- /dev/null +++ b/javascript/ql/test/library-tests/frameworks/hapi/RouteHandler.qll @@ -0,0 +1,3 @@ +import javascript + +query predicate test_RouteHandler(Hapi::RouteHandler rh, Expr res) { res = rh.getServer() } diff --git a/javascript/ql/test/library-tests/frameworks/hapi/RouteHandler_getARequestExpr.expected b/javascript/ql/test/library-tests/frameworks/hapi/RouteHandler_getARequestExpr.expected deleted file mode 100644 index ccc0ef7d6a9b..000000000000 --- a/javascript/ql/test/library-tests/frameworks/hapi/RouteHandler_getARequestExpr.expected +++ /dev/null @@ -1,7 +0,0 @@ -| src/hapi.js:13:14:15:5 | functio ... n\\n } | src/hapi.js:14:9:14:15 | request | -| src/hapi.js:20:1:27:1 | functio ... oken;\\n} | src/hapi.js:21:3:21:9 | request | -| src/hapi.js:20:1:27:1 | functio ... oken;\\n} | src/hapi.js:22:3:22:9 | request | -| src/hapi.js:20:1:27:1 | functio ... oken;\\n} | src/hapi.js:23:3:23:9 | request | -| src/hapi.js:20:1:27:1 | functio ... oken;\\n} | src/hapi.js:24:3:24:9 | request | -| src/hapi.js:20:1:27:1 | functio ... oken;\\n} | src/hapi.js:25:3:25:9 | request | -| src/hapi.js:20:1:27:1 | functio ... oken;\\n} | src/hapi.js:26:3:26:9 | request | diff --git a/javascript/ql/test/library-tests/frameworks/hapi/RouteHandler_getARequestExpr.ql b/javascript/ql/test/library-tests/frameworks/hapi/RouteHandler_getARequestExpr.ql deleted file mode 100644 index d4cf95d81793..000000000000 --- a/javascript/ql/test/library-tests/frameworks/hapi/RouteHandler_getARequestExpr.ql +++ /dev/null @@ -1,4 +0,0 @@ -import semmle.javascript.frameworks.Express - -from Hapi::RouteHandler rh -select rh, rh.getARequestExpr() diff --git a/javascript/ql/test/library-tests/frameworks/hapi/RouteHandler_getARequestExpr.qll b/javascript/ql/test/library-tests/frameworks/hapi/RouteHandler_getARequestExpr.qll new file mode 100644 index 000000000000..51b719430d76 --- /dev/null +++ b/javascript/ql/test/library-tests/frameworks/hapi/RouteHandler_getARequestExpr.qll @@ -0,0 +1,5 @@ +import semmle.javascript.frameworks.Express + +query predicate test_RouteHandler_getARequestExpr(Hapi::RouteHandler rh, HTTP::RequestExpr res) { + res = rh.getARequestExpr() +} diff --git a/javascript/ql/test/library-tests/frameworks/hapi/RouteHandler_getAResponseHeader.expected b/javascript/ql/test/library-tests/frameworks/hapi/RouteHandler_getAResponseHeader.expected deleted file mode 100644 index 7a044d988825..000000000000 --- a/javascript/ql/test/library-tests/frameworks/hapi/RouteHandler_getAResponseHeader.expected +++ /dev/null @@ -1 +0,0 @@ -| src/hapi.js:13:14:15:5 | functio ... n\\n } | header1 | src/hapi.js:14:9:14:46 | request ... 1', '') | diff --git a/javascript/ql/test/library-tests/frameworks/hapi/RouteHandler_getAResponseHeader.ql b/javascript/ql/test/library-tests/frameworks/hapi/RouteHandler_getAResponseHeader.ql deleted file mode 100644 index f5552d83bc7f..000000000000 --- a/javascript/ql/test/library-tests/frameworks/hapi/RouteHandler_getAResponseHeader.ql +++ /dev/null @@ -1,4 +0,0 @@ -import semmle.javascript.frameworks.Express - -from Hapi::RouteHandler rh, string name -select rh, name, rh.getAResponseHeader(name) diff --git a/javascript/ql/test/library-tests/frameworks/hapi/RouteHandler_getAResponseHeader.qll b/javascript/ql/test/library-tests/frameworks/hapi/RouteHandler_getAResponseHeader.qll new file mode 100644 index 000000000000..84aa08d92e12 --- /dev/null +++ b/javascript/ql/test/library-tests/frameworks/hapi/RouteHandler_getAResponseHeader.qll @@ -0,0 +1,7 @@ +import semmle.javascript.frameworks.Express + +query predicate test_RouteHandler_getAResponseHeader( + Hapi::RouteHandler rh, string name, HTTP::HeaderDefinition res +) { + res = rh.getAResponseHeader(name) +} diff --git a/javascript/ql/test/library-tests/frameworks/hapi/RouteSetup.expected b/javascript/ql/test/library-tests/frameworks/hapi/RouteSetup.expected deleted file mode 100644 index 32f869b2a435..000000000000 --- a/javascript/ql/test/library-tests/frameworks/hapi/RouteSetup.expected +++ /dev/null @@ -1,5 +0,0 @@ -| src/hapi.js:7:1:9:2 | server2 ... ler1\\n}) | -| src/hapi.js:12:1:15:7 | server2 ... }}) | -| src/hapi.js:17:1:18:2 | server2 ... dler\\n}) | -| src/hapi.js:29:1:29:20 | server2.route(route) | -| src/hapi.js:36:1:36:38 | server2 ... ler()}) | diff --git a/javascript/ql/test/library-tests/frameworks/hapi/RouteSetup.ql b/javascript/ql/test/library-tests/frameworks/hapi/RouteSetup.ql deleted file mode 100644 index 7e1fcf8f26c3..000000000000 --- a/javascript/ql/test/library-tests/frameworks/hapi/RouteSetup.ql +++ /dev/null @@ -1,4 +0,0 @@ -import javascript - -from Hapi::RouteSetup rs -select rs diff --git a/javascript/ql/test/library-tests/frameworks/hapi/RouteSetup.qll b/javascript/ql/test/library-tests/frameworks/hapi/RouteSetup.qll new file mode 100644 index 000000000000..01da1ecca6b3 --- /dev/null +++ b/javascript/ql/test/library-tests/frameworks/hapi/RouteSetup.qll @@ -0,0 +1,3 @@ +import javascript + +query predicate test_RouteSetup(Hapi::RouteSetup rs) { any() } diff --git a/javascript/ql/test/library-tests/frameworks/hapi/RouteSetup_getARouteHandler.expected b/javascript/ql/test/library-tests/frameworks/hapi/RouteSetup_getARouteHandler.expected deleted file mode 100644 index 0c9d8c91592d..000000000000 --- a/javascript/ql/test/library-tests/frameworks/hapi/RouteSetup_getARouteHandler.expected +++ /dev/null @@ -1,6 +0,0 @@ -| src/hapi.js:7:1:9:2 | server2 ... ler1\\n}) | src/hapi.js:6:1:6:21 | functio ... er1(){} | -| src/hapi.js:12:1:15:7 | server2 ... }}) | src/hapi.js:13:14:15:5 | functio ... n\\n } | -| src/hapi.js:17:1:18:2 | server2 ... dler\\n}) | src/hapi.js:17:30:18:1 | functio ... ndler\\n} | -| src/hapi.js:29:1:29:20 | server2.route(route) | src/hapi.js:20:1:27:1 | functio ... oken;\\n} | -| src/hapi.js:36:1:36:38 | server2 ... ler()}) | src/hapi.js:34:12:34:30 | function (req, h){} | -| src/hapi.js:36:1:36:38 | server2 ... ler()}) | src/hapi.js:36:25:36:36 | getHandler() | diff --git a/javascript/ql/test/library-tests/frameworks/hapi/RouteSetup_getARouteHandler.ql b/javascript/ql/test/library-tests/frameworks/hapi/RouteSetup_getARouteHandler.ql deleted file mode 100644 index fdd8d6757c54..000000000000 --- a/javascript/ql/test/library-tests/frameworks/hapi/RouteSetup_getARouteHandler.ql +++ /dev/null @@ -1,4 +0,0 @@ -import javascript - -from Hapi::RouteSetup r -select r, r.getARouteHandler() diff --git a/javascript/ql/test/library-tests/frameworks/hapi/RouteSetup_getARouteHandler.qll b/javascript/ql/test/library-tests/frameworks/hapi/RouteSetup_getARouteHandler.qll new file mode 100644 index 000000000000..0bff81df9673 --- /dev/null +++ b/javascript/ql/test/library-tests/frameworks/hapi/RouteSetup_getARouteHandler.qll @@ -0,0 +1,5 @@ +import javascript + +query predicate test_RouteSetup_getARouteHandler(Hapi::RouteSetup r, DataFlow::SourceNode res) { + res = r.getARouteHandler() +} diff --git a/javascript/ql/test/library-tests/frameworks/hapi/RouteSetup_getServer.expected b/javascript/ql/test/library-tests/frameworks/hapi/RouteSetup_getServer.expected deleted file mode 100644 index 41ebdfc4e3b4..000000000000 --- a/javascript/ql/test/library-tests/frameworks/hapi/RouteSetup_getServer.expected +++ /dev/null @@ -1,5 +0,0 @@ -| src/hapi.js:7:1:9:2 | server2 ... ler1\\n}) | src/hapi.js:4:15:4:31 | new Hapi.Server() | -| src/hapi.js:12:1:15:7 | server2 ... }}) | src/hapi.js:4:15:4:31 | new Hapi.Server() | -| src/hapi.js:17:1:18:2 | server2 ... dler\\n}) | src/hapi.js:4:15:4:31 | new Hapi.Server() | -| src/hapi.js:29:1:29:20 | server2.route(route) | src/hapi.js:4:15:4:31 | new Hapi.Server() | -| src/hapi.js:36:1:36:38 | server2 ... ler()}) | src/hapi.js:4:15:4:31 | new Hapi.Server() | diff --git a/javascript/ql/test/library-tests/frameworks/hapi/RouteSetup_getServer.ql b/javascript/ql/test/library-tests/frameworks/hapi/RouteSetup_getServer.ql deleted file mode 100644 index 27907a0c3a70..000000000000 --- a/javascript/ql/test/library-tests/frameworks/hapi/RouteSetup_getServer.ql +++ /dev/null @@ -1,4 +0,0 @@ -import javascript - -from Hapi::RouteSetup rs -select rs, rs.getServer() diff --git a/javascript/ql/test/library-tests/frameworks/hapi/RouteSetup_getServer.qll b/javascript/ql/test/library-tests/frameworks/hapi/RouteSetup_getServer.qll new file mode 100644 index 000000000000..ffdbe44e168e --- /dev/null +++ b/javascript/ql/test/library-tests/frameworks/hapi/RouteSetup_getServer.qll @@ -0,0 +1,3 @@ +import javascript + +query predicate test_RouteSetup_getServer(Hapi::RouteSetup rs, Expr res) { res = rs.getServer() } diff --git a/javascript/ql/test/library-tests/frameworks/hapi/ServerDefinition.expected b/javascript/ql/test/library-tests/frameworks/hapi/ServerDefinition.expected deleted file mode 100644 index 104ffdc754cb..000000000000 --- a/javascript/ql/test/library-tests/frameworks/hapi/ServerDefinition.expected +++ /dev/null @@ -1,2 +0,0 @@ -| src/hapi.js:1:15:1:44 | new (re ... erver() | -| src/hapi.js:4:15:4:31 | new Hapi.Server() | diff --git a/javascript/ql/test/library-tests/frameworks/hapi/ServerDefinition.ql b/javascript/ql/test/library-tests/frameworks/hapi/ServerDefinition.ql deleted file mode 100644 index d820b8d50241..000000000000 --- a/javascript/ql/test/library-tests/frameworks/hapi/ServerDefinition.ql +++ /dev/null @@ -1,4 +0,0 @@ -import javascript - -from Hapi::ServerDefinition s -select s diff --git a/javascript/ql/test/library-tests/frameworks/hapi/ServerDefinition.qll b/javascript/ql/test/library-tests/frameworks/hapi/ServerDefinition.qll new file mode 100644 index 000000000000..ef74d8838310 --- /dev/null +++ b/javascript/ql/test/library-tests/frameworks/hapi/ServerDefinition.qll @@ -0,0 +1,3 @@ +import javascript + +query predicate test_ServerDefinition(Hapi::ServerDefinition s) { any() } diff --git a/javascript/ql/test/library-tests/frameworks/hapi/tests.expected b/javascript/ql/test/library-tests/frameworks/hapi/tests.expected new file mode 100644 index 000000000000..067ea3dfda8f --- /dev/null +++ b/javascript/ql/test/library-tests/frameworks/hapi/tests.expected @@ -0,0 +1,63 @@ +test_RouteSetup +| src/hapi.js:7:1:9:2 | server2 ... ler1\\n}) | +| src/hapi.js:12:1:15:7 | server2 ... }}) | +| src/hapi.js:17:1:18:2 | server2 ... dler\\n}) | +| src/hapi.js:29:1:29:20 | server2.route(route) | +| src/hapi.js:36:1:36:38 | server2 ... ler()}) | +test_RequestInputAccess +| src/hapi.js:21:3:21:20 | request.rawPayload | body | src/hapi.js:20:1:27:1 | functio ... oken;\\n} | +| src/hapi.js:22:3:22:21 | request.payload.foo | body | src/hapi.js:20:1:27:1 | functio ... oken;\\n} | +| src/hapi.js:23:3:23:19 | request.query.bar | parameter | src/hapi.js:20:1:27:1 | functio ... oken;\\n} | +| src/hapi.js:24:3:24:18 | request.url.path | url | src/hapi.js:20:1:27:1 | functio ... oken;\\n} | +| src/hapi.js:25:3:25:21 | request.headers.baz | header | src/hapi.js:20:1:27:1 | functio ... oken;\\n} | +| src/hapi.js:26:3:26:21 | request.state.token | cookie | src/hapi.js:20:1:27:1 | functio ... oken;\\n} | +test_RouteHandler_getAResponseHeader +| src/hapi.js:13:14:15:5 | functio ... n\\n } | header1 | src/hapi.js:14:9:14:46 | request ... 1', '') | +test_HeaderDefinition_defines +| src/hapi.js:14:9:14:46 | request ... 1', '') | header1 | | +test_ResponseExpr +| src/hapi.js:14:9:14:24 | request.response | src/hapi.js:13:14:15:5 | functio ... n\\n } | +test_HeaderDefinition +| src/hapi.js:14:9:14:46 | request ... 1', '') | src/hapi.js:13:14:15:5 | functio ... n\\n } | +test_RouteSetup_getServer +| src/hapi.js:7:1:9:2 | server2 ... ler1\\n}) | src/hapi.js:4:15:4:31 | new Hapi.Server() | +| src/hapi.js:12:1:15:7 | server2 ... }}) | src/hapi.js:4:15:4:31 | new Hapi.Server() | +| src/hapi.js:17:1:18:2 | server2 ... dler\\n}) | src/hapi.js:4:15:4:31 | new Hapi.Server() | +| src/hapi.js:29:1:29:20 | server2.route(route) | src/hapi.js:4:15:4:31 | new Hapi.Server() | +| src/hapi.js:36:1:36:38 | server2 ... ler()}) | src/hapi.js:4:15:4:31 | new Hapi.Server() | +test_HeaderDefinition_getAHeaderName +| src/hapi.js:14:9:14:46 | request ... 1', '') | header1 | +test_ServerDefinition +| src/hapi.js:1:15:1:44 | new (re ... erver() | +| src/hapi.js:4:15:4:31 | new Hapi.Server() | +test_HeaderAccess +| src/hapi.js:25:3:25:21 | request.headers.baz | baz | +test_RouteSetup_getARouteHandler +| src/hapi.js:7:1:9:2 | server2 ... ler1\\n}) | src/hapi.js:6:1:6:21 | functio ... er1(){} | +| src/hapi.js:12:1:15:7 | server2 ... }}) | src/hapi.js:13:14:15:5 | functio ... n\\n } | +| src/hapi.js:17:1:18:2 | server2 ... dler\\n}) | src/hapi.js:17:30:18:1 | functio ... ndler\\n} | +| src/hapi.js:29:1:29:20 | server2.route(route) | src/hapi.js:20:1:27:1 | functio ... oken;\\n} | +| src/hapi.js:36:1:36:38 | server2 ... ler()}) | src/hapi.js:34:12:34:30 | function (req, h){} | +| src/hapi.js:36:1:36:38 | server2 ... ler()}) | src/hapi.js:36:25:36:36 | getHandler() | +test_RouteHandler +| src/hapi.js:6:1:6:21 | functio ... er1(){} | src/hapi.js:4:15:4:31 | new Hapi.Server() | +| src/hapi.js:13:14:15:5 | functio ... n\\n } | src/hapi.js:4:15:4:31 | new Hapi.Server() | +| src/hapi.js:17:30:18:1 | functio ... ndler\\n} | src/hapi.js:4:15:4:31 | new Hapi.Server() | +| src/hapi.js:20:1:27:1 | functio ... oken;\\n} | src/hapi.js:4:15:4:31 | new Hapi.Server() | +| src/hapi.js:34:12:34:30 | function (req, h){} | src/hapi.js:4:15:4:31 | new Hapi.Server() | +test_RequestExpr +| src/hapi.js:14:9:14:15 | request | src/hapi.js:13:14:15:5 | functio ... n\\n } | +| src/hapi.js:21:3:21:9 | request | src/hapi.js:20:1:27:1 | functio ... oken;\\n} | +| src/hapi.js:22:3:22:9 | request | src/hapi.js:20:1:27:1 | functio ... oken;\\n} | +| src/hapi.js:23:3:23:9 | request | src/hapi.js:20:1:27:1 | functio ... oken;\\n} | +| src/hapi.js:24:3:24:9 | request | src/hapi.js:20:1:27:1 | functio ... oken;\\n} | +| src/hapi.js:25:3:25:9 | request | src/hapi.js:20:1:27:1 | functio ... oken;\\n} | +| src/hapi.js:26:3:26:9 | request | src/hapi.js:20:1:27:1 | functio ... oken;\\n} | +test_RouteHandler_getARequestExpr +| src/hapi.js:13:14:15:5 | functio ... n\\n } | src/hapi.js:14:9:14:15 | request | +| src/hapi.js:20:1:27:1 | functio ... oken;\\n} | src/hapi.js:21:3:21:9 | request | +| src/hapi.js:20:1:27:1 | functio ... oken;\\n} | src/hapi.js:22:3:22:9 | request | +| src/hapi.js:20:1:27:1 | functio ... oken;\\n} | src/hapi.js:23:3:23:9 | request | +| src/hapi.js:20:1:27:1 | functio ... oken;\\n} | src/hapi.js:24:3:24:9 | request | +| src/hapi.js:20:1:27:1 | functio ... oken;\\n} | src/hapi.js:25:3:25:9 | request | +| src/hapi.js:20:1:27:1 | functio ... oken;\\n} | src/hapi.js:26:3:26:9 | request | diff --git a/javascript/ql/test/library-tests/frameworks/hapi/tests.ql b/javascript/ql/test/library-tests/frameworks/hapi/tests.ql new file mode 100644 index 000000000000..396381b2b239 --- /dev/null +++ b/javascript/ql/test/library-tests/frameworks/hapi/tests.ql @@ -0,0 +1,14 @@ +import RouteSetup +import RequestInputAccess +import RouteHandler_getAResponseHeader +import HeaderDefinition_defines +import ResponseExpr +import HeaderDefinition +import RouteSetup_getServer +import HeaderDefinition_getAHeaderName +import ServerDefinition +import HeaderAccess +import RouteSetup_getARouteHandler +import RouteHandler +import RequestExpr +import RouteHandler_getARequestExpr diff --git a/javascript/ql/test/library-tests/frameworks/koa/AppDefinition.expected b/javascript/ql/test/library-tests/frameworks/koa/AppDefinition.expected deleted file mode 100644 index 182ab6562653..000000000000 --- a/javascript/ql/test/library-tests/frameworks/koa/AppDefinition.expected +++ /dev/null @@ -1,2 +0,0 @@ -| src/koa.js:2:12:2:33 | new (re ... oa'))() | -| src/koa.js:5:12:5:20 | new Koa() | diff --git a/javascript/ql/test/library-tests/frameworks/koa/AppDefinition.ql b/javascript/ql/test/library-tests/frameworks/koa/AppDefinition.ql deleted file mode 100644 index 04e51da6c2ec..000000000000 --- a/javascript/ql/test/library-tests/frameworks/koa/AppDefinition.ql +++ /dev/null @@ -1,4 +0,0 @@ -import javascript - -from Koa::AppDefinition app -select app diff --git a/javascript/ql/test/library-tests/frameworks/koa/AppDefinition.qll b/javascript/ql/test/library-tests/frameworks/koa/AppDefinition.qll new file mode 100644 index 000000000000..3643b8bbf824 --- /dev/null +++ b/javascript/ql/test/library-tests/frameworks/koa/AppDefinition.qll @@ -0,0 +1,3 @@ +import javascript + +query predicate test_AppDefinition(Koa::AppDefinition app) { any() } diff --git a/javascript/ql/test/library-tests/frameworks/koa/ContextExpr.expected b/javascript/ql/test/library-tests/frameworks/koa/ContextExpr.expected deleted file mode 100644 index 115e106223d7..000000000000 --- a/javascript/ql/test/library-tests/frameworks/koa/ContextExpr.expected +++ /dev/null @@ -1,15 +0,0 @@ -| src/koa.js:11:3:11:6 | this | src/koa.js:10:10:28:1 | functio ... az');\\n} | -| src/koa.js:12:3:12:6 | this | src/koa.js:10:10:28:1 | functio ... az');\\n} | -| src/koa.js:13:3:13:5 | ctx | src/koa.js:10:10:28:1 | functio ... az');\\n} | -| src/koa.js:14:3:14:5 | ctx | src/koa.js:10:10:28:1 | functio ... az');\\n} | -| src/koa.js:15:13:15:15 | ctx | src/koa.js:10:10:28:1 | functio ... az');\\n} | -| src/koa.js:18:3:18:5 | ctx | src/koa.js:10:10:28:1 | functio ... az');\\n} | -| src/koa.js:19:3:19:5 | ctx | src/koa.js:10:10:28:1 | functio ... az');\\n} | -| src/koa.js:20:3:20:5 | ctx | src/koa.js:10:10:28:1 | functio ... az');\\n} | -| src/koa.js:21:3:21:5 | ctx | src/koa.js:10:10:28:1 | functio ... az');\\n} | -| src/koa.js:22:3:22:5 | ctx | src/koa.js:10:10:28:1 | functio ... az');\\n} | -| src/koa.js:23:3:23:5 | ctx | src/koa.js:10:10:28:1 | functio ... az');\\n} | -| src/koa.js:24:3:24:5 | ctx | src/koa.js:10:10:28:1 | functio ... az');\\n} | -| src/koa.js:25:3:25:5 | ctx | src/koa.js:10:10:28:1 | functio ... az');\\n} | -| src/koa.js:26:3:26:5 | ctx | src/koa.js:10:10:28:1 | functio ... az');\\n} | -| src/koa.js:27:3:27:5 | ctx | src/koa.js:10:10:28:1 | functio ... az');\\n} | diff --git a/javascript/ql/test/library-tests/frameworks/koa/ContextExpr.ql b/javascript/ql/test/library-tests/frameworks/koa/ContextExpr.ql deleted file mode 100644 index 68de2f3ba2ad..000000000000 --- a/javascript/ql/test/library-tests/frameworks/koa/ContextExpr.ql +++ /dev/null @@ -1,4 +0,0 @@ -import javascript - -from Koa::ContextExpr e -select e, e.getRouteHandler() diff --git a/javascript/ql/test/library-tests/frameworks/koa/ContextExpr.qll b/javascript/ql/test/library-tests/frameworks/koa/ContextExpr.qll new file mode 100644 index 000000000000..d33c4e12229c --- /dev/null +++ b/javascript/ql/test/library-tests/frameworks/koa/ContextExpr.qll @@ -0,0 +1,5 @@ +import javascript + +query predicate test_ContextExpr(Koa::ContextExpr e, Koa::RouteHandler res) { + res = e.getRouteHandler() +} diff --git a/javascript/ql/test/library-tests/frameworks/koa/HeaderAccess.expected b/javascript/ql/test/library-tests/frameworks/koa/HeaderAccess.expected deleted file mode 100644 index d3000d5c9bef..000000000000 --- a/javascript/ql/test/library-tests/frameworks/koa/HeaderAccess.expected +++ /dev/null @@ -1,3 +0,0 @@ -| src/koa.js:24:3:24:24 | ctx.req ... der.bar | bar | -| src/koa.js:25:3:25:25 | ctx.req ... ers.bar | bar | -| src/koa.js:26:3:26:24 | ctx.req ... ('bar') | bar | diff --git a/javascript/ql/test/library-tests/frameworks/koa/HeaderAccess.ql b/javascript/ql/test/library-tests/frameworks/koa/HeaderAccess.ql deleted file mode 100644 index a86349b65cbf..000000000000 --- a/javascript/ql/test/library-tests/frameworks/koa/HeaderAccess.ql +++ /dev/null @@ -1,4 +0,0 @@ -import javascript - -from HTTP::RequestHeaderAccess access -select access, access.getAHeaderName() diff --git a/javascript/ql/test/library-tests/frameworks/koa/HeaderAccess.qll b/javascript/ql/test/library-tests/frameworks/koa/HeaderAccess.qll new file mode 100644 index 000000000000..22d1d6aee539 --- /dev/null +++ b/javascript/ql/test/library-tests/frameworks/koa/HeaderAccess.qll @@ -0,0 +1,5 @@ +import javascript + +query predicate test_HeaderAccess(HTTP::RequestHeaderAccess access, string res) { + res = access.getAHeaderName() +} diff --git a/javascript/ql/test/library-tests/frameworks/koa/HeaderDefinition.expected b/javascript/ql/test/library-tests/frameworks/koa/HeaderDefinition.expected deleted file mode 100644 index 64973f7b81ae..000000000000 --- a/javascript/ql/test/library-tests/frameworks/koa/HeaderDefinition.expected +++ /dev/null @@ -1,5 +0,0 @@ -| src/koa.js:11:3:11:25 | this.se ... 1', '') | src/koa.js:10:10:28:1 | functio ... az');\\n} | -| src/koa.js:12:3:12:37 | this.re ... 2', '') | src/koa.js:10:10:28:1 | functio ... az');\\n} | -| src/koa.js:13:3:13:24 | ctx.set ... 3', '') | src/koa.js:10:10:28:1 | functio ... az');\\n} | -| src/koa.js:14:3:14:36 | ctx.res ... 4', '') | src/koa.js:10:10:28:1 | functio ... az');\\n} | -| src/koa.js:16:3:16:27 | rsp.hea ... 5', '') | src/koa.js:10:10:28:1 | functio ... az');\\n} | diff --git a/javascript/ql/test/library-tests/frameworks/koa/HeaderDefinition.ql b/javascript/ql/test/library-tests/frameworks/koa/HeaderDefinition.ql deleted file mode 100644 index 3fa59e87faec..000000000000 --- a/javascript/ql/test/library-tests/frameworks/koa/HeaderDefinition.ql +++ /dev/null @@ -1,5 +0,0 @@ -import javascript - -from HTTP::HeaderDefinition hd, Koa::RouteHandler rh -where rh = hd.getRouteHandler() -select hd, rh diff --git a/javascript/ql/test/library-tests/frameworks/koa/HeaderDefinition.qll b/javascript/ql/test/library-tests/frameworks/koa/HeaderDefinition.qll new file mode 100644 index 000000000000..972b3999b41e --- /dev/null +++ b/javascript/ql/test/library-tests/frameworks/koa/HeaderDefinition.qll @@ -0,0 +1,5 @@ +import javascript + +query predicate test_HeaderDefinition(HTTP::HeaderDefinition hd, Koa::RouteHandler rh) { + rh = hd.getRouteHandler() +} diff --git a/javascript/ql/test/library-tests/frameworks/koa/HeaderDefinition_defines.expected b/javascript/ql/test/library-tests/frameworks/koa/HeaderDefinition_defines.expected deleted file mode 100644 index 52948f52ca19..000000000000 --- a/javascript/ql/test/library-tests/frameworks/koa/HeaderDefinition_defines.expected +++ /dev/null @@ -1,5 +0,0 @@ -| src/koa.js:11:3:11:25 | this.se ... 1', '') | header1 | | -| src/koa.js:12:3:12:37 | this.re ... 2', '') | header2 | | -| src/koa.js:13:3:13:24 | ctx.set ... 3', '') | header3 | | -| src/koa.js:14:3:14:36 | ctx.res ... 4', '') | header4 | | -| src/koa.js:16:3:16:27 | rsp.hea ... 5', '') | header5 | | diff --git a/javascript/ql/test/library-tests/frameworks/koa/HeaderDefinition_defines.ql b/javascript/ql/test/library-tests/frameworks/koa/HeaderDefinition_defines.ql deleted file mode 100644 index 40084e1d03db..000000000000 --- a/javascript/ql/test/library-tests/frameworks/koa/HeaderDefinition_defines.ql +++ /dev/null @@ -1,7 +0,0 @@ -import javascript - -from HTTP::HeaderDefinition hd, string name, string value -where - hd.defines(name, value) and - hd.getRouteHandler() instanceof Koa::RouteHandler -select hd, name, value diff --git a/javascript/ql/test/library-tests/frameworks/koa/HeaderDefinition_defines.qll b/javascript/ql/test/library-tests/frameworks/koa/HeaderDefinition_defines.qll new file mode 100644 index 000000000000..1fd1f5550b80 --- /dev/null +++ b/javascript/ql/test/library-tests/frameworks/koa/HeaderDefinition_defines.qll @@ -0,0 +1,5 @@ +import javascript + +query predicate test_HeaderDefinition_defines(HTTP::HeaderDefinition hd, string name, string value) { + hd.defines(name, value) and hd.getRouteHandler() instanceof Koa::RouteHandler +} diff --git a/javascript/ql/test/library-tests/frameworks/koa/HeaderDefinition_getAHeaderName.expected b/javascript/ql/test/library-tests/frameworks/koa/HeaderDefinition_getAHeaderName.expected deleted file mode 100644 index e2de3eee689f..000000000000 --- a/javascript/ql/test/library-tests/frameworks/koa/HeaderDefinition_getAHeaderName.expected +++ /dev/null @@ -1,5 +0,0 @@ -| src/koa.js:11:3:11:25 | this.se ... 1', '') | header1 | -| src/koa.js:12:3:12:37 | this.re ... 2', '') | header2 | -| src/koa.js:13:3:13:24 | ctx.set ... 3', '') | header3 | -| src/koa.js:14:3:14:36 | ctx.res ... 4', '') | header4 | -| src/koa.js:16:3:16:27 | rsp.hea ... 5', '') | header5 | diff --git a/javascript/ql/test/library-tests/frameworks/koa/HeaderDefinition_getAHeaderName.ql b/javascript/ql/test/library-tests/frameworks/koa/HeaderDefinition_getAHeaderName.ql deleted file mode 100644 index 47fd0da9d55c..000000000000 --- a/javascript/ql/test/library-tests/frameworks/koa/HeaderDefinition_getAHeaderName.ql +++ /dev/null @@ -1,5 +0,0 @@ -import javascript - -from HTTP::HeaderDefinition hd -where hd.getRouteHandler() instanceof Koa::RouteHandler -select hd, hd.getAHeaderName() diff --git a/javascript/ql/test/library-tests/frameworks/koa/HeaderDefinition_getAHeaderName.qll b/javascript/ql/test/library-tests/frameworks/koa/HeaderDefinition_getAHeaderName.qll new file mode 100644 index 000000000000..faec0fac04d6 --- /dev/null +++ b/javascript/ql/test/library-tests/frameworks/koa/HeaderDefinition_getAHeaderName.qll @@ -0,0 +1,5 @@ +import javascript + +query predicate test_HeaderDefinition_getAHeaderName(HTTP::HeaderDefinition hd, string res) { + hd.getRouteHandler() instanceof Koa::RouteHandler and res = hd.getAHeaderName() +} diff --git a/javascript/ql/test/library-tests/frameworks/koa/RequestExpr.expected b/javascript/ql/test/library-tests/frameworks/koa/RequestExpr.expected deleted file mode 100644 index 4e3c97f79a32..000000000000 --- a/javascript/ql/test/library-tests/frameworks/koa/RequestExpr.expected +++ /dev/null @@ -1,8 +0,0 @@ -| src/koa.js:19:3:19:13 | ctx.request | src/koa.js:10:10:28:1 | functio ... az');\\n} | -| src/koa.js:20:3:20:13 | ctx.request | src/koa.js:10:10:28:1 | functio ... az');\\n} | -| src/koa.js:21:3:21:13 | ctx.request | src/koa.js:10:10:28:1 | functio ... az');\\n} | -| src/koa.js:22:3:22:13 | ctx.request | src/koa.js:10:10:28:1 | functio ... az');\\n} | -| src/koa.js:23:3:23:13 | ctx.request | src/koa.js:10:10:28:1 | functio ... az');\\n} | -| src/koa.js:24:3:24:13 | ctx.request | src/koa.js:10:10:28:1 | functio ... az');\\n} | -| src/koa.js:25:3:25:13 | ctx.request | src/koa.js:10:10:28:1 | functio ... az');\\n} | -| src/koa.js:26:3:26:13 | ctx.request | src/koa.js:10:10:28:1 | functio ... az');\\n} | diff --git a/javascript/ql/test/library-tests/frameworks/koa/RequestExpr.ql b/javascript/ql/test/library-tests/frameworks/koa/RequestExpr.ql deleted file mode 100644 index 99e92b42829b..000000000000 --- a/javascript/ql/test/library-tests/frameworks/koa/RequestExpr.ql +++ /dev/null @@ -1,4 +0,0 @@ -import javascript - -from Koa::RequestExpr e -select e, e.getRouteHandler() diff --git a/javascript/ql/test/library-tests/frameworks/koa/RequestExpr.qll b/javascript/ql/test/library-tests/frameworks/koa/RequestExpr.qll new file mode 100644 index 000000000000..cb80c0da255a --- /dev/null +++ b/javascript/ql/test/library-tests/frameworks/koa/RequestExpr.qll @@ -0,0 +1,5 @@ +import javascript + +query predicate test_RequestExpr(Koa::RequestExpr e, HTTP::RouteHandler res) { + res = e.getRouteHandler() +} diff --git a/javascript/ql/test/library-tests/frameworks/koa/RequestInputAccess.expected b/javascript/ql/test/library-tests/frameworks/koa/RequestInputAccess.expected deleted file mode 100644 index c9f57c032122..000000000000 --- a/javascript/ql/test/library-tests/frameworks/koa/RequestInputAccess.expected +++ /dev/null @@ -1,9 +0,0 @@ -| src/koa.js:19:3:19:18 | ctx.request.body | body | src/koa.js:10:10:28:1 | functio ... az');\\n} | -| src/koa.js:20:3:20:23 | ctx.req ... ery.foo | parameter | src/koa.js:10:10:28:1 | functio ... az');\\n} | -| src/koa.js:21:3:21:17 | ctx.request.url | url | src/koa.js:10:10:28:1 | functio ... az');\\n} | -| src/koa.js:22:3:22:25 | ctx.req ... inalUrl | url | src/koa.js:10:10:28:1 | functio ... az');\\n} | -| src/koa.js:23:3:23:18 | ctx.request.href | url | src/koa.js:10:10:28:1 | functio ... az');\\n} | -| src/koa.js:24:3:24:24 | ctx.req ... der.bar | header | src/koa.js:10:10:28:1 | functio ... az');\\n} | -| src/koa.js:25:3:25:25 | ctx.req ... ers.bar | header | src/koa.js:10:10:28:1 | functio ... az');\\n} | -| src/koa.js:26:3:26:24 | ctx.req ... ('bar') | header | src/koa.js:10:10:28:1 | functio ... az');\\n} | -| src/koa.js:27:3:27:24 | ctx.coo ... ('baz') | cookie | src/koa.js:10:10:28:1 | functio ... az');\\n} | diff --git a/javascript/ql/test/library-tests/frameworks/koa/RequestInputAccess.ql b/javascript/ql/test/library-tests/frameworks/koa/RequestInputAccess.ql deleted file mode 100644 index c08310c4d89a..000000000000 --- a/javascript/ql/test/library-tests/frameworks/koa/RequestInputAccess.ql +++ /dev/null @@ -1,5 +0,0 @@ -import javascript - -from HTTP::RequestInputAccess ria, Koa::RouteHandler rh -where ria.getRouteHandler() = rh -select ria, ria.getKind(), rh diff --git a/javascript/ql/test/library-tests/frameworks/koa/RequestInputAccess.qll b/javascript/ql/test/library-tests/frameworks/koa/RequestInputAccess.qll new file mode 100644 index 000000000000..2e4e226fd3e7 --- /dev/null +++ b/javascript/ql/test/library-tests/frameworks/koa/RequestInputAccess.qll @@ -0,0 +1,7 @@ +import javascript + +query predicate test_RequestInputAccess( + HTTP::RequestInputAccess ria, string res, Koa::RouteHandler rh +) { + ria.getRouteHandler() = rh and res = ria.getKind() +} diff --git a/javascript/ql/test/library-tests/frameworks/koa/ResponseExpr.expected b/javascript/ql/test/library-tests/frameworks/koa/ResponseExpr.expected deleted file mode 100644 index cfc7f5c64376..000000000000 --- a/javascript/ql/test/library-tests/frameworks/koa/ResponseExpr.expected +++ /dev/null @@ -1,5 +0,0 @@ -| src/koa.js:12:3:12:15 | this.response | src/koa.js:10:10:28:1 | functio ... az');\\n} | -| src/koa.js:14:3:14:14 | ctx.response | src/koa.js:10:10:28:1 | functio ... az');\\n} | -| src/koa.js:15:13:15:24 | ctx.response | src/koa.js:10:10:28:1 | functio ... az');\\n} | -| src/koa.js:16:3:16:5 | rsp | src/koa.js:10:10:28:1 | functio ... az');\\n} | -| src/koa.js:18:3:18:14 | ctx.response | src/koa.js:10:10:28:1 | functio ... az');\\n} | diff --git a/javascript/ql/test/library-tests/frameworks/koa/ResponseExpr.ql b/javascript/ql/test/library-tests/frameworks/koa/ResponseExpr.ql deleted file mode 100644 index 297ea6b90f99..000000000000 --- a/javascript/ql/test/library-tests/frameworks/koa/ResponseExpr.ql +++ /dev/null @@ -1,4 +0,0 @@ -import javascript - -from Koa::ResponseExpr e -select e, e.getRouteHandler() diff --git a/javascript/ql/test/library-tests/frameworks/koa/ResponseExpr.qll b/javascript/ql/test/library-tests/frameworks/koa/ResponseExpr.qll new file mode 100644 index 000000000000..dc846988cc23 --- /dev/null +++ b/javascript/ql/test/library-tests/frameworks/koa/ResponseExpr.qll @@ -0,0 +1,5 @@ +import javascript + +query predicate test_ResponseExpr(Koa::ResponseExpr e, HTTP::RouteHandler res) { + res = e.getRouteHandler() +} diff --git a/javascript/ql/test/library-tests/frameworks/koa/ResponseSendArgument.expected b/javascript/ql/test/library-tests/frameworks/koa/ResponseSendArgument.expected deleted file mode 100644 index b5646631eab5..000000000000 --- a/javascript/ql/test/library-tests/frameworks/koa/ResponseSendArgument.expected +++ /dev/null @@ -1 +0,0 @@ -| src/koa.js:18:23:18:23 | x | src/koa.js:10:10:28:1 | functio ... az');\\n} | diff --git a/javascript/ql/test/library-tests/frameworks/koa/ResponseSendArgument.ql b/javascript/ql/test/library-tests/frameworks/koa/ResponseSendArgument.ql deleted file mode 100644 index f7a32726d58a..000000000000 --- a/javascript/ql/test/library-tests/frameworks/koa/ResponseSendArgument.ql +++ /dev/null @@ -1,5 +0,0 @@ -import javascript - -from HTTP::ResponseSendArgument send, Koa::RouteHandler rh -where rh = send.getRouteHandler() -select send, rh diff --git a/javascript/ql/test/library-tests/frameworks/koa/ResponseSendArgument.qll b/javascript/ql/test/library-tests/frameworks/koa/ResponseSendArgument.qll new file mode 100644 index 000000000000..f0c3e9d2ea28 --- /dev/null +++ b/javascript/ql/test/library-tests/frameworks/koa/ResponseSendArgument.qll @@ -0,0 +1,5 @@ +import javascript + +query predicate test_ResponseSendArgument(HTTP::ResponseSendArgument send, Koa::RouteHandler rh) { + rh = send.getRouteHandler() +} diff --git a/javascript/ql/test/library-tests/frameworks/koa/RouteHandler.expected b/javascript/ql/test/library-tests/frameworks/koa/RouteHandler.expected deleted file mode 100644 index 3a3eba84fbc7..000000000000 --- a/javascript/ql/test/library-tests/frameworks/koa/RouteHandler.expected +++ /dev/null @@ -1,2 +0,0 @@ -| src/koa.js:7:1:7:22 | functio ... r1() {} | src/koa.js:5:12:5:20 | new Koa() | -| src/koa.js:10:10:28:1 | functio ... az');\\n} | src/koa.js:5:12:5:20 | new Koa() | diff --git a/javascript/ql/test/library-tests/frameworks/koa/RouteHandler.ql b/javascript/ql/test/library-tests/frameworks/koa/RouteHandler.ql deleted file mode 100644 index 5c5b63b3d1a8..000000000000 --- a/javascript/ql/test/library-tests/frameworks/koa/RouteHandler.ql +++ /dev/null @@ -1,4 +0,0 @@ -import javascript - -from Koa::RouteHandler rh -select rh, rh.getServer() diff --git a/javascript/ql/test/library-tests/frameworks/koa/RouteHandler.qll b/javascript/ql/test/library-tests/frameworks/koa/RouteHandler.qll new file mode 100644 index 000000000000..032d5a293660 --- /dev/null +++ b/javascript/ql/test/library-tests/frameworks/koa/RouteHandler.qll @@ -0,0 +1,3 @@ +import javascript + +query predicate test_RouteHandler(Koa::RouteHandler rh, Expr res) { res = rh.getServer() } diff --git a/javascript/ql/test/library-tests/frameworks/koa/RouteHandler_getAContextExpr.expected b/javascript/ql/test/library-tests/frameworks/koa/RouteHandler_getAContextExpr.expected deleted file mode 100644 index 75baf7ada919..000000000000 --- a/javascript/ql/test/library-tests/frameworks/koa/RouteHandler_getAContextExpr.expected +++ /dev/null @@ -1,15 +0,0 @@ -| src/koa.js:10:10:28:1 | functio ... az');\\n} | src/koa.js:11:3:11:6 | this | -| src/koa.js:10:10:28:1 | functio ... az');\\n} | src/koa.js:12:3:12:6 | this | -| src/koa.js:10:10:28:1 | functio ... az');\\n} | src/koa.js:13:3:13:5 | ctx | -| src/koa.js:10:10:28:1 | functio ... az');\\n} | src/koa.js:14:3:14:5 | ctx | -| src/koa.js:10:10:28:1 | functio ... az');\\n} | src/koa.js:15:13:15:15 | ctx | -| src/koa.js:10:10:28:1 | functio ... az');\\n} | src/koa.js:18:3:18:5 | ctx | -| src/koa.js:10:10:28:1 | functio ... az');\\n} | src/koa.js:19:3:19:5 | ctx | -| src/koa.js:10:10:28:1 | functio ... az');\\n} | src/koa.js:20:3:20:5 | ctx | -| src/koa.js:10:10:28:1 | functio ... az');\\n} | src/koa.js:21:3:21:5 | ctx | -| src/koa.js:10:10:28:1 | functio ... az');\\n} | src/koa.js:22:3:22:5 | ctx | -| src/koa.js:10:10:28:1 | functio ... az');\\n} | src/koa.js:23:3:23:5 | ctx | -| src/koa.js:10:10:28:1 | functio ... az');\\n} | src/koa.js:24:3:24:5 | ctx | -| src/koa.js:10:10:28:1 | functio ... az');\\n} | src/koa.js:25:3:25:5 | ctx | -| src/koa.js:10:10:28:1 | functio ... az');\\n} | src/koa.js:26:3:26:5 | ctx | -| src/koa.js:10:10:28:1 | functio ... az');\\n} | src/koa.js:27:3:27:5 | ctx | diff --git a/javascript/ql/test/library-tests/frameworks/koa/RouteHandler_getAContextExpr.ql b/javascript/ql/test/library-tests/frameworks/koa/RouteHandler_getAContextExpr.ql deleted file mode 100644 index ed06a12eb090..000000000000 --- a/javascript/ql/test/library-tests/frameworks/koa/RouteHandler_getAContextExpr.ql +++ /dev/null @@ -1,4 +0,0 @@ -import semmle.javascript.frameworks.Express - -from Koa::RouteHandler rh -select rh, rh.getAContextExpr() diff --git a/javascript/ql/test/library-tests/frameworks/koa/RouteHandler_getAContextExpr.qll b/javascript/ql/test/library-tests/frameworks/koa/RouteHandler_getAContextExpr.qll new file mode 100644 index 000000000000..cbbe41ebb857 --- /dev/null +++ b/javascript/ql/test/library-tests/frameworks/koa/RouteHandler_getAContextExpr.qll @@ -0,0 +1,5 @@ +import semmle.javascript.frameworks.Express + +query predicate test_RouteHandler_getAContextExpr(Koa::RouteHandler rh, Expr res) { + res = rh.getAContextExpr() +} diff --git a/javascript/ql/test/library-tests/frameworks/koa/RouteHandler_getARequestExpr.expected b/javascript/ql/test/library-tests/frameworks/koa/RouteHandler_getARequestExpr.expected deleted file mode 100644 index 147536895023..000000000000 --- a/javascript/ql/test/library-tests/frameworks/koa/RouteHandler_getARequestExpr.expected +++ /dev/null @@ -1,8 +0,0 @@ -| src/koa.js:10:10:28:1 | functio ... az');\\n} | src/koa.js:19:3:19:13 | ctx.request | -| src/koa.js:10:10:28:1 | functio ... az');\\n} | src/koa.js:20:3:20:13 | ctx.request | -| src/koa.js:10:10:28:1 | functio ... az');\\n} | src/koa.js:21:3:21:13 | ctx.request | -| src/koa.js:10:10:28:1 | functio ... az');\\n} | src/koa.js:22:3:22:13 | ctx.request | -| src/koa.js:10:10:28:1 | functio ... az');\\n} | src/koa.js:23:3:23:13 | ctx.request | -| src/koa.js:10:10:28:1 | functio ... az');\\n} | src/koa.js:24:3:24:13 | ctx.request | -| src/koa.js:10:10:28:1 | functio ... az');\\n} | src/koa.js:25:3:25:13 | ctx.request | -| src/koa.js:10:10:28:1 | functio ... az');\\n} | src/koa.js:26:3:26:13 | ctx.request | diff --git a/javascript/ql/test/library-tests/frameworks/koa/RouteHandler_getARequestExpr.ql b/javascript/ql/test/library-tests/frameworks/koa/RouteHandler_getARequestExpr.ql deleted file mode 100644 index 52c39f310046..000000000000 --- a/javascript/ql/test/library-tests/frameworks/koa/RouteHandler_getARequestExpr.ql +++ /dev/null @@ -1,4 +0,0 @@ -import semmle.javascript.frameworks.Express - -from Koa::RouteHandler rh -select rh, rh.getARequestExpr() diff --git a/javascript/ql/test/library-tests/frameworks/koa/RouteHandler_getARequestExpr.qll b/javascript/ql/test/library-tests/frameworks/koa/RouteHandler_getARequestExpr.qll new file mode 100644 index 000000000000..ca15b9b465b5 --- /dev/null +++ b/javascript/ql/test/library-tests/frameworks/koa/RouteHandler_getARequestExpr.qll @@ -0,0 +1,5 @@ +import semmle.javascript.frameworks.Express + +query predicate test_RouteHandler_getARequestExpr(Koa::RouteHandler rh, HTTP::RequestExpr res) { + res = rh.getARequestExpr() +} diff --git a/javascript/ql/test/library-tests/frameworks/koa/RouteHandler_getAResponseExpr.expected b/javascript/ql/test/library-tests/frameworks/koa/RouteHandler_getAResponseExpr.expected deleted file mode 100644 index 148be036d7de..000000000000 --- a/javascript/ql/test/library-tests/frameworks/koa/RouteHandler_getAResponseExpr.expected +++ /dev/null @@ -1,5 +0,0 @@ -| src/koa.js:10:10:28:1 | functio ... az');\\n} | src/koa.js:12:3:12:15 | this.response | -| src/koa.js:10:10:28:1 | functio ... az');\\n} | src/koa.js:14:3:14:14 | ctx.response | -| src/koa.js:10:10:28:1 | functio ... az');\\n} | src/koa.js:15:13:15:24 | ctx.response | -| src/koa.js:10:10:28:1 | functio ... az');\\n} | src/koa.js:16:3:16:5 | rsp | -| src/koa.js:10:10:28:1 | functio ... az');\\n} | src/koa.js:18:3:18:14 | ctx.response | diff --git a/javascript/ql/test/library-tests/frameworks/koa/RouteHandler_getAResponseExpr.ql b/javascript/ql/test/library-tests/frameworks/koa/RouteHandler_getAResponseExpr.ql deleted file mode 100644 index 780a1721c204..000000000000 --- a/javascript/ql/test/library-tests/frameworks/koa/RouteHandler_getAResponseExpr.ql +++ /dev/null @@ -1,4 +0,0 @@ -import semmle.javascript.frameworks.Express - -from Koa::RouteHandler rh -select rh, rh.getAResponseExpr() diff --git a/javascript/ql/test/library-tests/frameworks/koa/RouteHandler_getAResponseExpr.qll b/javascript/ql/test/library-tests/frameworks/koa/RouteHandler_getAResponseExpr.qll new file mode 100644 index 000000000000..6d5fa8ff7464 --- /dev/null +++ b/javascript/ql/test/library-tests/frameworks/koa/RouteHandler_getAResponseExpr.qll @@ -0,0 +1,5 @@ +import semmle.javascript.frameworks.Express + +query predicate test_RouteHandler_getAResponseExpr(Koa::RouteHandler rh, HTTP::ResponseExpr res) { + res = rh.getAResponseExpr() +} diff --git a/javascript/ql/test/library-tests/frameworks/koa/RouteHandler_getAResponseHeader.expected b/javascript/ql/test/library-tests/frameworks/koa/RouteHandler_getAResponseHeader.expected deleted file mode 100644 index a85c654046be..000000000000 --- a/javascript/ql/test/library-tests/frameworks/koa/RouteHandler_getAResponseHeader.expected +++ /dev/null @@ -1,5 +0,0 @@ -| src/koa.js:10:10:28:1 | functio ... az');\\n} | header1 | src/koa.js:11:3:11:25 | this.se ... 1', '') | -| src/koa.js:10:10:28:1 | functio ... az');\\n} | header2 | src/koa.js:12:3:12:37 | this.re ... 2', '') | -| src/koa.js:10:10:28:1 | functio ... az');\\n} | header3 | src/koa.js:13:3:13:24 | ctx.set ... 3', '') | -| src/koa.js:10:10:28:1 | functio ... az');\\n} | header4 | src/koa.js:14:3:14:36 | ctx.res ... 4', '') | -| src/koa.js:10:10:28:1 | functio ... az');\\n} | header5 | src/koa.js:16:3:16:27 | rsp.hea ... 5', '') | diff --git a/javascript/ql/test/library-tests/frameworks/koa/RouteHandler_getAResponseHeader.ql b/javascript/ql/test/library-tests/frameworks/koa/RouteHandler_getAResponseHeader.ql deleted file mode 100644 index d6a315284b61..000000000000 --- a/javascript/ql/test/library-tests/frameworks/koa/RouteHandler_getAResponseHeader.ql +++ /dev/null @@ -1,4 +0,0 @@ -import semmle.javascript.frameworks.Express - -from Koa::RouteHandler rh, string name -select rh, name, rh.getAResponseHeader(name) diff --git a/javascript/ql/test/library-tests/frameworks/koa/RouteHandler_getAResponseHeader.qll b/javascript/ql/test/library-tests/frameworks/koa/RouteHandler_getAResponseHeader.qll new file mode 100644 index 000000000000..98c613dc5c87 --- /dev/null +++ b/javascript/ql/test/library-tests/frameworks/koa/RouteHandler_getAResponseHeader.qll @@ -0,0 +1,7 @@ +import semmle.javascript.frameworks.Express + +query predicate test_RouteHandler_getAResponseHeader( + Koa::RouteHandler rh, string name, HTTP::HeaderDefinition res +) { + res = rh.getAResponseHeader(name) +} diff --git a/javascript/ql/test/library-tests/frameworks/koa/RouteSetup.expected b/javascript/ql/test/library-tests/frameworks/koa/RouteSetup.expected deleted file mode 100644 index 5328816836c8..000000000000 --- a/javascript/ql/test/library-tests/frameworks/koa/RouteSetup.expected +++ /dev/null @@ -1,2 +0,0 @@ -| src/koa.js:8:1:8:18 | app2.use(handler1) | -| src/koa.js:10:1:28:2 | app2.us ... z');\\n}) | diff --git a/javascript/ql/test/library-tests/frameworks/koa/RouteSetup.ql b/javascript/ql/test/library-tests/frameworks/koa/RouteSetup.ql deleted file mode 100644 index 011333b4125c..000000000000 --- a/javascript/ql/test/library-tests/frameworks/koa/RouteSetup.ql +++ /dev/null @@ -1,4 +0,0 @@ -import javascript - -from Koa::RouteSetup rs -select rs diff --git a/javascript/ql/test/library-tests/frameworks/koa/RouteSetup.qll b/javascript/ql/test/library-tests/frameworks/koa/RouteSetup.qll new file mode 100644 index 000000000000..de758ab593a1 --- /dev/null +++ b/javascript/ql/test/library-tests/frameworks/koa/RouteSetup.qll @@ -0,0 +1,3 @@ +import javascript + +query predicate test_RouteSetup(Koa::RouteSetup rs) { any() } diff --git a/javascript/ql/test/library-tests/frameworks/koa/RouteSetup_getARouteHandler.expected b/javascript/ql/test/library-tests/frameworks/koa/RouteSetup_getARouteHandler.expected deleted file mode 100644 index 7c2bb9b694ee..000000000000 --- a/javascript/ql/test/library-tests/frameworks/koa/RouteSetup_getARouteHandler.expected +++ /dev/null @@ -1,2 +0,0 @@ -| src/koa.js:8:1:8:18 | app2.use(handler1) | src/koa.js:7:1:7:22 | functio ... r1() {} | -| src/koa.js:10:1:28:2 | app2.us ... z');\\n}) | src/koa.js:10:10:28:1 | functio ... az');\\n} | diff --git a/javascript/ql/test/library-tests/frameworks/koa/RouteSetup_getARouteHandler.ql b/javascript/ql/test/library-tests/frameworks/koa/RouteSetup_getARouteHandler.ql deleted file mode 100644 index 54961a8a2096..000000000000 --- a/javascript/ql/test/library-tests/frameworks/koa/RouteSetup_getARouteHandler.ql +++ /dev/null @@ -1,4 +0,0 @@ -import javascript - -from Koa::RouteSetup r -select r, r.getARouteHandler() diff --git a/javascript/ql/test/library-tests/frameworks/koa/RouteSetup_getARouteHandler.qll b/javascript/ql/test/library-tests/frameworks/koa/RouteSetup_getARouteHandler.qll new file mode 100644 index 000000000000..b6a4cd94cb45 --- /dev/null +++ b/javascript/ql/test/library-tests/frameworks/koa/RouteSetup_getARouteHandler.qll @@ -0,0 +1,5 @@ +import javascript + +query predicate test_RouteSetup_getARouteHandler(Koa::RouteSetup r, DataFlow::SourceNode res) { + res = r.getARouteHandler() +} diff --git a/javascript/ql/test/library-tests/frameworks/koa/RouteSetup_getServer.expected b/javascript/ql/test/library-tests/frameworks/koa/RouteSetup_getServer.expected deleted file mode 100644 index 383abbaa389a..000000000000 --- a/javascript/ql/test/library-tests/frameworks/koa/RouteSetup_getServer.expected +++ /dev/null @@ -1,2 +0,0 @@ -| src/koa.js:8:1:8:18 | app2.use(handler1) | src/koa.js:5:12:5:20 | new Koa() | -| src/koa.js:10:1:28:2 | app2.us ... z');\\n}) | src/koa.js:5:12:5:20 | new Koa() | diff --git a/javascript/ql/test/library-tests/frameworks/koa/RouteSetup_getServer.ql b/javascript/ql/test/library-tests/frameworks/koa/RouteSetup_getServer.ql deleted file mode 100644 index 30f04b433cfb..000000000000 --- a/javascript/ql/test/library-tests/frameworks/koa/RouteSetup_getServer.ql +++ /dev/null @@ -1,4 +0,0 @@ -import javascript - -from Koa::RouteSetup rs -select rs, rs.getServer() diff --git a/javascript/ql/test/library-tests/frameworks/koa/RouteSetup_getServer.qll b/javascript/ql/test/library-tests/frameworks/koa/RouteSetup_getServer.qll new file mode 100644 index 000000000000..bb674e0d1927 --- /dev/null +++ b/javascript/ql/test/library-tests/frameworks/koa/RouteSetup_getServer.qll @@ -0,0 +1,3 @@ +import javascript + +query predicate test_RouteSetup_getServer(Koa::RouteSetup rs, Expr res) { res = rs.getServer() } diff --git a/javascript/ql/test/library-tests/frameworks/koa/tests.expected b/javascript/ql/test/library-tests/frameworks/koa/tests.expected new file mode 100644 index 000000000000..907f8fe924be --- /dev/null +++ b/javascript/ql/test/library-tests/frameworks/koa/tests.expected @@ -0,0 +1,117 @@ +test_RouteSetup +| src/koa.js:8:1:8:18 | app2.use(handler1) | +| src/koa.js:10:1:28:2 | app2.us ... z');\\n}) | +test_RequestInputAccess +| src/koa.js:19:3:19:18 | ctx.request.body | body | src/koa.js:10:10:28:1 | functio ... az');\\n} | +| src/koa.js:20:3:20:23 | ctx.req ... ery.foo | parameter | src/koa.js:10:10:28:1 | functio ... az');\\n} | +| src/koa.js:21:3:21:17 | ctx.request.url | url | src/koa.js:10:10:28:1 | functio ... az');\\n} | +| src/koa.js:22:3:22:25 | ctx.req ... inalUrl | url | src/koa.js:10:10:28:1 | functio ... az');\\n} | +| src/koa.js:23:3:23:18 | ctx.request.href | url | src/koa.js:10:10:28:1 | functio ... az');\\n} | +| src/koa.js:24:3:24:24 | ctx.req ... der.bar | header | src/koa.js:10:10:28:1 | functio ... az');\\n} | +| src/koa.js:25:3:25:25 | ctx.req ... ers.bar | header | src/koa.js:10:10:28:1 | functio ... az');\\n} | +| src/koa.js:26:3:26:24 | ctx.req ... ('bar') | header | src/koa.js:10:10:28:1 | functio ... az');\\n} | +| src/koa.js:27:3:27:24 | ctx.coo ... ('baz') | cookie | src/koa.js:10:10:28:1 | functio ... az');\\n} | +test_RouteHandler_getAResponseHeader +| src/koa.js:10:10:28:1 | functio ... az');\\n} | header1 | src/koa.js:11:3:11:25 | this.se ... 1', '') | +| src/koa.js:10:10:28:1 | functio ... az');\\n} | header2 | src/koa.js:12:3:12:37 | this.re ... 2', '') | +| src/koa.js:10:10:28:1 | functio ... az');\\n} | header3 | src/koa.js:13:3:13:24 | ctx.set ... 3', '') | +| src/koa.js:10:10:28:1 | functio ... az');\\n} | header4 | src/koa.js:14:3:14:36 | ctx.res ... 4', '') | +| src/koa.js:10:10:28:1 | functio ... az');\\n} | header5 | src/koa.js:16:3:16:27 | rsp.hea ... 5', '') | +test_HeaderDefinition_defines +| src/koa.js:11:3:11:25 | this.se ... 1', '') | header1 | | +| src/koa.js:12:3:12:37 | this.re ... 2', '') | header2 | | +| src/koa.js:13:3:13:24 | ctx.set ... 3', '') | header3 | | +| src/koa.js:14:3:14:36 | ctx.res ... 4', '') | header4 | | +| src/koa.js:16:3:16:27 | rsp.hea ... 5', '') | header5 | | +test_ResponseExpr +| src/koa.js:12:3:12:15 | this.response | src/koa.js:10:10:28:1 | functio ... az');\\n} | +| src/koa.js:14:3:14:14 | ctx.response | src/koa.js:10:10:28:1 | functio ... az');\\n} | +| src/koa.js:15:13:15:24 | ctx.response | src/koa.js:10:10:28:1 | functio ... az');\\n} | +| src/koa.js:16:3:16:5 | rsp | src/koa.js:10:10:28:1 | functio ... az');\\n} | +| src/koa.js:18:3:18:14 | ctx.response | src/koa.js:10:10:28:1 | functio ... az');\\n} | +test_RouteHandler_getAContextExpr +| src/koa.js:10:10:28:1 | functio ... az');\\n} | src/koa.js:11:3:11:6 | this | +| src/koa.js:10:10:28:1 | functio ... az');\\n} | src/koa.js:12:3:12:6 | this | +| src/koa.js:10:10:28:1 | functio ... az');\\n} | src/koa.js:13:3:13:5 | ctx | +| src/koa.js:10:10:28:1 | functio ... az');\\n} | src/koa.js:14:3:14:5 | ctx | +| src/koa.js:10:10:28:1 | functio ... az');\\n} | src/koa.js:15:13:15:15 | ctx | +| src/koa.js:10:10:28:1 | functio ... az');\\n} | src/koa.js:18:3:18:5 | ctx | +| src/koa.js:10:10:28:1 | functio ... az');\\n} | src/koa.js:19:3:19:5 | ctx | +| src/koa.js:10:10:28:1 | functio ... az');\\n} | src/koa.js:20:3:20:5 | ctx | +| src/koa.js:10:10:28:1 | functio ... az');\\n} | src/koa.js:21:3:21:5 | ctx | +| src/koa.js:10:10:28:1 | functio ... az');\\n} | src/koa.js:22:3:22:5 | ctx | +| src/koa.js:10:10:28:1 | functio ... az');\\n} | src/koa.js:23:3:23:5 | ctx | +| src/koa.js:10:10:28:1 | functio ... az');\\n} | src/koa.js:24:3:24:5 | ctx | +| src/koa.js:10:10:28:1 | functio ... az');\\n} | src/koa.js:25:3:25:5 | ctx | +| src/koa.js:10:10:28:1 | functio ... az');\\n} | src/koa.js:26:3:26:5 | ctx | +| src/koa.js:10:10:28:1 | functio ... az');\\n} | src/koa.js:27:3:27:5 | ctx | +test_HeaderDefinition +| src/koa.js:11:3:11:25 | this.se ... 1', '') | src/koa.js:10:10:28:1 | functio ... az');\\n} | +| src/koa.js:12:3:12:37 | this.re ... 2', '') | src/koa.js:10:10:28:1 | functio ... az');\\n} | +| src/koa.js:13:3:13:24 | ctx.set ... 3', '') | src/koa.js:10:10:28:1 | functio ... az');\\n} | +| src/koa.js:14:3:14:36 | ctx.res ... 4', '') | src/koa.js:10:10:28:1 | functio ... az');\\n} | +| src/koa.js:16:3:16:27 | rsp.hea ... 5', '') | src/koa.js:10:10:28:1 | functio ... az');\\n} | +test_RouteSetup_getServer +| src/koa.js:8:1:8:18 | app2.use(handler1) | src/koa.js:5:12:5:20 | new Koa() | +| src/koa.js:10:1:28:2 | app2.us ... z');\\n}) | src/koa.js:5:12:5:20 | new Koa() | +test_HeaderDefinition_getAHeaderName +| src/koa.js:11:3:11:25 | this.se ... 1', '') | header1 | +| src/koa.js:12:3:12:37 | this.re ... 2', '') | header2 | +| src/koa.js:13:3:13:24 | ctx.set ... 3', '') | header3 | +| src/koa.js:14:3:14:36 | ctx.res ... 4', '') | header4 | +| src/koa.js:16:3:16:27 | rsp.hea ... 5', '') | header5 | +test_HeaderAccess +| src/koa.js:24:3:24:24 | ctx.req ... der.bar | bar | +| src/koa.js:25:3:25:25 | ctx.req ... ers.bar | bar | +| src/koa.js:26:3:26:24 | ctx.req ... ('bar') | bar | +test_RouteHandler_getAResponseExpr +| src/koa.js:10:10:28:1 | functio ... az');\\n} | src/koa.js:12:3:12:15 | this.response | +| src/koa.js:10:10:28:1 | functio ... az');\\n} | src/koa.js:14:3:14:14 | ctx.response | +| src/koa.js:10:10:28:1 | functio ... az');\\n} | src/koa.js:15:13:15:24 | ctx.response | +| src/koa.js:10:10:28:1 | functio ... az');\\n} | src/koa.js:16:3:16:5 | rsp | +| src/koa.js:10:10:28:1 | functio ... az');\\n} | src/koa.js:18:3:18:14 | ctx.response | +test_ResponseSendArgument +| src/koa.js:18:23:18:23 | x | src/koa.js:10:10:28:1 | functio ... az');\\n} | +test_RouteSetup_getARouteHandler +| src/koa.js:8:1:8:18 | app2.use(handler1) | src/koa.js:7:1:7:22 | functio ... r1() {} | +| src/koa.js:10:1:28:2 | app2.us ... z');\\n}) | src/koa.js:10:10:28:1 | functio ... az');\\n} | +test_AppDefinition +| src/koa.js:2:12:2:33 | new (re ... oa'))() | +| src/koa.js:5:12:5:20 | new Koa() | +test_RouteHandler +| src/koa.js:7:1:7:22 | functio ... r1() {} | src/koa.js:5:12:5:20 | new Koa() | +| src/koa.js:10:10:28:1 | functio ... az');\\n} | src/koa.js:5:12:5:20 | new Koa() | +test_RequestExpr +| src/koa.js:19:3:19:13 | ctx.request | src/koa.js:10:10:28:1 | functio ... az');\\n} | +| src/koa.js:20:3:20:13 | ctx.request | src/koa.js:10:10:28:1 | functio ... az');\\n} | +| src/koa.js:21:3:21:13 | ctx.request | src/koa.js:10:10:28:1 | functio ... az');\\n} | +| src/koa.js:22:3:22:13 | ctx.request | src/koa.js:10:10:28:1 | functio ... az');\\n} | +| src/koa.js:23:3:23:13 | ctx.request | src/koa.js:10:10:28:1 | functio ... az');\\n} | +| src/koa.js:24:3:24:13 | ctx.request | src/koa.js:10:10:28:1 | functio ... az');\\n} | +| src/koa.js:25:3:25:13 | ctx.request | src/koa.js:10:10:28:1 | functio ... az');\\n} | +| src/koa.js:26:3:26:13 | ctx.request | src/koa.js:10:10:28:1 | functio ... az');\\n} | +test_RouteHandler_getARequestExpr +| src/koa.js:10:10:28:1 | functio ... az');\\n} | src/koa.js:19:3:19:13 | ctx.request | +| src/koa.js:10:10:28:1 | functio ... az');\\n} | src/koa.js:20:3:20:13 | ctx.request | +| src/koa.js:10:10:28:1 | functio ... az');\\n} | src/koa.js:21:3:21:13 | ctx.request | +| src/koa.js:10:10:28:1 | functio ... az');\\n} | src/koa.js:22:3:22:13 | ctx.request | +| src/koa.js:10:10:28:1 | functio ... az');\\n} | src/koa.js:23:3:23:13 | ctx.request | +| src/koa.js:10:10:28:1 | functio ... az');\\n} | src/koa.js:24:3:24:13 | ctx.request | +| src/koa.js:10:10:28:1 | functio ... az');\\n} | src/koa.js:25:3:25:13 | ctx.request | +| src/koa.js:10:10:28:1 | functio ... az');\\n} | src/koa.js:26:3:26:13 | ctx.request | +test_ContextExpr +| src/koa.js:11:3:11:6 | this | src/koa.js:10:10:28:1 | functio ... az');\\n} | +| src/koa.js:12:3:12:6 | this | src/koa.js:10:10:28:1 | functio ... az');\\n} | +| src/koa.js:13:3:13:5 | ctx | src/koa.js:10:10:28:1 | functio ... az');\\n} | +| src/koa.js:14:3:14:5 | ctx | src/koa.js:10:10:28:1 | functio ... az');\\n} | +| src/koa.js:15:13:15:15 | ctx | src/koa.js:10:10:28:1 | functio ... az');\\n} | +| src/koa.js:18:3:18:5 | ctx | src/koa.js:10:10:28:1 | functio ... az');\\n} | +| src/koa.js:19:3:19:5 | ctx | src/koa.js:10:10:28:1 | functio ... az');\\n} | +| src/koa.js:20:3:20:5 | ctx | src/koa.js:10:10:28:1 | functio ... az');\\n} | +| src/koa.js:21:3:21:5 | ctx | src/koa.js:10:10:28:1 | functio ... az');\\n} | +| src/koa.js:22:3:22:5 | ctx | src/koa.js:10:10:28:1 | functio ... az');\\n} | +| src/koa.js:23:3:23:5 | ctx | src/koa.js:10:10:28:1 | functio ... az');\\n} | +| src/koa.js:24:3:24:5 | ctx | src/koa.js:10:10:28:1 | functio ... az');\\n} | +| src/koa.js:25:3:25:5 | ctx | src/koa.js:10:10:28:1 | functio ... az');\\n} | +| src/koa.js:26:3:26:5 | ctx | src/koa.js:10:10:28:1 | functio ... az');\\n} | +| src/koa.js:27:3:27:5 | ctx | src/koa.js:10:10:28:1 | functio ... az');\\n} | diff --git a/javascript/ql/test/library-tests/frameworks/koa/tests.ql b/javascript/ql/test/library-tests/frameworks/koa/tests.ql new file mode 100644 index 000000000000..63e59c43e2a9 --- /dev/null +++ b/javascript/ql/test/library-tests/frameworks/koa/tests.ql @@ -0,0 +1,18 @@ +import RouteSetup +import RequestInputAccess +import RouteHandler_getAResponseHeader +import HeaderDefinition_defines +import ResponseExpr +import RouteHandler_getAContextExpr +import HeaderDefinition +import RouteSetup_getServer +import HeaderDefinition_getAHeaderName +import HeaderAccess +import RouteHandler_getAResponseExpr +import ResponseSendArgument +import RouteSetup_getARouteHandler +import AppDefinition +import RouteHandler +import RequestExpr +import RouteHandler_getARequestExpr +import ContextExpr diff --git a/javascript/ql/test/library-tests/frameworks/restify/HeaderDefinition.expected b/javascript/ql/test/library-tests/frameworks/restify/HeaderDefinition.expected deleted file mode 100644 index 6cb2ab105c29..000000000000 --- a/javascript/ql/test/library-tests/frameworks/restify/HeaderDefinition.expected +++ /dev/null @@ -1,2 +0,0 @@ -| src/test.js:10:5:10:34 | respons ... 1', '') | src/test.js:9:19:11:1 | functio ... ition\\n} | -| src/test.js:13:5:13:37 | respons ... 2', '') | src/test.js:12:19:22:1 | functio ... okie;\\n} | diff --git a/javascript/ql/test/library-tests/frameworks/restify/HeaderDefinition.ql b/javascript/ql/test/library-tests/frameworks/restify/HeaderDefinition.ql deleted file mode 100644 index 3b80ae28376c..000000000000 --- a/javascript/ql/test/library-tests/frameworks/restify/HeaderDefinition.ql +++ /dev/null @@ -1,5 +0,0 @@ -import javascript - -from HTTP::HeaderDefinition hd, Restify::RouteHandler rh -where rh = hd.getRouteHandler() -select hd, rh diff --git a/javascript/ql/test/library-tests/frameworks/restify/HeaderDefinition.qll b/javascript/ql/test/library-tests/frameworks/restify/HeaderDefinition.qll new file mode 100644 index 000000000000..9e101f7ea377 --- /dev/null +++ b/javascript/ql/test/library-tests/frameworks/restify/HeaderDefinition.qll @@ -0,0 +1,5 @@ +import javascript + +query predicate test_HeaderDefinition(HTTP::HeaderDefinition hd, Restify::RouteHandler rh) { + rh = hd.getRouteHandler() +} diff --git a/javascript/ql/test/library-tests/frameworks/restify/HeaderDefinition_defines.expected b/javascript/ql/test/library-tests/frameworks/restify/HeaderDefinition_defines.expected deleted file mode 100644 index 687d1c102293..000000000000 --- a/javascript/ql/test/library-tests/frameworks/restify/HeaderDefinition_defines.expected +++ /dev/null @@ -1,2 +0,0 @@ -| src/test.js:10:5:10:34 | respons ... 1', '') | header1 | | -| src/test.js:13:5:13:37 | respons ... 2', '') | header2 | | diff --git a/javascript/ql/test/library-tests/frameworks/restify/HeaderDefinition_defines.ql b/javascript/ql/test/library-tests/frameworks/restify/HeaderDefinition_defines.ql deleted file mode 100644 index ad96258c6777..000000000000 --- a/javascript/ql/test/library-tests/frameworks/restify/HeaderDefinition_defines.ql +++ /dev/null @@ -1,7 +0,0 @@ -import javascript - -from HTTP::HeaderDefinition hd, string name, string value -where - hd.defines(name, value) and - hd.getRouteHandler() instanceof Restify::RouteHandler -select hd, name, value diff --git a/javascript/ql/test/library-tests/frameworks/restify/HeaderDefinition_defines.qll b/javascript/ql/test/library-tests/frameworks/restify/HeaderDefinition_defines.qll new file mode 100644 index 000000000000..3f6694173ca6 --- /dev/null +++ b/javascript/ql/test/library-tests/frameworks/restify/HeaderDefinition_defines.qll @@ -0,0 +1,5 @@ +import javascript + +query predicate test_HeaderDefinition_defines(HTTP::HeaderDefinition hd, string name, string value) { + hd.defines(name, value) and hd.getRouteHandler() instanceof Restify::RouteHandler +} diff --git a/javascript/ql/test/library-tests/frameworks/restify/HeaderDefinition_getAHeaderName.expected b/javascript/ql/test/library-tests/frameworks/restify/HeaderDefinition_getAHeaderName.expected deleted file mode 100644 index a2bb5ce1b43d..000000000000 --- a/javascript/ql/test/library-tests/frameworks/restify/HeaderDefinition_getAHeaderName.expected +++ /dev/null @@ -1,2 +0,0 @@ -| src/test.js:10:5:10:34 | respons ... 1', '') | header1 | -| src/test.js:13:5:13:37 | respons ... 2', '') | header2 | diff --git a/javascript/ql/test/library-tests/frameworks/restify/HeaderDefinition_getAHeaderName.ql b/javascript/ql/test/library-tests/frameworks/restify/HeaderDefinition_getAHeaderName.ql deleted file mode 100644 index 6b1a4767a1ea..000000000000 --- a/javascript/ql/test/library-tests/frameworks/restify/HeaderDefinition_getAHeaderName.ql +++ /dev/null @@ -1,5 +0,0 @@ -import javascript - -from HTTP::HeaderDefinition hd -where hd.getRouteHandler() instanceof Restify::RouteHandler -select hd, hd.getAHeaderName() diff --git a/javascript/ql/test/library-tests/frameworks/restify/HeaderDefinition_getAHeaderName.qll b/javascript/ql/test/library-tests/frameworks/restify/HeaderDefinition_getAHeaderName.qll new file mode 100644 index 000000000000..f546a1569913 --- /dev/null +++ b/javascript/ql/test/library-tests/frameworks/restify/HeaderDefinition_getAHeaderName.qll @@ -0,0 +1,5 @@ +import javascript + +query predicate test_HeaderDefinition_getAHeaderName(HTTP::HeaderDefinition hd, string res) { + hd.getRouteHandler() instanceof Restify::RouteHandler and res = hd.getAHeaderName() +} diff --git a/javascript/ql/test/library-tests/frameworks/restify/RequestExpr.expected b/javascript/ql/test/library-tests/frameworks/restify/RequestExpr.expected deleted file mode 100644 index 7fa8a6a648b5..000000000000 --- a/javascript/ql/test/library-tests/frameworks/restify/RequestExpr.expected +++ /dev/null @@ -1,8 +0,0 @@ -| src/test.js:14:5:14:11 | request | src/test.js:12:19:22:1 | functio ... okie;\\n} | -| src/test.js:15:5:15:11 | request | src/test.js:12:19:22:1 | functio ... okie;\\n} | -| src/test.js:16:5:16:11 | request | src/test.js:12:19:22:1 | functio ... okie;\\n} | -| src/test.js:17:5:17:11 | request | src/test.js:12:19:22:1 | functio ... okie;\\n} | -| src/test.js:18:5:18:11 | request | src/test.js:12:19:22:1 | functio ... okie;\\n} | -| src/test.js:19:5:19:11 | request | src/test.js:12:19:22:1 | functio ... okie;\\n} | -| src/test.js:20:5:20:11 | request | src/test.js:12:19:22:1 | functio ... okie;\\n} | -| src/test.js:21:5:21:11 | request | src/test.js:12:19:22:1 | functio ... okie;\\n} | diff --git a/javascript/ql/test/library-tests/frameworks/restify/RequestExpr.ql b/javascript/ql/test/library-tests/frameworks/restify/RequestExpr.ql deleted file mode 100644 index e346d0aa1ce1..000000000000 --- a/javascript/ql/test/library-tests/frameworks/restify/RequestExpr.ql +++ /dev/null @@ -1,4 +0,0 @@ -import javascript - -from Restify::RequestExpr e -select e, e.getRouteHandler() diff --git a/javascript/ql/test/library-tests/frameworks/restify/RequestExpr.qll b/javascript/ql/test/library-tests/frameworks/restify/RequestExpr.qll new file mode 100644 index 000000000000..16facf7c3a91 --- /dev/null +++ b/javascript/ql/test/library-tests/frameworks/restify/RequestExpr.qll @@ -0,0 +1,5 @@ +import javascript + +query predicate test_RequestExpr(Restify::RequestExpr e, HTTP::RouteHandler res) { + res = e.getRouteHandler() +} diff --git a/javascript/ql/test/library-tests/frameworks/restify/RequestInputAccess.expected b/javascript/ql/test/library-tests/frameworks/restify/RequestInputAccess.expected deleted file mode 100644 index 58b8f8b7934b..000000000000 --- a/javascript/ql/test/library-tests/frameworks/restify/RequestInputAccess.expected +++ /dev/null @@ -1,7 +0,0 @@ -| src/test.js:14:5:14:26 | request ... y().foo | parameter | src/test.js:12:19:22:1 | functio ... okie;\\n} | -| src/test.js:15:5:15:18 | request.href() | url | src/test.js:12:19:22:1 | functio ... okie;\\n} | -| src/test.js:16:5:16:21 | request.getPath() | url | src/test.js:12:19:22:1 | functio ... okie;\\n} | -| src/test.js:17:5:17:28 | request ... tType() | header | src/test.js:12:19:22:1 | functio ... okie;\\n} | -| src/test.js:18:5:18:23 | request.userAgent() | header | src/test.js:12:19:22:1 | functio ... okie;\\n} | -| src/test.js:19:5:19:26 | request ... ('bar') | header | src/test.js:12:19:22:1 | functio ... okie;\\n} | -| src/test.js:20:5:20:25 | request ... ('baz') | header | src/test.js:12:19:22:1 | functio ... okie;\\n} | diff --git a/javascript/ql/test/library-tests/frameworks/restify/RequestInputAccess.ql b/javascript/ql/test/library-tests/frameworks/restify/RequestInputAccess.ql deleted file mode 100644 index 7a4f651ea9af..000000000000 --- a/javascript/ql/test/library-tests/frameworks/restify/RequestInputAccess.ql +++ /dev/null @@ -1,5 +0,0 @@ -import javascript - -from HTTP::RequestInputAccess ria, Restify::RouteHandler rh -where ria.getRouteHandler() = rh -select ria, ria.getKind(), rh diff --git a/javascript/ql/test/library-tests/frameworks/restify/RequestInputAccess.qll b/javascript/ql/test/library-tests/frameworks/restify/RequestInputAccess.qll new file mode 100644 index 000000000000..0c9f028f4435 --- /dev/null +++ b/javascript/ql/test/library-tests/frameworks/restify/RequestInputAccess.qll @@ -0,0 +1,7 @@ +import javascript + +query predicate test_RequestInputAccess( + HTTP::RequestInputAccess ria, string res, Restify::RouteHandler rh +) { + ria.getRouteHandler() = rh and res = ria.getKind() +} diff --git a/javascript/ql/test/library-tests/frameworks/restify/ResponseExpr.expected b/javascript/ql/test/library-tests/frameworks/restify/ResponseExpr.expected deleted file mode 100644 index 26c8785ff67f..000000000000 --- a/javascript/ql/test/library-tests/frameworks/restify/ResponseExpr.expected +++ /dev/null @@ -1,2 +0,0 @@ -| src/test.js:10:5:10:12 | response | src/test.js:9:19:11:1 | functio ... ition\\n} | -| src/test.js:13:5:13:12 | response | src/test.js:12:19:22:1 | functio ... okie;\\n} | diff --git a/javascript/ql/test/library-tests/frameworks/restify/ResponseExpr.ql b/javascript/ql/test/library-tests/frameworks/restify/ResponseExpr.ql deleted file mode 100644 index d00373ab4163..000000000000 --- a/javascript/ql/test/library-tests/frameworks/restify/ResponseExpr.ql +++ /dev/null @@ -1,4 +0,0 @@ -import javascript - -from Restify::ResponseExpr e -select e, e.getRouteHandler() diff --git a/javascript/ql/test/library-tests/frameworks/restify/ResponseExpr.qll b/javascript/ql/test/library-tests/frameworks/restify/ResponseExpr.qll new file mode 100644 index 000000000000..a02524c0b9fd --- /dev/null +++ b/javascript/ql/test/library-tests/frameworks/restify/ResponseExpr.qll @@ -0,0 +1,5 @@ +import javascript + +query predicate test_ResponseExpr(Restify::ResponseExpr e, HTTP::RouteHandler res) { + res = e.getRouteHandler() +} diff --git a/javascript/ql/test/library-tests/frameworks/restify/RouteHandler.expected b/javascript/ql/test/library-tests/frameworks/restify/RouteHandler.expected deleted file mode 100644 index 77a4df5e41f1..000000000000 --- a/javascript/ql/test/library-tests/frameworks/restify/RouteHandler.expected +++ /dev/null @@ -1,3 +0,0 @@ -| src/test.js:6:1:6:21 | functio ... er1(){} | src/test.js:4:15:4:36 | restify ... erver() | -| src/test.js:9:19:11:1 | functio ... ition\\n} | src/test.js:4:15:4:36 | restify ... erver() | -| src/test.js:12:19:22:1 | functio ... okie;\\n} | src/test.js:4:15:4:36 | restify ... erver() | diff --git a/javascript/ql/test/library-tests/frameworks/restify/RouteHandler.ql b/javascript/ql/test/library-tests/frameworks/restify/RouteHandler.ql deleted file mode 100644 index 8a0c81110e5a..000000000000 --- a/javascript/ql/test/library-tests/frameworks/restify/RouteHandler.ql +++ /dev/null @@ -1,4 +0,0 @@ -import javascript - -from Restify::RouteHandler rh -select rh, rh.getServer() diff --git a/javascript/ql/test/library-tests/frameworks/restify/RouteHandler.qll b/javascript/ql/test/library-tests/frameworks/restify/RouteHandler.qll new file mode 100644 index 000000000000..c15bb690a72c --- /dev/null +++ b/javascript/ql/test/library-tests/frameworks/restify/RouteHandler.qll @@ -0,0 +1,3 @@ +import javascript + +query predicate test_RouteHandler(Restify::RouteHandler rh, Expr res) { res = rh.getServer() } diff --git a/javascript/ql/test/library-tests/frameworks/restify/RouteHandler_getARequestExpr.expected b/javascript/ql/test/library-tests/frameworks/restify/RouteHandler_getARequestExpr.expected deleted file mode 100644 index 7fc0233bfcf4..000000000000 --- a/javascript/ql/test/library-tests/frameworks/restify/RouteHandler_getARequestExpr.expected +++ /dev/null @@ -1,8 +0,0 @@ -| src/test.js:12:19:22:1 | functio ... okie;\\n} | src/test.js:14:5:14:11 | request | -| src/test.js:12:19:22:1 | functio ... okie;\\n} | src/test.js:15:5:15:11 | request | -| src/test.js:12:19:22:1 | functio ... okie;\\n} | src/test.js:16:5:16:11 | request | -| src/test.js:12:19:22:1 | functio ... okie;\\n} | src/test.js:17:5:17:11 | request | -| src/test.js:12:19:22:1 | functio ... okie;\\n} | src/test.js:18:5:18:11 | request | -| src/test.js:12:19:22:1 | functio ... okie;\\n} | src/test.js:19:5:19:11 | request | -| src/test.js:12:19:22:1 | functio ... okie;\\n} | src/test.js:20:5:20:11 | request | -| src/test.js:12:19:22:1 | functio ... okie;\\n} | src/test.js:21:5:21:11 | request | diff --git a/javascript/ql/test/library-tests/frameworks/restify/RouteHandler_getARequestExpr.ql b/javascript/ql/test/library-tests/frameworks/restify/RouteHandler_getARequestExpr.ql deleted file mode 100644 index 9e60c2c2465f..000000000000 --- a/javascript/ql/test/library-tests/frameworks/restify/RouteHandler_getARequestExpr.ql +++ /dev/null @@ -1,4 +0,0 @@ -import semmle.javascript.frameworks.Express - -from Restify::RouteHandler rh -select rh, rh.getARequestExpr() diff --git a/javascript/ql/test/library-tests/frameworks/restify/RouteHandler_getARequestExpr.qll b/javascript/ql/test/library-tests/frameworks/restify/RouteHandler_getARequestExpr.qll new file mode 100644 index 000000000000..97c54cbceff7 --- /dev/null +++ b/javascript/ql/test/library-tests/frameworks/restify/RouteHandler_getARequestExpr.qll @@ -0,0 +1,5 @@ +import semmle.javascript.frameworks.Express + +query predicate test_RouteHandler_getARequestExpr(Restify::RouteHandler rh, HTTP::RequestExpr res) { + res = rh.getARequestExpr() +} diff --git a/javascript/ql/test/library-tests/frameworks/restify/RouteHandler_getAResponseExpr.expected b/javascript/ql/test/library-tests/frameworks/restify/RouteHandler_getAResponseExpr.expected deleted file mode 100644 index f77b4acd8fad..000000000000 --- a/javascript/ql/test/library-tests/frameworks/restify/RouteHandler_getAResponseExpr.expected +++ /dev/null @@ -1,2 +0,0 @@ -| src/test.js:9:19:11:1 | functio ... ition\\n} | src/test.js:10:5:10:12 | response | -| src/test.js:12:19:22:1 | functio ... okie;\\n} | src/test.js:13:5:13:12 | response | diff --git a/javascript/ql/test/library-tests/frameworks/restify/RouteHandler_getAResponseExpr.ql b/javascript/ql/test/library-tests/frameworks/restify/RouteHandler_getAResponseExpr.ql deleted file mode 100644 index ab5c0ae5f810..000000000000 --- a/javascript/ql/test/library-tests/frameworks/restify/RouteHandler_getAResponseExpr.ql +++ /dev/null @@ -1,4 +0,0 @@ -import semmle.javascript.frameworks.Express - -from Restify::RouteHandler rh -select rh, rh.getAResponseExpr() diff --git a/javascript/ql/test/library-tests/frameworks/restify/RouteHandler_getAResponseExpr.qll b/javascript/ql/test/library-tests/frameworks/restify/RouteHandler_getAResponseExpr.qll new file mode 100644 index 000000000000..749964afa526 --- /dev/null +++ b/javascript/ql/test/library-tests/frameworks/restify/RouteHandler_getAResponseExpr.qll @@ -0,0 +1,5 @@ +import semmle.javascript.frameworks.Express + +query predicate test_RouteHandler_getAResponseExpr(Restify::RouteHandler rh, HTTP::ResponseExpr res) { + res = rh.getAResponseExpr() +} diff --git a/javascript/ql/test/library-tests/frameworks/restify/RouteHandler_getAResponseHeader.expected b/javascript/ql/test/library-tests/frameworks/restify/RouteHandler_getAResponseHeader.expected deleted file mode 100644 index 9c630435b3e3..000000000000 --- a/javascript/ql/test/library-tests/frameworks/restify/RouteHandler_getAResponseHeader.expected +++ /dev/null @@ -1,2 +0,0 @@ -| src/test.js:9:19:11:1 | functio ... ition\\n} | header1 | src/test.js:10:5:10:34 | respons ... 1', '') | -| src/test.js:12:19:22:1 | functio ... okie;\\n} | header2 | src/test.js:13:5:13:37 | respons ... 2', '') | diff --git a/javascript/ql/test/library-tests/frameworks/restify/RouteHandler_getAResponseHeader.ql b/javascript/ql/test/library-tests/frameworks/restify/RouteHandler_getAResponseHeader.ql deleted file mode 100644 index 2ead94ea3648..000000000000 --- a/javascript/ql/test/library-tests/frameworks/restify/RouteHandler_getAResponseHeader.ql +++ /dev/null @@ -1,4 +0,0 @@ -import semmle.javascript.frameworks.Express - -from Restify::RouteHandler rh, string name -select rh, name, rh.getAResponseHeader(name) diff --git a/javascript/ql/test/library-tests/frameworks/restify/RouteHandler_getAResponseHeader.qll b/javascript/ql/test/library-tests/frameworks/restify/RouteHandler_getAResponseHeader.qll new file mode 100644 index 000000000000..d807f4879ab3 --- /dev/null +++ b/javascript/ql/test/library-tests/frameworks/restify/RouteHandler_getAResponseHeader.qll @@ -0,0 +1,7 @@ +import semmle.javascript.frameworks.Express + +query predicate test_RouteHandler_getAResponseHeader( + Restify::RouteHandler rh, string name, HTTP::HeaderDefinition res +) { + res = rh.getAResponseHeader(name) +} diff --git a/javascript/ql/test/library-tests/frameworks/restify/RouteSetup.expected b/javascript/ql/test/library-tests/frameworks/restify/RouteSetup.expected deleted file mode 100644 index 4016872253b5..000000000000 --- a/javascript/ql/test/library-tests/frameworks/restify/RouteSetup.expected +++ /dev/null @@ -1,3 +0,0 @@ -| src/test.js:7:1:7:26 | server2 ... ndler1) | -| src/test.js:9:1:11:2 | server2 ... tion\\n}) | -| src/test.js:12:1:22:2 | server2 ... kie;\\n}) | diff --git a/javascript/ql/test/library-tests/frameworks/restify/RouteSetup.ql b/javascript/ql/test/library-tests/frameworks/restify/RouteSetup.ql deleted file mode 100644 index 4aedbfd8a107..000000000000 --- a/javascript/ql/test/library-tests/frameworks/restify/RouteSetup.ql +++ /dev/null @@ -1,4 +0,0 @@ -import javascript - -from Restify::RouteSetup rs -select rs diff --git a/javascript/ql/test/library-tests/frameworks/restify/RouteSetup.qll b/javascript/ql/test/library-tests/frameworks/restify/RouteSetup.qll new file mode 100644 index 000000000000..cc2481cae5a6 --- /dev/null +++ b/javascript/ql/test/library-tests/frameworks/restify/RouteSetup.qll @@ -0,0 +1,3 @@ +import javascript + +query predicate test_RouteSetup(Restify::RouteSetup rs) { any() } diff --git a/javascript/ql/test/library-tests/frameworks/restify/RouteSetup_getARouteHandler.expected b/javascript/ql/test/library-tests/frameworks/restify/RouteSetup_getARouteHandler.expected deleted file mode 100644 index 8c656c8f183c..000000000000 --- a/javascript/ql/test/library-tests/frameworks/restify/RouteSetup_getARouteHandler.expected +++ /dev/null @@ -1,3 +0,0 @@ -| src/test.js:7:1:7:26 | server2 ... ndler1) | src/test.js:6:1:6:21 | functio ... er1(){} | -| src/test.js:9:1:11:2 | server2 ... tion\\n}) | src/test.js:9:19:11:1 | functio ... ition\\n} | -| src/test.js:12:1:22:2 | server2 ... kie;\\n}) | src/test.js:12:19:22:1 | functio ... okie;\\n} | diff --git a/javascript/ql/test/library-tests/frameworks/restify/RouteSetup_getARouteHandler.ql b/javascript/ql/test/library-tests/frameworks/restify/RouteSetup_getARouteHandler.ql deleted file mode 100644 index eeeb3bfad3f7..000000000000 --- a/javascript/ql/test/library-tests/frameworks/restify/RouteSetup_getARouteHandler.ql +++ /dev/null @@ -1,4 +0,0 @@ -import javascript - -from Restify::RouteSetup r -select r, r.getARouteHandler() diff --git a/javascript/ql/test/library-tests/frameworks/restify/RouteSetup_getARouteHandler.qll b/javascript/ql/test/library-tests/frameworks/restify/RouteSetup_getARouteHandler.qll new file mode 100644 index 000000000000..aee0ad19c101 --- /dev/null +++ b/javascript/ql/test/library-tests/frameworks/restify/RouteSetup_getARouteHandler.qll @@ -0,0 +1,5 @@ +import javascript + +query predicate test_RouteSetup_getARouteHandler(Restify::RouteSetup r, DataFlow::SourceNode res) { + res = r.getARouteHandler() +} diff --git a/javascript/ql/test/library-tests/frameworks/restify/RouteSetup_getServer.expected b/javascript/ql/test/library-tests/frameworks/restify/RouteSetup_getServer.expected deleted file mode 100644 index 25e308164b35..000000000000 --- a/javascript/ql/test/library-tests/frameworks/restify/RouteSetup_getServer.expected +++ /dev/null @@ -1,3 +0,0 @@ -| src/test.js:7:1:7:26 | server2 ... ndler1) | src/test.js:4:15:4:36 | restify ... erver() | -| src/test.js:9:1:11:2 | server2 ... tion\\n}) | src/test.js:4:15:4:36 | restify ... erver() | -| src/test.js:12:1:22:2 | server2 ... kie;\\n}) | src/test.js:4:15:4:36 | restify ... erver() | diff --git a/javascript/ql/test/library-tests/frameworks/restify/RouteSetup_getServer.ql b/javascript/ql/test/library-tests/frameworks/restify/RouteSetup_getServer.ql deleted file mode 100644 index 503e7bfb7a8d..000000000000 --- a/javascript/ql/test/library-tests/frameworks/restify/RouteSetup_getServer.ql +++ /dev/null @@ -1,4 +0,0 @@ -import javascript - -from Restify::RouteSetup rs -select rs, rs.getServer() diff --git a/javascript/ql/test/library-tests/frameworks/restify/RouteSetup_getServer.qll b/javascript/ql/test/library-tests/frameworks/restify/RouteSetup_getServer.qll new file mode 100644 index 000000000000..fb6d67c3e54c --- /dev/null +++ b/javascript/ql/test/library-tests/frameworks/restify/RouteSetup_getServer.qll @@ -0,0 +1,3 @@ +import javascript + +query predicate test_RouteSetup_getServer(Restify::RouteSetup rs, Expr res) { res = rs.getServer() } diff --git a/javascript/ql/test/library-tests/frameworks/restify/ServerDefinition.expected b/javascript/ql/test/library-tests/frameworks/restify/ServerDefinition.expected deleted file mode 100644 index b2da2f50fc23..000000000000 --- a/javascript/ql/test/library-tests/frameworks/restify/ServerDefinition.expected +++ /dev/null @@ -1,2 +0,0 @@ -| src/test.js:1:15:1:47 | require ... erver() | -| src/test.js:4:15:4:36 | restify ... erver() | diff --git a/javascript/ql/test/library-tests/frameworks/restify/ServerDefinition.ql b/javascript/ql/test/library-tests/frameworks/restify/ServerDefinition.ql deleted file mode 100644 index cd871d1782fe..000000000000 --- a/javascript/ql/test/library-tests/frameworks/restify/ServerDefinition.ql +++ /dev/null @@ -1,4 +0,0 @@ -import javascript - -from Restify::ServerDefinition s -select s diff --git a/javascript/ql/test/library-tests/frameworks/restify/ServerDefinition.qll b/javascript/ql/test/library-tests/frameworks/restify/ServerDefinition.qll new file mode 100644 index 000000000000..9726fbb8b2ef --- /dev/null +++ b/javascript/ql/test/library-tests/frameworks/restify/ServerDefinition.qll @@ -0,0 +1,3 @@ +import javascript + +query predicate test_ServerDefinition(Restify::ServerDefinition s) { any() } diff --git a/javascript/ql/test/library-tests/frameworks/restify/tests.expected b/javascript/ql/test/library-tests/frameworks/restify/tests.expected new file mode 100644 index 000000000000..67d4467cbf36 --- /dev/null +++ b/javascript/ql/test/library-tests/frameworks/restify/tests.expected @@ -0,0 +1,63 @@ +test_RouteSetup +| src/test.js:7:1:7:26 | server2 ... ndler1) | +| src/test.js:9:1:11:2 | server2 ... tion\\n}) | +| src/test.js:12:1:22:2 | server2 ... kie;\\n}) | +test_RequestInputAccess +| src/test.js:14:5:14:26 | request ... y().foo | parameter | src/test.js:12:19:22:1 | functio ... okie;\\n} | +| src/test.js:15:5:15:18 | request.href() | url | src/test.js:12:19:22:1 | functio ... okie;\\n} | +| src/test.js:16:5:16:21 | request.getPath() | url | src/test.js:12:19:22:1 | functio ... okie;\\n} | +| src/test.js:17:5:17:28 | request ... tType() | header | src/test.js:12:19:22:1 | functio ... okie;\\n} | +| src/test.js:18:5:18:23 | request.userAgent() | header | src/test.js:12:19:22:1 | functio ... okie;\\n} | +| src/test.js:19:5:19:26 | request ... ('bar') | header | src/test.js:12:19:22:1 | functio ... okie;\\n} | +| src/test.js:20:5:20:25 | request ... ('baz') | header | src/test.js:12:19:22:1 | functio ... okie;\\n} | +test_RouteHandler_getAResponseHeader +| src/test.js:9:19:11:1 | functio ... ition\\n} | header1 | src/test.js:10:5:10:34 | respons ... 1', '') | +| src/test.js:12:19:22:1 | functio ... okie;\\n} | header2 | src/test.js:13:5:13:37 | respons ... 2', '') | +test_HeaderDefinition_defines +| src/test.js:10:5:10:34 | respons ... 1', '') | header1 | | +| src/test.js:13:5:13:37 | respons ... 2', '') | header2 | | +test_ResponseExpr +| src/test.js:10:5:10:12 | response | src/test.js:9:19:11:1 | functio ... ition\\n} | +| src/test.js:13:5:13:12 | response | src/test.js:12:19:22:1 | functio ... okie;\\n} | +test_HeaderDefinition +| src/test.js:10:5:10:34 | respons ... 1', '') | src/test.js:9:19:11:1 | functio ... ition\\n} | +| src/test.js:13:5:13:37 | respons ... 2', '') | src/test.js:12:19:22:1 | functio ... okie;\\n} | +test_RouteSetup_getServer +| src/test.js:7:1:7:26 | server2 ... ndler1) | src/test.js:4:15:4:36 | restify ... erver() | +| src/test.js:9:1:11:2 | server2 ... tion\\n}) | src/test.js:4:15:4:36 | restify ... erver() | +| src/test.js:12:1:22:2 | server2 ... kie;\\n}) | src/test.js:4:15:4:36 | restify ... erver() | +test_HeaderDefinition_getAHeaderName +| src/test.js:10:5:10:34 | respons ... 1', '') | header1 | +| src/test.js:13:5:13:37 | respons ... 2', '') | header2 | +test_ServerDefinition +| src/test.js:1:15:1:47 | require ... erver() | +| src/test.js:4:15:4:36 | restify ... erver() | +test_RouteHandler_getAResponseExpr +| src/test.js:9:19:11:1 | functio ... ition\\n} | src/test.js:10:5:10:12 | response | +| src/test.js:12:19:22:1 | functio ... okie;\\n} | src/test.js:13:5:13:12 | response | +test_RouteSetup_getARouteHandler +| src/test.js:7:1:7:26 | server2 ... ndler1) | src/test.js:6:1:6:21 | functio ... er1(){} | +| src/test.js:9:1:11:2 | server2 ... tion\\n}) | src/test.js:9:19:11:1 | functio ... ition\\n} | +| src/test.js:12:1:22:2 | server2 ... kie;\\n}) | src/test.js:12:19:22:1 | functio ... okie;\\n} | +test_RouteHandler +| src/test.js:6:1:6:21 | functio ... er1(){} | src/test.js:4:15:4:36 | restify ... erver() | +| src/test.js:9:19:11:1 | functio ... ition\\n} | src/test.js:4:15:4:36 | restify ... erver() | +| src/test.js:12:19:22:1 | functio ... okie;\\n} | src/test.js:4:15:4:36 | restify ... erver() | +test_RequestExpr +| src/test.js:14:5:14:11 | request | src/test.js:12:19:22:1 | functio ... okie;\\n} | +| src/test.js:15:5:15:11 | request | src/test.js:12:19:22:1 | functio ... okie;\\n} | +| src/test.js:16:5:16:11 | request | src/test.js:12:19:22:1 | functio ... okie;\\n} | +| src/test.js:17:5:17:11 | request | src/test.js:12:19:22:1 | functio ... okie;\\n} | +| src/test.js:18:5:18:11 | request | src/test.js:12:19:22:1 | functio ... okie;\\n} | +| src/test.js:19:5:19:11 | request | src/test.js:12:19:22:1 | functio ... okie;\\n} | +| src/test.js:20:5:20:11 | request | src/test.js:12:19:22:1 | functio ... okie;\\n} | +| src/test.js:21:5:21:11 | request | src/test.js:12:19:22:1 | functio ... okie;\\n} | +test_RouteHandler_getARequestExpr +| src/test.js:12:19:22:1 | functio ... okie;\\n} | src/test.js:14:5:14:11 | request | +| src/test.js:12:19:22:1 | functio ... okie;\\n} | src/test.js:15:5:15:11 | request | +| src/test.js:12:19:22:1 | functio ... okie;\\n} | src/test.js:16:5:16:11 | request | +| src/test.js:12:19:22:1 | functio ... okie;\\n} | src/test.js:17:5:17:11 | request | +| src/test.js:12:19:22:1 | functio ... okie;\\n} | src/test.js:18:5:18:11 | request | +| src/test.js:12:19:22:1 | functio ... okie;\\n} | src/test.js:19:5:19:11 | request | +| src/test.js:12:19:22:1 | functio ... okie;\\n} | src/test.js:20:5:20:11 | request | +| src/test.js:12:19:22:1 | functio ... okie;\\n} | src/test.js:21:5:21:11 | request | diff --git a/javascript/ql/test/library-tests/frameworks/restify/tests.ql b/javascript/ql/test/library-tests/frameworks/restify/tests.ql new file mode 100644 index 000000000000..6a61854fc9ad --- /dev/null +++ b/javascript/ql/test/library-tests/frameworks/restify/tests.ql @@ -0,0 +1,14 @@ +import RouteSetup +import RequestInputAccess +import RouteHandler_getAResponseHeader +import HeaderDefinition_defines +import ResponseExpr +import HeaderDefinition +import RouteSetup_getServer +import HeaderDefinition_getAHeaderName +import ServerDefinition +import RouteHandler_getAResponseExpr +import RouteSetup_getARouteHandler +import RouteHandler +import RequestExpr +import RouteHandler_getARequestExpr diff --git a/javascript/ql/test/library-tests/stmts/Containers.expected b/javascript/ql/test/library-tests/stmts/Containers.expected deleted file mode 100644 index 49e1baede2fc..000000000000 --- a/javascript/ql/test/library-tests/stmts/Containers.expected +++ /dev/null @@ -1,91 +0,0 @@ -| conditionals.js:1:1:2:5 | if (tru ... t\\n ; | conditionals.js:1:1:12:1 | | -| conditionals.js:2:5:2:5 | ; | conditionals.js:1:1:12:1 | | -| conditionals.js:3:1:6:5 | if (b)\\n ... e\\n ; | conditionals.js:1:1:12:1 | | -| conditionals.js:4:5:4:5 | ; | conditionals.js:1:1:12:1 | | -| conditionals.js:6:5:6:5 | ; | conditionals.js:1:1:12:1 | | -| conditionals.js:7:1:12:1 | switch ... ault:\\n} | conditionals.js:1:1:12:1 | | -| conditionals.js:8:1:8:8 | case 23: | conditionals.js:1:1:12:1 | | -| conditionals.js:9:1:10:10 | case c:\\n break; | conditionals.js:1:1:12:1 | | -| conditionals.js:10:5:10:10 | break; | conditionals.js:1:1:12:1 | | -| conditionals.js:11:1:11:8 | default: | conditionals.js:1:1:12:1 | | -| es2015.js:1:1:2:16 | for (va ... log(x); | es2015.js:1:1:3:0 | | -| es2015.js:1:6:1:10 | var x | es2015.js:1:1:3:0 | | -| es2015.js:2:2:2:16 | console.log(x); | es2015.js:1:1:3:0 | | -| foreach.js:1:1:1:12 | var sum = 0; | foreach.js:1:1:11:0 | | -| foreach.js:2:1:2:42 | var obj ... p3: 8}; | foreach.js:1:1:11:0 | | -| foreach.js:4:1:6:1 | for eac ... item;\\n} | foreach.js:1:1:11:0 | | -| foreach.js:4:11:4:18 | var item | foreach.js:1:1:11:0 | | -| foreach.js:4:28:6:1 | {\\n sum += item;\\n} | foreach.js:1:1:11:0 | | -| foreach.js:5:3:5:14 | sum += item; | foreach.js:1:1:11:0 | | -| foreach.js:8:1:8:17 | console.log(sum); | foreach.js:1:1:11:0 | | -| functions.js:1:1:3:1 | functio ... x+y;\\n} | functions.js:1:1:9:1 | | -| functions.js:1:18:3:1 | { // se ... x+y;\\n} | functions.js:1:1:3:1 | functio ... x+y;\\n} | -| functions.js:2:5:2:15 | return x+y; | functions.js:1:1:3:1 | functio ... x+y;\\n} | -| functions.js:5:1:5:15 | function h() {} | functions.js:1:1:9:1 | | -| functions.js:5:14:5:15 | {} | functions.js:5:1:5:15 | function h() {} | -| functions.js:7:1:9:1 | k = fun ... turn;\\n} | functions.js:1:1:9:1 | | -| functions.js:7:16:9:1 | {\\n return;\\n} | functions.js:7:5:9:1 | functio ... turn;\\n} | -| functions.js:8:5:8:11 | return; | functions.js:7:5:9:1 | functio ... turn;\\n} | -| guardedCatch.js:1:1:9:1 | functio ... );\\n\\t}\\n} | guardedCatch.js:1:1:11:65 | | -| guardedCatch.js:1:15:9:1 | {\\n\\ttry ... );\\n\\t}\\n} | guardedCatch.js:1:1:9:1 | functio ... );\\n\\t}\\n} | -| guardedCatch.js:2:2:8:2 | try {\\n\\t ... !");\\n\\t} | guardedCatch.js:1:1:9:1 | functio ... );\\n\\t}\\n} | -| guardedCatch.js:2:6:4:2 | {\\n\\t\\tg();\\n\\t} | guardedCatch.js:1:1:9:1 | functio ... );\\n\\t}\\n} | -| guardedCatch.js:3:3:3:6 | g(); | guardedCatch.js:1:1:9:1 | functio ... );\\n\\t}\\n} | -| guardedCatch.js:4:4:6:2 | catch ( ... !");\\n\\t} | guardedCatch.js:1:1:9:1 | functio ... );\\n\\t}\\n} | -| guardedCatch.js:4:36:6:2 | {\\n\\t\\tcon ... !");\\n\\t} | guardedCatch.js:1:1:9:1 | functio ... );\\n\\t}\\n} | -| guardedCatch.js:5:3:5:24 | console ... ror!"); | guardedCatch.js:1:1:9:1 | functio ... );\\n\\t}\\n} | -| guardedCatch.js:6:4:8:2 | catch ( ... !");\\n\\t} | guardedCatch.js:1:1:9:1 | functio ... );\\n\\t}\\n} | -| guardedCatch.js:6:14:8:2 | {\\n\\t\\tcon ... !");\\n\\t} | guardedCatch.js:1:1:9:1 | functio ... );\\n\\t}\\n} | -| guardedCatch.js:7:3:7:33 | console ... lse!"); | guardedCatch.js:1:1:9:1 | functio ... );\\n\\t}\\n} | -| jscript.js:1:1:1:28 | functio ... ad() {} | jscript.js:1:1:5:65 | | -| jscript.js:1:27:1:28 | {} | jscript.js:1:1:1:28 | functio ... ad() {} | -| jscript.js:3:1:3:36 | window. ... ad() {} | jscript.js:1:1:5:65 | | -| jscript.js:3:35:3:36 | {} | jscript.js:3:17:3:36 | function onload() {} | -| legacyletstmt.js:1:1:3:1 | let (x ... + y);\\n} | legacyletstmt.js:1:1:5:65 | | -| legacyletstmt.js:1:22:3:1 | {\\n con ... + y);\\n} | legacyletstmt.js:1:1:5:65 | | -| legacyletstmt.js:2:3:2:21 | console.log(x + y); | legacyletstmt.js:1:1:5:65 | | -| loops.js:1:1:2:5 | while(t ... t\\n ; | loops.js:1:1:22:18 | | -| loops.js:2:5:2:5 | ; | loops.js:1:1:22:18 | | -| loops.js:3:1:11:1 | outer: ... inue;\\n} | loops.js:1:1:22:18 | | -| loops.js:3:8:11:1 | for(a; ... inue;\\n} | loops.js:1:1:22:18 | | -| loops.js:3:21:11:1 | {\\n f ... inue;\\n} | loops.js:1:1:22:18 | | -| loops.js:4:5:10:21 | for(;;) ... ntinue; | loops.js:1:1:22:18 | | -| loops.js:5:9:10:21 | if (d)\\n ... ntinue; | loops.js:1:1:22:18 | | -| loops.js:6:13:6:27 | continue outer; | loops.js:1:1:22:18 | | -| loops.js:7:14:10:21 | if (e)\\n ... ntinue; | loops.js:1:1:22:18 | | -| loops.js:8:13:8:24 | break outer; | loops.js:1:1:22:18 | | -| loops.js:10:13:10:21 | continue; | loops.js:1:1:22:18 | | -| loops.js:13:1:15:11 | do {\\n ... ile(a); | loops.js:1:1:22:18 | | -| loops.js:13:4:15:1 | {\\n ;\\n} | loops.js:1:1:22:18 | | -| loops.js:14:5:14:5 | ; | loops.js:1:1:22:18 | | -| loops.js:17:1:17:29 | for (va ... ; ++i); | loops.js:1:1:22:18 | | -| loops.js:17:6:17:17 | var i=0,n=10 | loops.js:1:1:22:18 | | -| loops.js:17:29:17:29 | ; | loops.js:1:1:22:18 | | -| loops.js:19:1:19:18 | for (var x in xs); | loops.js:1:1:22:18 | | -| loops.js:19:6:19:10 | var x | loops.js:1:1:22:18 | | -| loops.js:19:18:19:18 | ; | loops.js:1:1:22:18 | | -| loops.js:20:1:20:14 | for (x in xs); | loops.js:1:1:22:18 | | -| loops.js:20:14:20:14 | ; | loops.js:1:1:22:18 | | -| loops.js:21:1:21:16 | for (x.f in xs); | loops.js:1:1:22:18 | | -| loops.js:21:16:21:16 | ; | loops.js:1:1:22:18 | | -| loops.js:22:1:22:18 | for (x = 0 in xs); | loops.js:1:1:22:18 | | -| loops.js:22:18:22:18 | ; | loops.js:1:1:22:18 | | -| others.js:1:1:2:1 | with(a) ... -text\\n} | others.js:1:1:4:14 | | -| others.js:1:9:2:1 | { // se ... -text\\n} | others.js:1:1:4:14 | | -| others.js:3:1:3:9 | debugger; | others.js:1:1:4:14 | | -| others.js:4:1:4:14 | var x = 23, y; | others.js:1:1:4:14 | | -| try.js:1:1:3:16 | try { / ... ) { ; } | try.js:1:1:5:29 | | -| try.js:1:5:3:1 | { // se ... "!";\\n} | try.js:1:1:5:29 | | -| try.js:2:5:2:14 | throw "!"; | try.js:1:1:5:29 | | -| try.js:3:3:3:16 | catch(x) { ; } | try.js:1:1:5:29 | | -| try.js:3:12:3:16 | { ; } | try.js:1:1:5:29 | | -| try.js:3:14:3:14 | ; | try.js:1:1:5:29 | | -| try.js:4:1:4:20 | try {} finally { ; } | try.js:1:1:5:29 | | -| try.js:4:5:4:6 | {} | try.js:1:1:5:29 | | -| try.js:4:16:4:20 | { ; } | try.js:1:1:5:29 | | -| try.js:4:18:4:18 | ; | try.js:1:1:5:29 | | -| try.js:5:1:5:29 | try {} ... ally {} | try.js:1:1:5:29 | | -| try.js:5:5:5:6 | {} | try.js:1:1:5:29 | | -| try.js:5:8:5:18 | catch(x) {} | try.js:1:1:5:29 | | -| try.js:5:17:5:18 | {} | try.js:1:1:5:29 | | -| try.js:5:28:5:29 | {} | try.js:1:1:5:29 | | diff --git a/javascript/ql/test/library-tests/stmts/Containers.ql b/javascript/ql/test/library-tests/stmts/Containers.ql deleted file mode 100644 index 453886dbe58a..000000000000 --- a/javascript/ql/test/library-tests/stmts/Containers.ql +++ /dev/null @@ -1,4 +0,0 @@ -import javascript - -from Stmt s -select s, s.getContainer() diff --git a/javascript/ql/test/library-tests/stmts/Containers.qll b/javascript/ql/test/library-tests/stmts/Containers.qll new file mode 100644 index 000000000000..8121091b75b3 --- /dev/null +++ b/javascript/ql/test/library-tests/stmts/Containers.qll @@ -0,0 +1,3 @@ +import javascript + +query predicate test_Containers(Stmt s, StmtContainer res) { res = s.getContainer() } diff --git a/javascript/ql/test/library-tests/stmts/DoubleColonMethods.expected b/javascript/ql/test/library-tests/stmts/DoubleColonMethods.expected deleted file mode 100644 index 397afcd229f3..000000000000 --- a/javascript/ql/test/library-tests/stmts/DoubleColonMethods.expected +++ /dev/null @@ -1 +0,0 @@ -| jscript.js:1:1:1:28 | functio ... ad() {} | jscript.js:1:10:1:15 | window | jscript.js:1:18:1:23 | onload | jscript.js:1:1:1:28 | functio ... ad() {} | diff --git a/javascript/ql/test/library-tests/stmts/DoubleColonMethods.ql b/javascript/ql/test/library-tests/stmts/DoubleColonMethods.ql deleted file mode 100644 index 07fd17fbfc0c..000000000000 --- a/javascript/ql/test/library-tests/stmts/DoubleColonMethods.ql +++ /dev/null @@ -1,5 +0,0 @@ -import javascript - -from ExprStmt e, Identifier interface, Identifier id, Function f -where e.isDoubleColonMethod(interface, id, f) -select e, interface, id, f diff --git a/javascript/ql/test/library-tests/stmts/DoubleColonMethods.qll b/javascript/ql/test/library-tests/stmts/DoubleColonMethods.qll new file mode 100644 index 000000000000..04ef8906194c --- /dev/null +++ b/javascript/ql/test/library-tests/stmts/DoubleColonMethods.qll @@ -0,0 +1,5 @@ +import javascript + +query predicate test_DoubleColonMethods(ExprStmt e, Identifier interface, Identifier id, Function f) { + e.isDoubleColonMethod(interface, id, f) +} diff --git a/javascript/ql/test/library-tests/stmts/EnclosingStmt.expected b/javascript/ql/test/library-tests/stmts/EnclosingStmt.expected deleted file mode 100644 index 8f6b2d73001c..000000000000 --- a/javascript/ql/test/library-tests/stmts/EnclosingStmt.expected +++ /dev/null @@ -1,127 +0,0 @@ -| conditionals.js:1:5:1:8 | true | conditionals.js:1:1:2:5 | if (tru ... t\\n ; | -| conditionals.js:3:5:3:5 | b | conditionals.js:3:1:6:5 | if (b)\\n ... e\\n ; | -| conditionals.js:7:9:7:9 | b | conditionals.js:7:1:12:1 | switch ... ault:\\n} | -| conditionals.js:8:6:8:7 | 23 | conditionals.js:8:1:8:8 | case 23: | -| conditionals.js:9:6:9:6 | c | conditionals.js:9:1:10:10 | case c:\\n break; | -| es2015.js:1:10:1:10 | x | es2015.js:1:6:1:10 | var x | -| es2015.js:1:10:1:10 | x | es2015.js:1:6:1:10 | var x | -| es2015.js:1:15:1:23 | [1, 2, 3] | es2015.js:1:1:2:16 | for (va ... log(x); | -| es2015.js:1:16:1:16 | 1 | es2015.js:1:1:2:16 | for (va ... log(x); | -| es2015.js:1:19:1:19 | 2 | es2015.js:1:1:2:16 | for (va ... log(x); | -| es2015.js:1:22:1:22 | 3 | es2015.js:1:1:2:16 | for (va ... log(x); | -| es2015.js:2:2:2:8 | console | es2015.js:2:2:2:16 | console.log(x); | -| es2015.js:2:2:2:12 | console.log | es2015.js:2:2:2:16 | console.log(x); | -| es2015.js:2:2:2:15 | console.log(x) | es2015.js:2:2:2:16 | console.log(x); | -| es2015.js:2:10:2:12 | log | es2015.js:2:2:2:16 | console.log(x); | -| es2015.js:2:14:2:14 | x | es2015.js:2:2:2:16 | console.log(x); | -| foreach.js:1:5:1:7 | sum | foreach.js:1:1:1:12 | var sum = 0; | -| foreach.js:1:5:1:11 | sum = 0 | foreach.js:1:1:1:12 | var sum = 0; | -| foreach.js:1:11:1:11 | 0 | foreach.js:1:1:1:12 | var sum = 0; | -| foreach.js:2:5:2:7 | obj | foreach.js:2:1:2:42 | var obj ... p3: 8}; | -| foreach.js:2:5:2:41 | obj = { ... op3: 8} | foreach.js:2:1:2:42 | var obj ... p3: 8}; | -| foreach.js:2:11:2:41 | {prop1: ... op3: 8} | foreach.js:2:1:2:42 | var obj ... p3: 8}; | -| foreach.js:2:12:2:16 | prop1 | foreach.js:2:1:2:42 | var obj ... p3: 8}; | -| foreach.js:2:19:2:19 | 5 | foreach.js:2:1:2:42 | var obj ... p3: 8}; | -| foreach.js:2:22:2:26 | prop2 | foreach.js:2:1:2:42 | var obj ... p3: 8}; | -| foreach.js:2:29:2:30 | 13 | foreach.js:2:1:2:42 | var obj ... p3: 8}; | -| foreach.js:2:33:2:37 | prop3 | foreach.js:2:1:2:42 | var obj ... p3: 8}; | -| foreach.js:2:40:2:40 | 8 | foreach.js:2:1:2:42 | var obj ... p3: 8}; | -| foreach.js:4:15:4:18 | item | foreach.js:4:11:4:18 | var item | -| foreach.js:4:15:4:18 | item | foreach.js:4:11:4:18 | var item | -| foreach.js:4:23:4:25 | obj | foreach.js:4:1:6:1 | for eac ... item;\\n} | -| foreach.js:5:3:5:5 | sum | foreach.js:5:3:5:14 | sum += item; | -| foreach.js:5:3:5:13 | sum += item | foreach.js:5:3:5:14 | sum += item; | -| foreach.js:5:10:5:13 | item | foreach.js:5:3:5:14 | sum += item; | -| foreach.js:8:1:8:7 | console | foreach.js:8:1:8:17 | console.log(sum); | -| foreach.js:8:1:8:11 | console.log | foreach.js:8:1:8:17 | console.log(sum); | -| foreach.js:8:1:8:16 | console.log(sum) | foreach.js:8:1:8:17 | console.log(sum); | -| foreach.js:8:9:8:11 | log | foreach.js:8:1:8:17 | console.log(sum); | -| foreach.js:8:13:8:15 | sum | foreach.js:8:1:8:17 | console.log(sum); | -| functions.js:2:12:2:12 | x | functions.js:2:5:2:15 | return x+y; | -| functions.js:2:12:2:14 | x+y | functions.js:2:5:2:15 | return x+y; | -| functions.js:2:14:2:14 | y | functions.js:2:5:2:15 | return x+y; | -| functions.js:7:1:7:1 | k | functions.js:7:1:9:1 | k = fun ... turn;\\n} | -| functions.js:7:1:9:1 | k = fun ... turn;\\n} | functions.js:7:1:9:1 | k = fun ... turn;\\n} | -| functions.js:7:5:9:1 | functio ... turn;\\n} | functions.js:7:1:9:1 | k = fun ... turn;\\n} | -| guardedCatch.js:3:3:3:3 | g | guardedCatch.js:3:3:3:6 | g(); | -| guardedCatch.js:3:3:3:5 | g() | guardedCatch.js:3:3:3:6 | g(); | -| guardedCatch.js:4:11:4:11 | e | guardedCatch.js:4:4:6:2 | catch ( ... !");\\n\\t} | -| guardedCatch.js:4:16:4:16 | e | guardedCatch.js:4:4:6:2 | catch ( ... !");\\n\\t} | -| guardedCatch.js:4:16:4:33 | e instanceof Error | guardedCatch.js:4:4:6:2 | catch ( ... !");\\n\\t} | -| guardedCatch.js:4:29:4:33 | Error | guardedCatch.js:4:4:6:2 | catch ( ... !");\\n\\t} | -| guardedCatch.js:5:3:5:9 | console | guardedCatch.js:5:3:5:24 | console ... ror!"); | -| guardedCatch.js:5:3:5:13 | console.log | guardedCatch.js:5:3:5:24 | console ... ror!"); | -| guardedCatch.js:5:3:5:23 | console ... rror!") | guardedCatch.js:5:3:5:24 | console ... ror!"); | -| guardedCatch.js:5:11:5:13 | log | guardedCatch.js:5:3:5:24 | console ... ror!"); | -| guardedCatch.js:5:15:5:22 | "error!" | guardedCatch.js:5:3:5:24 | console ... ror!"); | -| guardedCatch.js:6:11:6:11 | e | guardedCatch.js:6:4:8:2 | catch ( ... !");\\n\\t} | -| guardedCatch.js:7:3:7:9 | console | guardedCatch.js:7:3:7:33 | console ... lse!"); | -| guardedCatch.js:7:3:7:13 | console.log | guardedCatch.js:7:3:7:33 | console ... lse!"); | -| guardedCatch.js:7:3:7:32 | console ... else!") | guardedCatch.js:7:3:7:33 | console ... lse!"); | -| guardedCatch.js:7:11:7:13 | log | guardedCatch.js:7:3:7:33 | console ... lse!"); | -| guardedCatch.js:7:15:7:31 | "something else!" | guardedCatch.js:7:3:7:33 | console ... lse!"); | -| jscript.js:1:1:1:28 | functio ... ad() {} | jscript.js:1:1:1:28 | functio ... ad() {} | -| jscript.js:1:1:1:28 | functio ... ad() {} | jscript.js:1:1:1:28 | functio ... ad() {} | -| jscript.js:1:10:1:15 | window | jscript.js:1:1:1:28 | functio ... ad() {} | -| jscript.js:1:10:1:23 | window::onload | jscript.js:1:1:1:28 | functio ... ad() {} | -| jscript.js:1:18:1:23 | onload | jscript.js:1:1:1:28 | functio ... ad() {} | -| jscript.js:3:1:3:6 | window | jscript.js:3:1:3:36 | window. ... ad() {} | -| jscript.js:3:1:3:13 | window.onload | jscript.js:3:1:3:36 | window. ... ad() {} | -| jscript.js:3:1:3:36 | window. ... ad() {} | jscript.js:3:1:3:36 | window. ... ad() {} | -| jscript.js:3:8:3:13 | onload | jscript.js:3:1:3:36 | window. ... ad() {} | -| jscript.js:3:17:3:36 | function onload() {} | jscript.js:3:1:3:36 | window. ... ad() {} | -| legacyletstmt.js:1:6:1:6 | x | legacyletstmt.js:1:1:3:1 | let (x ... + y);\\n} | -| legacyletstmt.js:1:6:1:11 | x = 23 | legacyletstmt.js:1:1:3:1 | let (x ... + y);\\n} | -| legacyletstmt.js:1:10:1:11 | 23 | legacyletstmt.js:1:1:3:1 | let (x ... + y);\\n} | -| legacyletstmt.js:1:14:1:14 | y | legacyletstmt.js:1:1:3:1 | let (x ... + y);\\n} | -| legacyletstmt.js:1:14:1:19 | y = 19 | legacyletstmt.js:1:1:3:1 | let (x ... + y);\\n} | -| legacyletstmt.js:1:18:1:19 | 19 | legacyletstmt.js:1:1:3:1 | let (x ... + y);\\n} | -| legacyletstmt.js:2:3:2:9 | console | legacyletstmt.js:2:3:2:21 | console.log(x + y); | -| legacyletstmt.js:2:3:2:13 | console.log | legacyletstmt.js:2:3:2:21 | console.log(x + y); | -| legacyletstmt.js:2:3:2:20 | console.log(x + y) | legacyletstmt.js:2:3:2:21 | console.log(x + y); | -| legacyletstmt.js:2:11:2:13 | log | legacyletstmt.js:2:3:2:21 | console.log(x + y); | -| legacyletstmt.js:2:15:2:15 | x | legacyletstmt.js:2:3:2:21 | console.log(x + y); | -| legacyletstmt.js:2:15:2:19 | x + y | legacyletstmt.js:2:3:2:21 | console.log(x + y); | -| legacyletstmt.js:2:19:2:19 | y | legacyletstmt.js:2:3:2:21 | console.log(x + y); | -| loops.js:1:7:1:10 | true | loops.js:1:1:2:5 | while(t ... t\\n ; | -| loops.js:3:1:3:5 | outer | loops.js:3:1:11:1 | outer: ... inue;\\n} | -| loops.js:3:12:3:12 | a | loops.js:3:8:11:1 | for(a; ... inue;\\n} | -| loops.js:3:15:3:15 | b | loops.js:3:8:11:1 | for(a; ... inue;\\n} | -| loops.js:3:18:3:18 | c | loops.js:3:8:11:1 | for(a; ... inue;\\n} | -| loops.js:5:13:5:13 | d | loops.js:5:9:10:21 | if (d)\\n ... ntinue; | -| loops.js:6:22:6:26 | outer | loops.js:6:13:6:27 | continue outer; | -| loops.js:7:18:7:18 | e | loops.js:7:14:10:21 | if (e)\\n ... ntinue; | -| loops.js:8:19:8:23 | outer | loops.js:8:13:8:24 | break outer; | -| loops.js:15:9:15:9 | a | loops.js:13:1:15:11 | do {\\n ... ile(a); | -| loops.js:17:10:17:10 | i | loops.js:17:6:17:17 | var i=0,n=10 | -| loops.js:17:10:17:12 | i=0 | loops.js:17:6:17:17 | var i=0,n=10 | -| loops.js:17:12:17:12 | 0 | loops.js:17:6:17:17 | var i=0,n=10 | -| loops.js:17:14:17:14 | n | loops.js:17:6:17:17 | var i=0,n=10 | -| loops.js:17:14:17:17 | n=10 | loops.js:17:6:17:17 | var i=0,n=10 | -| loops.js:17:16:17:17 | 10 | loops.js:17:6:17:17 | var i=0,n=10 | -| loops.js:17:20:17:20 | i | loops.js:17:1:17:29 | for (va ... ; ++i); | -| loops.js:17:20:17:22 | i | +| conditionals.js:2:5:2:5 | ; | conditionals.js:1:1:12:1 | | +| conditionals.js:3:1:6:5 | if (b)\\n ... e\\n ; | conditionals.js:1:1:12:1 | | +| conditionals.js:4:5:4:5 | ; | conditionals.js:1:1:12:1 | | +| conditionals.js:6:5:6:5 | ; | conditionals.js:1:1:12:1 | | +| conditionals.js:7:1:12:1 | switch ... ault:\\n} | conditionals.js:1:1:12:1 | | +| conditionals.js:8:1:8:8 | case 23: | conditionals.js:1:1:12:1 | | +| conditionals.js:9:1:10:10 | case c:\\n break; | conditionals.js:1:1:12:1 | | +| conditionals.js:10:5:10:10 | break; | conditionals.js:1:1:12:1 | | +| conditionals.js:11:1:11:8 | default: | conditionals.js:1:1:12:1 | | +| es2015.js:1:1:2:16 | for (va ... log(x); | es2015.js:1:1:3:0 | | +| es2015.js:1:6:1:10 | var x | es2015.js:1:1:3:0 | | +| es2015.js:2:2:2:16 | console.log(x); | es2015.js:1:1:3:0 | | +| foreach.js:1:1:1:12 | var sum = 0; | foreach.js:1:1:11:0 | | +| foreach.js:2:1:2:42 | var obj ... p3: 8}; | foreach.js:1:1:11:0 | | +| foreach.js:4:1:6:1 | for eac ... item;\\n} | foreach.js:1:1:11:0 | | +| foreach.js:4:11:4:18 | var item | foreach.js:1:1:11:0 | | +| foreach.js:4:28:6:1 | {\\n sum += item;\\n} | foreach.js:1:1:11:0 | | +| foreach.js:5:3:5:14 | sum += item; | foreach.js:1:1:11:0 | | +| foreach.js:8:1:8:17 | console.log(sum); | foreach.js:1:1:11:0 | | +| functions.js:1:1:3:1 | functio ... x+y;\\n} | functions.js:1:1:9:1 | | +| functions.js:1:18:3:1 | { // se ... x+y;\\n} | functions.js:1:1:3:1 | functio ... x+y;\\n} | +| functions.js:2:5:2:15 | return x+y; | functions.js:1:1:3:1 | functio ... x+y;\\n} | +| functions.js:5:1:5:15 | function h() {} | functions.js:1:1:9:1 | | +| functions.js:5:14:5:15 | {} | functions.js:5:1:5:15 | function h() {} | +| functions.js:7:1:9:1 | k = fun ... turn;\\n} | functions.js:1:1:9:1 | | +| functions.js:7:16:9:1 | {\\n return;\\n} | functions.js:7:5:9:1 | functio ... turn;\\n} | +| functions.js:8:5:8:11 | return; | functions.js:7:5:9:1 | functio ... turn;\\n} | +| guardedCatch.js:1:1:9:1 | functio ... );\\n\\t}\\n} | guardedCatch.js:1:1:11:65 | | +| guardedCatch.js:1:15:9:1 | {\\n\\ttry ... );\\n\\t}\\n} | guardedCatch.js:1:1:9:1 | functio ... );\\n\\t}\\n} | +| guardedCatch.js:2:2:8:2 | try {\\n\\t ... !");\\n\\t} | guardedCatch.js:1:1:9:1 | functio ... );\\n\\t}\\n} | +| guardedCatch.js:2:6:4:2 | {\\n\\t\\tg();\\n\\t} | guardedCatch.js:1:1:9:1 | functio ... );\\n\\t}\\n} | +| guardedCatch.js:3:3:3:6 | g(); | guardedCatch.js:1:1:9:1 | functio ... );\\n\\t}\\n} | +| guardedCatch.js:4:4:6:2 | catch ( ... !");\\n\\t} | guardedCatch.js:1:1:9:1 | functio ... );\\n\\t}\\n} | +| guardedCatch.js:4:36:6:2 | {\\n\\t\\tcon ... !");\\n\\t} | guardedCatch.js:1:1:9:1 | functio ... );\\n\\t}\\n} | +| guardedCatch.js:5:3:5:24 | console ... ror!"); | guardedCatch.js:1:1:9:1 | functio ... );\\n\\t}\\n} | +| guardedCatch.js:6:4:8:2 | catch ( ... !");\\n\\t} | guardedCatch.js:1:1:9:1 | functio ... );\\n\\t}\\n} | +| guardedCatch.js:6:14:8:2 | {\\n\\t\\tcon ... !");\\n\\t} | guardedCatch.js:1:1:9:1 | functio ... );\\n\\t}\\n} | +| guardedCatch.js:7:3:7:33 | console ... lse!"); | guardedCatch.js:1:1:9:1 | functio ... );\\n\\t}\\n} | +| jscript.js:1:1:1:28 | functio ... ad() {} | jscript.js:1:1:5:65 | | +| jscript.js:1:27:1:28 | {} | jscript.js:1:1:1:28 | functio ... ad() {} | +| jscript.js:3:1:3:36 | window. ... ad() {} | jscript.js:1:1:5:65 | | +| jscript.js:3:35:3:36 | {} | jscript.js:3:17:3:36 | function onload() {} | +| legacyletstmt.js:1:1:3:1 | let (x ... + y);\\n} | legacyletstmt.js:1:1:5:65 | | +| legacyletstmt.js:1:22:3:1 | {\\n con ... + y);\\n} | legacyletstmt.js:1:1:5:65 | | +| legacyletstmt.js:2:3:2:21 | console.log(x + y); | legacyletstmt.js:1:1:5:65 | | +| loops.js:1:1:2:5 | while(t ... t\\n ; | loops.js:1:1:22:18 | | +| loops.js:2:5:2:5 | ; | loops.js:1:1:22:18 | | +| loops.js:3:1:11:1 | outer: ... inue;\\n} | loops.js:1:1:22:18 | | +| loops.js:3:8:11:1 | for(a; ... inue;\\n} | loops.js:1:1:22:18 | | +| loops.js:3:21:11:1 | {\\n f ... inue;\\n} | loops.js:1:1:22:18 | | +| loops.js:4:5:10:21 | for(;;) ... ntinue; | loops.js:1:1:22:18 | | +| loops.js:5:9:10:21 | if (d)\\n ... ntinue; | loops.js:1:1:22:18 | | +| loops.js:6:13:6:27 | continue outer; | loops.js:1:1:22:18 | | +| loops.js:7:14:10:21 | if (e)\\n ... ntinue; | loops.js:1:1:22:18 | | +| loops.js:8:13:8:24 | break outer; | loops.js:1:1:22:18 | | +| loops.js:10:13:10:21 | continue; | loops.js:1:1:22:18 | | +| loops.js:13:1:15:11 | do {\\n ... ile(a); | loops.js:1:1:22:18 | | +| loops.js:13:4:15:1 | {\\n ;\\n} | loops.js:1:1:22:18 | | +| loops.js:14:5:14:5 | ; | loops.js:1:1:22:18 | | +| loops.js:17:1:17:29 | for (va ... ; ++i); | loops.js:1:1:22:18 | | +| loops.js:17:6:17:17 | var i=0,n=10 | loops.js:1:1:22:18 | | +| loops.js:17:29:17:29 | ; | loops.js:1:1:22:18 | | +| loops.js:19:1:19:18 | for (var x in xs); | loops.js:1:1:22:18 | | +| loops.js:19:6:19:10 | var x | loops.js:1:1:22:18 | | +| loops.js:19:18:19:18 | ; | loops.js:1:1:22:18 | | +| loops.js:20:1:20:14 | for (x in xs); | loops.js:1:1:22:18 | | +| loops.js:20:14:20:14 | ; | loops.js:1:1:22:18 | | +| loops.js:21:1:21:16 | for (x.f in xs); | loops.js:1:1:22:18 | | +| loops.js:21:16:21:16 | ; | loops.js:1:1:22:18 | | +| loops.js:22:1:22:18 | for (x = 0 in xs); | loops.js:1:1:22:18 | | +| loops.js:22:18:22:18 | ; | loops.js:1:1:22:18 | | +| others.js:1:1:2:1 | with(a) ... -text\\n} | others.js:1:1:4:14 | | +| others.js:1:9:2:1 | { // se ... -text\\n} | others.js:1:1:4:14 | | +| others.js:3:1:3:9 | debugger; | others.js:1:1:4:14 | | +| others.js:4:1:4:14 | var x = 23, y; | others.js:1:1:4:14 | | +| try.js:1:1:3:16 | try { / ... ) { ; } | try.js:1:1:5:29 | | +| try.js:1:5:3:1 | { // se ... "!";\\n} | try.js:1:1:5:29 | | +| try.js:2:5:2:14 | throw "!"; | try.js:1:1:5:29 | | +| try.js:3:3:3:16 | catch(x) { ; } | try.js:1:1:5:29 | | +| try.js:3:12:3:16 | { ; } | try.js:1:1:5:29 | | +| try.js:3:14:3:14 | ; | try.js:1:1:5:29 | | +| try.js:4:1:4:20 | try {} finally { ; } | try.js:1:1:5:29 | | +| try.js:4:5:4:6 | {} | try.js:1:1:5:29 | | +| try.js:4:16:4:20 | { ; } | try.js:1:1:5:29 | | +| try.js:4:18:4:18 | ; | try.js:1:1:5:29 | | +| try.js:5:1:5:29 | try {} ... ally {} | try.js:1:1:5:29 | | +| try.js:5:5:5:6 | {} | try.js:1:1:5:29 | | +| try.js:5:8:5:18 | catch(x) {} | try.js:1:1:5:29 | | +| try.js:5:17:5:18 | {} | try.js:1:1:5:29 | | +| try.js:5:28:5:29 | {} | try.js:1:1:5:29 | | +test_JumpTargets +| conditionals.js:10:5:10:10 | break; | (none) | conditionals.js:7:1:12:1 | switch ... ault:\\n} | +| loops.js:6:13:6:27 | continue outer; | outer | loops.js:3:1:11:1 | outer: ... inue;\\n} | +| loops.js:8:13:8:24 | break outer; | outer | loops.js:3:1:11:1 | outer: ... inue;\\n} | +| loops.js:10:13:10:21 | continue; | (none) | loops.js:4:5:10:21 | for(;;) ... ntinue; | +test_EnhancedForDefault +| loops.js:22:1:22:18 | for (x = 0 in xs); | loops.js:22:10:22:10 | 0 | diff --git a/javascript/ql/test/library-tests/stmts/tests.ql b/javascript/ql/test/library-tests/stmts/tests.ql new file mode 100644 index 000000000000..1d31045bc4cf --- /dev/null +++ b/javascript/ql/test/library-tests/stmts/tests.ql @@ -0,0 +1,10 @@ +import LetStmt +import LineTerminators +import EnclosingStmt +import NumCatchClauses +import DoubleColonMethods +import SemicolonInsertion +import getGuard +import Containers +import JumpTargets +import EnhancedForDefault diff --git a/javascript/ql/test/tutorials/Introducing the JavaScript libraries/query1.expected b/javascript/ql/test/tutorials/Introducing the JavaScript libraries/query1.expected deleted file mode 100644 index 11cecfe39109..000000000000 --- a/javascript/ql/test/tutorials/Introducing the JavaScript libraries/query1.expected +++ /dev/null @@ -1 +0,0 @@ -| | 2 | diff --git a/javascript/ql/test/tutorials/Introducing the JavaScript libraries/query1.ql b/javascript/ql/test/tutorials/Introducing the JavaScript libraries/query1.ql deleted file mode 100644 index 36e8e35776aa..000000000000 --- a/javascript/ql/test/tutorials/Introducing the JavaScript libraries/query1.ql +++ /dev/null @@ -1,4 +0,0 @@ -import javascript - -from Folder d -select d.getRelativePath(), count(File f | f = d.getAFile() and f.getExtension() = "js") diff --git a/javascript/ql/test/tutorials/Introducing the JavaScript libraries/query1.qll b/javascript/ql/test/tutorials/Introducing the JavaScript libraries/query1.qll new file mode 100644 index 000000000000..e362b41335ec --- /dev/null +++ b/javascript/ql/test/tutorials/Introducing the JavaScript libraries/query1.qll @@ -0,0 +1,8 @@ +import javascript + +query predicate test_query1(string res0, int res1) { + exists(Folder d | + res0 = d.getRelativePath() and + res1 = count(File f | f = d.getAFile() and f.getExtension() = "js" | f) + ) +} diff --git a/javascript/ql/test/tutorials/Introducing the JavaScript libraries/query10.expected b/javascript/ql/test/tutorials/Introducing the JavaScript libraries/query10.expected deleted file mode 100644 index 3191d73d277a..000000000000 --- a/javascript/ql/test/tutorials/Introducing the JavaScript libraries/query10.expected +++ /dev/null @@ -1 +0,0 @@ -| tst.js:31:1:33:1 | functio ... ++i);\\n} | This function uses i like a local variable. | diff --git a/javascript/ql/test/tutorials/Introducing the JavaScript libraries/query10.ql b/javascript/ql/test/tutorials/Introducing the JavaScript libraries/query10.ql deleted file mode 100644 index a5abb7fa043e..000000000000 --- a/javascript/ql/test/tutorials/Introducing the JavaScript libraries/query10.ql +++ /dev/null @@ -1,7 +0,0 @@ -import javascript - -from Function f, GlobalVariable gv -where - gv.getAnAccess().getEnclosingFunction() = f and - not f.getStartBB().isLiveAtEntry(gv, _) -select f, "This function uses " + gv + " like a local variable." diff --git a/javascript/ql/test/tutorials/Introducing the JavaScript libraries/query10.qll b/javascript/ql/test/tutorials/Introducing the JavaScript libraries/query10.qll new file mode 100644 index 000000000000..d59a7b83a5a4 --- /dev/null +++ b/javascript/ql/test/tutorials/Introducing the JavaScript libraries/query10.qll @@ -0,0 +1,9 @@ +import javascript + +query predicate test_query10(Function f, string res) { + exists(GlobalVariable gv | + gv.getAnAccess().getEnclosingFunction() = f and not f.getStartBB().isLiveAtEntry(gv, _) + | + res = "This function uses " + gv.toString() + " like a local variable." + ) +} diff --git a/javascript/ql/test/tutorials/Introducing the JavaScript libraries/query11.expected b/javascript/ql/test/tutorials/Introducing the JavaScript libraries/query11.expected deleted file mode 100644 index e7d0fe1d5f73..000000000000 --- a/javascript/ql/test/tutorials/Introducing the JavaScript libraries/query11.expected +++ /dev/null @@ -1,4 +0,0 @@ -| tst.js:21:12:21:12 | x | Dead store of local variable. | -| tst.js:31:12:31:12 | x | Dead store of local variable. | -| tst.js:31:15:31:15 | y | Dead store of local variable. | -| tst.js:31:18:31:18 | x | Dead store of local variable. | diff --git a/javascript/ql/test/tutorials/Introducing the JavaScript libraries/query11.ql b/javascript/ql/test/tutorials/Introducing the JavaScript libraries/query11.ql deleted file mode 100644 index e53688bff152..000000000000 --- a/javascript/ql/test/tutorials/Introducing the JavaScript libraries/query11.ql +++ /dev/null @@ -1,7 +0,0 @@ -import javascript - -from VarDef def, LocalVariable v -where - v = def.getAVariable() and - not exists(VarUse use | def = use.getADef()) -select def, "Dead store of local variable." diff --git a/javascript/ql/test/tutorials/Introducing the JavaScript libraries/query11.qll b/javascript/ql/test/tutorials/Introducing the JavaScript libraries/query11.qll new file mode 100644 index 000000000000..b4beb37d05bc --- /dev/null +++ b/javascript/ql/test/tutorials/Introducing the JavaScript libraries/query11.qll @@ -0,0 +1,7 @@ +import javascript + +query predicate test_query11(VarDef def, string res) { + exists(LocalVariable v | v = def.getAVariable() and not exists(VarUse use | def = use.getADef()) | + res = "Dead store of local variable." + ) +} diff --git a/javascript/ql/test/tutorials/Introducing the JavaScript libraries/query12.expected b/javascript/ql/test/tutorials/Introducing the JavaScript libraries/query12.expected deleted file mode 100644 index e69de29bb2d1..000000000000 diff --git a/javascript/ql/test/tutorials/Introducing the JavaScript libraries/query12.ql b/javascript/ql/test/tutorials/Introducing the JavaScript libraries/query12.ql deleted file mode 100644 index 7009589deca6..000000000000 --- a/javascript/ql/test/tutorials/Introducing the JavaScript libraries/query12.ql +++ /dev/null @@ -1,9 +0,0 @@ -import javascript - -from SimpleParameter res, DataFlow::Node resNode, MethodCallExpr send -where - res.getName() = "res" and - resNode = DataFlow::parameterNode(res) and - resNode.getASuccessor+() = DataFlow::valueNode(send.getReceiver()) and - send.getMethodName() = "send" -select send diff --git a/javascript/ql/test/tutorials/Introducing the JavaScript libraries/query12.qll b/javascript/ql/test/tutorials/Introducing the JavaScript libraries/query12.qll new file mode 100644 index 000000000000..7f99c4e36749 --- /dev/null +++ b/javascript/ql/test/tutorials/Introducing the JavaScript libraries/query12.qll @@ -0,0 +1,12 @@ +import javascript + +query predicate test_query12(MethodCallExpr send) { + exists(SimpleParameter res, DataFlow::Node resNode | + res.getName() = "res" and + resNode = DataFlow::parameterNode(res) and + resNode.getASuccessor() = DataFlow::valueNode(send.getReceiver()) and + send.getMethodName() = "send" + | + any() + ) +} diff --git a/javascript/ql/test/tutorials/Introducing the JavaScript libraries/query13.expected b/javascript/ql/test/tutorials/Introducing the JavaScript libraries/query13.expected deleted file mode 100644 index e69de29bb2d1..000000000000 diff --git a/javascript/ql/test/tutorials/Introducing the JavaScript libraries/query13.ql b/javascript/ql/test/tutorials/Introducing the JavaScript libraries/query13.ql deleted file mode 100644 index 4acd827f4aa6..000000000000 --- a/javascript/ql/test/tutorials/Introducing the JavaScript libraries/query13.ql +++ /dev/null @@ -1,8 +0,0 @@ -import javascript - -from StrictEqualityTest eq, DataFlow::AnalyzedNode nd, NullLiteral null -where - eq.hasOperands(nd.asExpr(), null) and - not nd.getAValue().isIndefinite(_) and - not nd.getAValue() instanceof AbstractNull -select eq, "Spurious null check." diff --git a/javascript/ql/test/tutorials/Introducing the JavaScript libraries/query13.qll b/javascript/ql/test/tutorials/Introducing the JavaScript libraries/query13.qll new file mode 100644 index 000000000000..3746d064cdfb --- /dev/null +++ b/javascript/ql/test/tutorials/Introducing the JavaScript libraries/query13.qll @@ -0,0 +1,11 @@ +import javascript + +query predicate test_query13(StrictEqualityTest eq, string res) { + exists(DataFlow::AnalyzedNode nd, NullLiteral null | + eq.hasOperands(nd.asExpr(), null) and + not nd.getAValue().isIndefinite(_) and + not nd.getAValue() instanceof AbstractNull + | + res = "Spurious null check." + ) +} diff --git a/javascript/ql/test/tutorials/Introducing the JavaScript libraries/query14.expected b/javascript/ql/test/tutorials/Introducing the JavaScript libraries/query14.expected deleted file mode 100644 index 4e443a47efad..000000000000 --- a/javascript/ql/test/tutorials/Introducing the JavaScript libraries/query14.expected +++ /dev/null @@ -1 +0,0 @@ -| tst.js:9:1:9:3 | h() | Unable to find a callee for this call site. | diff --git a/javascript/ql/test/tutorials/Introducing the JavaScript libraries/query14.ql b/javascript/ql/test/tutorials/Introducing the JavaScript libraries/query14.ql deleted file mode 100644 index 8b8b36935294..000000000000 --- a/javascript/ql/test/tutorials/Introducing the JavaScript libraries/query14.ql +++ /dev/null @@ -1,7 +0,0 @@ -import javascript - -from DataFlow::InvokeNode cs -where - not cs.isIncomplete() and - not exists(cs.getACallee()) -select cs, "Unable to find a callee for this call site." diff --git a/javascript/ql/test/tutorials/Introducing the JavaScript libraries/query14.qll b/javascript/ql/test/tutorials/Introducing the JavaScript libraries/query14.qll new file mode 100644 index 000000000000..83ee2eb5ace6 --- /dev/null +++ b/javascript/ql/test/tutorials/Introducing the JavaScript libraries/query14.qll @@ -0,0 +1,7 @@ +import javascript + +query predicate test_query14(DataFlow::InvokeNode cs, string res) { + not cs.isIncomplete() and + not exists(cs.getACallee()) and + res = "Unable to find a callee for this call site." +} diff --git a/javascript/ql/test/tutorials/Introducing the JavaScript libraries/query15.expected b/javascript/ql/test/tutorials/Introducing the JavaScript libraries/query15.expected deleted file mode 100644 index e69de29bb2d1..000000000000 diff --git a/javascript/ql/test/tutorials/Introducing the JavaScript libraries/query15.ql b/javascript/ql/test/tutorials/Introducing the JavaScript libraries/query15.ql deleted file mode 100644 index 17b472b39fed..000000000000 --- a/javascript/ql/test/tutorials/Introducing the JavaScript libraries/query15.ql +++ /dev/null @@ -1,12 +0,0 @@ -import javascript - -class TrackedStringLiteral extends DataFlow::TrackedNode { - TrackedStringLiteral() { this.asExpr() instanceof ConstantString } -} - -from TrackedStringLiteral source, DataFlow::Node sink, SsaExplicitDefinition def -where - source.flowsTo(sink) and - sink = DataFlow::ssaDefinitionNode(def) and - def.getSourceVariable().getName().toLowerCase() = "password" -select sink diff --git a/javascript/ql/test/tutorials/Introducing the JavaScript libraries/query15.qll b/javascript/ql/test/tutorials/Introducing the JavaScript libraries/query15.qll new file mode 100644 index 000000000000..e76a54e172f3 --- /dev/null +++ b/javascript/ql/test/tutorials/Introducing the JavaScript libraries/query15.qll @@ -0,0 +1,15 @@ +import javascript + +class TrackedStringLiteral extends DataFlow::TrackedNode { + TrackedStringLiteral() { this.asExpr() instanceof ConstantString } +} + +query predicate test_query15(DataFlow::Node sink) { + exists(TrackedStringLiteral source, SsaExplicitDefinition def | + source.flowsTo(sink) and + sink = DataFlow::ssaDefinitionNode(def) and + def.getSourceVariable().getName().toLowerCase() = "password" + | + any() + ) +} diff --git a/javascript/ql/test/tutorials/Introducing the JavaScript libraries/query17.expected b/javascript/ql/test/tutorials/Introducing the JavaScript libraries/query17.expected deleted file mode 100644 index e69de29bb2d1..000000000000 diff --git a/javascript/ql/test/tutorials/Introducing the JavaScript libraries/query17.ql b/javascript/ql/test/tutorials/Introducing the JavaScript libraries/query17.ql deleted file mode 100644 index dca597f0b0e0..000000000000 --- a/javascript/ql/test/tutorials/Introducing the JavaScript libraries/query17.ql +++ /dev/null @@ -1,24 +0,0 @@ -import javascript - -class PasswordTracker extends DataFlow::Configuration { - PasswordTracker() { - // unique identifier for this configuration - this = "PasswordTracker" - } - - override predicate isSource(DataFlow::Node nd) { nd.asExpr() instanceof StringLiteral } - - override predicate isSink(DataFlow::Node nd) { passwordVarAssign(_, nd) } - - predicate passwordVarAssign(Variable v, DataFlow::Node nd) { - exists(SsaExplicitDefinition def | - nd = DataFlow::ssaDefinitionNode(def) and - def.getSourceVariable() = v and - v.getName().toLowerCase() = "password" - ) - } -} - -from PasswordTracker pt, DataFlow::Node source, DataFlow::Node sink, Variable v -where pt.hasFlow(source, sink) and pt.passwordVarAssign(v, sink) -select sink, "Password variable " + v + " is assigned a constant string." diff --git a/javascript/ql/test/tutorials/Introducing the JavaScript libraries/query17.qll b/javascript/ql/test/tutorials/Introducing the JavaScript libraries/query17.qll new file mode 100644 index 000000000000..20dbda43ddca --- /dev/null +++ b/javascript/ql/test/tutorials/Introducing the JavaScript libraries/query17.qll @@ -0,0 +1,28 @@ +import javascript + +class PasswordTracker extends DataFlow::Configuration { + PasswordTracker() { + // unique identifier for this configuration + this = "PasswordTracker" + } + + override predicate isSource(DataFlow::Node nd) { nd.asExpr() instanceof StringLiteral } + + override predicate isSink(DataFlow::Node nd) { passwordVarAssign(_, nd) } + + predicate passwordVarAssign(Variable v, DataFlow::Node nd) { + exists(SsaExplicitDefinition def | + nd = DataFlow::ssaDefinitionNode(def) and + def.getSourceVariable() = v and + v.getName().toLowerCase() = "password" + ) + } +} + +query predicate test_query17(DataFlow::Node sink, string res) { + exists(PasswordTracker pt, DataFlow::Node source, Variable v | + pt.hasFlow(source, sink) and pt.passwordVarAssign(v, sink) + | + res = "Password variable " + v.toString() + " is assigned a constant string." + ) +} diff --git a/javascript/ql/test/tutorials/Introducing the JavaScript libraries/query18.expected b/javascript/ql/test/tutorials/Introducing the JavaScript libraries/query18.expected deleted file mode 100644 index fea2486377b7..000000000000 --- a/javascript/ql/test/tutorials/Introducing the JavaScript libraries/query18.expected +++ /dev/null @@ -1 +0,0 @@ -| m.js:1:1:3:0 | | 0 | diff --git a/javascript/ql/test/tutorials/Introducing the JavaScript libraries/query18.ql b/javascript/ql/test/tutorials/Introducing the JavaScript libraries/query18.ql deleted file mode 100644 index 402345cbe045..000000000000 --- a/javascript/ql/test/tutorials/Introducing the JavaScript libraries/query18.ql +++ /dev/null @@ -1,4 +0,0 @@ -import javascript - -from NodeModule m -select m, count(m.getAnImportedModule()) diff --git a/javascript/ql/test/tutorials/Introducing the JavaScript libraries/query18.qll b/javascript/ql/test/tutorials/Introducing the JavaScript libraries/query18.qll new file mode 100644 index 000000000000..571362ca6cb3 --- /dev/null +++ b/javascript/ql/test/tutorials/Introducing the JavaScript libraries/query18.qll @@ -0,0 +1,3 @@ +import javascript + +query predicate test_query18(NodeModule m, int res) { res = count(m.getAnImportedModule()) } diff --git a/javascript/ql/test/tutorials/Introducing the JavaScript libraries/query19.expected b/javascript/ql/test/tutorials/Introducing the JavaScript libraries/query19.expected deleted file mode 100644 index e69de29bb2d1..000000000000 diff --git a/javascript/ql/test/tutorials/Introducing the JavaScript libraries/query19.ql b/javascript/ql/test/tutorials/Introducing the JavaScript libraries/query19.ql deleted file mode 100644 index f77cbcb044b4..000000000000 --- a/javascript/ql/test/tutorials/Introducing the JavaScript libraries/query19.ql +++ /dev/null @@ -1,10 +0,0 @@ -import javascript - -from NPMPackage pkg, PackageDependencies deps, string name -where - deps = pkg.getPackageJSON().getDependencies() and - deps.getADependency(name, _) and - not exists(Require req | req.getTopLevel() = pkg.getAModule() | - name = req.getImportedPath().getValue() - ) -select deps, "Unused dependency '" + name + "'." diff --git a/javascript/ql/test/tutorials/Introducing the JavaScript libraries/query19.qll b/javascript/ql/test/tutorials/Introducing the JavaScript libraries/query19.qll new file mode 100644 index 000000000000..6412643f11a6 --- /dev/null +++ b/javascript/ql/test/tutorials/Introducing the JavaScript libraries/query19.qll @@ -0,0 +1,13 @@ +import javascript + +query predicate test_query19(PackageDependencies deps, string res) { + exists(NPMPackage pkg, string name | + deps = pkg.getPackageJSON().getDependencies() and + deps.getADependency(name, _) and + not exists(Require req | req.getTopLevel() = pkg.getAModule() | + name = req.getImportedPath().getValue() + ) + | + res = "Unused dependency '" + name + "'." + ) +} diff --git a/javascript/ql/test/tutorials/Introducing the JavaScript libraries/query2.expected b/javascript/ql/test/tutorials/Introducing the JavaScript libraries/query2.expected deleted file mode 100644 index ae1067b8f4dd..000000000000 --- a/javascript/ql/test/tutorials/Introducing the JavaScript libraries/query2.expected +++ /dev/null @@ -1 +0,0 @@ -| tst.js:25:3:25:3 | , | Omitted array elements are bad style. | diff --git a/javascript/ql/test/tutorials/Introducing the JavaScript libraries/query2.ql b/javascript/ql/test/tutorials/Introducing the JavaScript libraries/query2.ql deleted file mode 100644 index c62032ba8f3c..000000000000 --- a/javascript/ql/test/tutorials/Introducing the JavaScript libraries/query2.ql +++ /dev/null @@ -1,9 +0,0 @@ -import javascript - -class CommaToken extends PunctuatorToken { - CommaToken() { getValue() = "," } -} - -from CommaToken comma -where comma.getNextToken() instanceof CommaToken -select comma, "Omitted array elements are bad style." diff --git a/javascript/ql/test/tutorials/Introducing the JavaScript libraries/query2.qll b/javascript/ql/test/tutorials/Introducing the JavaScript libraries/query2.qll new file mode 100644 index 000000000000..d33028397851 --- /dev/null +++ b/javascript/ql/test/tutorials/Introducing the JavaScript libraries/query2.qll @@ -0,0 +1,9 @@ +import javascript + +class CommaToken extends PunctuatorToken { + CommaToken() { getValue() = "," } +} + +query predicate test_query2(CommaToken comma, string res) { + comma.getNextToken() instanceof CommaToken and res = "Omitted array elements are bad style." +} diff --git a/javascript/ql/test/tutorials/Introducing the JavaScript libraries/query20.expected b/javascript/ql/test/tutorials/Introducing the JavaScript libraries/query20.expected deleted file mode 100644 index e69de29bb2d1..000000000000 diff --git a/javascript/ql/test/tutorials/Introducing the JavaScript libraries/query20.ql b/javascript/ql/test/tutorials/Introducing the JavaScript libraries/query20.ql deleted file mode 100644 index 27028aa20514..000000000000 --- a/javascript/ql/test/tutorials/Introducing the JavaScript libraries/query20.ql +++ /dev/null @@ -1,5 +0,0 @@ -import javascript - -from SQL::SqlString ss -where ss instanceof AddExpr -select ss, "Use templating instead of string concatenation." diff --git a/javascript/ql/test/tutorials/Introducing the JavaScript libraries/query20.qll b/javascript/ql/test/tutorials/Introducing the JavaScript libraries/query20.qll new file mode 100644 index 000000000000..86c7ab712c5a --- /dev/null +++ b/javascript/ql/test/tutorials/Introducing the JavaScript libraries/query20.qll @@ -0,0 +1,5 @@ +import javascript + +query predicate test_query20(SQL::SqlString ss, string res) { + ss instanceof AddExpr and res = "Use templating instead of string concatenation." +} diff --git a/javascript/ql/test/tutorials/Introducing the JavaScript libraries/query21.expected b/javascript/ql/test/tutorials/Introducing the JavaScript libraries/query21.expected deleted file mode 100644 index faee4f361fd6..000000000000 --- a/javascript/ql/test/tutorials/Introducing the JavaScript libraries/query21.expected +++ /dev/null @@ -1 +0,0 @@ -| tst.js:19:4:19:9 | @param | @param tag is missing name. | diff --git a/javascript/ql/test/tutorials/Introducing the JavaScript libraries/query21.ql b/javascript/ql/test/tutorials/Introducing the JavaScript libraries/query21.ql deleted file mode 100644 index 5bc3e3ead687..000000000000 --- a/javascript/ql/test/tutorials/Introducing the JavaScript libraries/query21.ql +++ /dev/null @@ -1,7 +0,0 @@ -import javascript - -from JSDocTag t -where - t.getTitle() = "param" and - not exists(t.getName()) -select t, "@param tag is missing name." diff --git a/javascript/ql/test/tutorials/Introducing the JavaScript libraries/query21.qll b/javascript/ql/test/tutorials/Introducing the JavaScript libraries/query21.qll new file mode 100644 index 000000000000..1fa77e409daa --- /dev/null +++ b/javascript/ql/test/tutorials/Introducing the JavaScript libraries/query21.qll @@ -0,0 +1,5 @@ +import javascript + +query predicate test_query21(JSDocTag t, string res) { + t.getTitle() = "param" and not exists(t.getName()) and res = "@param tag is missing name." +} diff --git a/javascript/ql/test/tutorials/Introducing the JavaScript libraries/query3.expected b/javascript/ql/test/tutorials/Introducing the JavaScript libraries/query3.expected deleted file mode 100644 index 3910e24c8d9d..000000000000 --- a/javascript/ql/test/tutorials/Introducing the JavaScript libraries/query3.expected +++ /dev/null @@ -1 +0,0 @@ -| tst.js:27:1:27:4 |