-
Notifications
You must be signed in to change notification settings - Fork 2k
Expand file tree
/
Copy pathtests.ql
More file actions
21 lines (14 loc) · 773 Bytes
/
tests.ql
File metadata and controls
21 lines (14 loc) · 773 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
import javascript
query predicate arrayPattern_getElement(ArrayPattern ap, int i, BindingPattern elt) {
elt = ap.getElement(i)
}
query predicate arrayPattern_getSizeE(ArrayPattern ap, int size) { size = ap.getSize() }
query predicate arrayPattern_omittedElements(ArrayPattern ap, int i) { ap.elementIsOmitted(i) }
query predicate objectPattern_getPropertyPattern(ObjectPattern op, int i, PropertyPattern pp) {
pp = op.getPropertyPattern(i)
}
query predicate propertyPattern_getName(PropertyPattern pp, string name) {
if exists(pp.getName()) then name = pp.getName() else name = "<unknown>"
}
query predicate propertyPattern_isComputed(PropertyPattern pp) { pp.isComputed() }
query predicate propertyPattern_isShortHand(PropertyPattern pp) { pp.isShorthand() }