-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy path$.js
29 lines (23 loc) · 791 Bytes
/
$.js
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
var literal = function(kind, test, expr, value) {
test.equal(expr.type, 'Literal');
test.equal(expr.kind, kind);
test.equal(expr.value, value);
};
exports.number = literal.bind(null, 'number');
exports.string = literal.bind(null, 'string');
exports.id = function(test, expr, name) {
test.equal(expr.type, 'Identifier');
test.equal(expr.name, name);
};
exports.binaryOp = function(test, name, expr) {
test.equal(expr.type, 'BinaryOperator');
test.equal(expr.name, name);
};
exports.idPattern = function(test, expr, name) {
test.equal(expr.type, 'IdentifierPattern');
exports.id(test, expr.id, name);
};
exports.ellipsisPattern = function(test, expr, name) {
test.equal(expr.type, 'EllipsisPattern');
exports.idPattern(test, expr.id, name);
};