JavaScript: Consolidate Functions tests.

This commit is contained in:
Max Schaefer
2019-03-01 15:48:20 +00:00
parent 40502c68a5
commit 89ad16be4b
50 changed files with 236 additions and 226 deletions

View File

@@ -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]; } |

View File

@@ -1,4 +0,0 @@
import javascript
from Function f
select f

View File

@@ -0,0 +1,3 @@
import javascript
query predicate test_Function(Function f) { any() }

View File

@@ -1 +0,0 @@
| tst.js:14:1:14:37 | functio ... s[0]; } | tst.js:14:16:14:35 | return arguments[0]; |

View File

@@ -1,4 +0,0 @@
import javascript
from Function f
select f, f.getAReturnStmt()

View File

@@ -0,0 +1,3 @@
import javascript
query predicate test_ReturnStmt(Function f, ReturnStmt res) { res = f.getAReturnStmt() }

View File

@@ -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] |

View File

@@ -1,4 +0,0 @@
import javascript
from Function f
select f, f.getAReturnedExpr()

View File

@@ -0,0 +1,3 @@
import javascript
query predicate test_ReturnedExpression(Function f, Expr res) { res = f.getAReturnedExpr() }

View File

@@ -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]; } |

View File

@@ -1,5 +0,0 @@
import javascript
from Function f
where exists(f.getArgumentsVariable())
select f

View File

@@ -0,0 +1,3 @@
import javascript
query predicate test_getArgumentsVariable(Function f) { exists(f.getArgumentsVariable()) }

View File

@@ -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]; } |

View File

@@ -1,4 +0,0 @@
import javascript
from Function f
select f, f.getBody()

View File

@@ -0,0 +1,3 @@
import javascript
query predicate test_getBody(Function f, ExprOrStmt res) { res = f.getBody() }

View File

@@ -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]; |

View File

@@ -1,4 +0,0 @@
import javascript
from Function f, int i
select f, i, f.getBodyStmt(i)

View File

@@ -0,0 +1,3 @@
import javascript
query predicate test_getBodyStmt(Function f, int i, Stmt res) { res = f.getBodyStmt(i) }

View File

@@ -1 +0,0 @@
| defaultargs.js:1:15:1:15 | y | defaultargs.js:1:17:1:20 | x+19 |

View File

@@ -1,4 +0,0 @@
import javascript
from Parameter p
select p, p.getDefault()

View File

@@ -0,0 +1,3 @@
import javascript
query predicate test_getDefaultArguments(Parameter p, Expr res) { res = p.getDefault() }

View File

@@ -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]; } |

View File

@@ -1,4 +0,0 @@
import javascript
from Function f
select f, f.getEnclosingStmt()

View File

@@ -0,0 +1,3 @@
import javascript
query predicate test_getEnclosingStmt(Function f, Stmt res) { res = f.getEnclosingStmt() }

View File

@@ -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 |

View File

@@ -1,4 +0,0 @@
import javascript
from Function f
select f, f.getId(), f.getName()

View File

@@ -0,0 +1,5 @@
import javascript
query predicate test_getId(Function f, VarDecl res0, string res1) {
res0 = f.getId() and res1 = f.getName()
}

View File

@@ -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 |

View File

@@ -1,5 +0,0 @@
import javascript
from Function f, int i, Parameter p
where p = f.getParameter(i)
select f, i, p

View File

@@ -0,0 +1,3 @@
import javascript
query predicate test_getParameter(Function f, int i, Parameter p) { p = f.getParameter(i) }

View File

@@ -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]; } |

View File

@@ -1,5 +0,0 @@
import javascript
from Function f
where exists(f.getScope())
select f

View File

@@ -0,0 +1,3 @@
import javascript
query predicate test_getScope(Function f) { exists(f.getScope()) }

View File

@@ -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]; } |

View File

@@ -1,5 +0,0 @@
import javascript
from Function f
where exists(f.getVariable())
select f

View File

@@ -0,0 +1,3 @@
import javascript
query predicate test_getVariable(Function f) { exists(f.getVariable()) }

View File

@@ -1 +0,0 @@
| restparms.js:1:1:2:1 | functio ... ys) {\\n} |

View File

@@ -1,5 +0,0 @@
import javascript
from Function f
where f.hasRestParameter()
select f

View File

@@ -0,0 +1,3 @@
import javascript
query predicate test_hasRestParameter(Function f) { f.hasRestParameter() }

View File

@@ -1,2 +0,0 @@
| generators.js:1:1:4:1 | functio ... i++;\\n} |
| generators.js:6:2:6:19 | function* bar() {} |

View File

@@ -1,5 +0,0 @@
import javascript
from Function f
where f.isGenerator()
select f

View File

@@ -0,0 +1,3 @@
import javascript
query predicate test_isGenerator(Function f) { f.isGenerator() }

View File

@@ -1 +0,0 @@
| restparms.js:1:18:1:19 | ys |

View File

@@ -1,5 +0,0 @@
import javascript
from Parameter p
where p.isRestParameter()
select p

View File

@@ -0,0 +1,3 @@
import javascript
query predicate test_isRestParameter(Parameter p) { p.isRestParameter() }

View File

@@ -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]; |

View File

@@ -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

View File

@@ -1 +0,0 @@
| tst.js:14:1:14:37 | functio ... s[0]; } |

View File

@@ -1,5 +0,0 @@
import javascript
from Function f
where f.usesArgumentsObject()
select f

View File

@@ -0,0 +1,3 @@
import javascript
query predicate test_usesArgumentsObject(Function f) { f.usesArgumentsObject() }