Skip to content

Instantly share code, notes, and snippets.

@jeffmo
Created May 20, 2014 21:11
Show Gist options
  • Save jeffmo/d6eed8b43c95cd9493f7 to your computer and use it in GitHub Desktop.
Save jeffmo/d6eed8b43c95cd9493f7 to your computer and use it in GitHub Desktop.
runner: 970 tests. 8 failures. 507 ms
function* t() {}: Expected
{
"type": "Program",
"body": [
{
"type": "FunctionDeclaration",
"id": {
"type": "Identifier",
"name": "t",
"range": [
10,
11
],
"loc": {
"start": {
"line": 1,
"column": 10
},
"end": {
"line": 1,
"column": 11
}
}
},
"params": [],
"defaults": [],
"body": {
"type": "BlockStatement",
"body": [],
"range": [
14,
16
],
"loc": {
"start": {
"line": 1,
"column": 14
},
"end": {
"line": 1,
"column": 16
}
}
},
"rest": null,
"generator": true,
"expression": false,
"range": [
0,
16
],
"loc": {
"start": {
"line": 1,
"column": 0
},
"end": {
"line": 1,
"column": 16
}
}
}
],
"range": [
0,
16
],
"loc": {
"start": {
"line": 1,
"column": 0
},
"end": {
"line": 1,
"column": 16
}
},
"errors": []
}
to match
{
"type": "Program",
"body": [
{
"type": "FunctionDeclaration",
"id": {
"type": "Identifier",
"name": "t",
"range": [
10,
11
],
"loc": {
"start": {
"line": 1,
"column": 10
},
"end": {
"line": 1,
"column": 11
}
}
},
"params": [],
"defaults": [],
"body": {
"type": "BlockStatement",
"body": [],
"range": [
14,
16
],
"loc": {
"start": {
"line": 1,
"column": 14
},
"end": {
"line": 1,
"column": 16
}
}
},
"rest": null,
"generator": true,
"expression": false,
"range": [
0,
16
],
"loc": {
"start": {
"line": 1,
"column": 0
},
"end": {
"line": 1,
"column": 16
}
}
}
],
"range": [
0,
16
],
"loc": {
"start": {
"line": 1,
"column": 0
},
"end": {
"line": 1,
"column": 16
}
},
"errors": [
{
"index": 16,
"lineNumber": 1,
"column": 17,
"message": "Error: Line 1: Missing yield in generator"
}
]
}
Diff:
{
errors: [
+ {
+ index: 16
+ lineNumber: 1
+ column: 17
+ message: "Error: Line 1: Missing yield in generator"
+ }
]
}
yield v: Expected
{"index":6,"lineNumber":1,"column":7,"message":"Error: Line 1: Unexpected identifier","description":"Unexpected identifier"}
to match
{"index":5,"lineNumber":1,"column":6,"message":"Error: Line 1: Illegal yield expression","description":"Illegal yield expression"}
Diff:
{
- index: 6
+ index: 5
- column: 7
+ column: 6
- message: "Error: Line 1: Unexpected identifier"
+ message: "Error: Line 1: Illegal yield expression"
- description: "Unexpected identifier"
+ description: "Illegal yield expression"
}
yield 10: Expected
{"index":6,"lineNumber":1,"column":7,"message":"Error: Line 1: Unexpected number","description":"Unexpected number"}
to match
{"index":5,"lineNumber":1,"column":6,"message":"Error: Line 1: Illegal yield expression","description":"Illegal yield expression"}
Diff:
{
- index: 6
+ index: 5
- column: 7
+ column: 6
- message: "Error: Line 1: Unexpected number"
+ message: "Error: Line 1: Illegal yield expression"
- description: "Unexpected number"
+ description: "Illegal yield expression"
}
yield* 10: Expected
{
"type": "ExpressionStatement",
"expression": {
"type": "BinaryExpression",
"operator": "*",
"left": {
"type": "Identifier",
"name": "yield",
"range": [
0,
5
],
"loc": {
"start": {
"line": 1,
"column": 0
},
"end": {
"line": 1,
"column": 5
}
}
},
"right": {
"type": "Literal",
"value": 10,
"raw": "10",
"range": [
7,
9
],
"loc": {
"start": {
"line": 1,
"column": 7
},
"end": {
"line": 1,
"column": 9
}
}
},
"range": [
0,
9
],
"loc": {
"start": {
"line": 1,
"column": 0
},
"end": {
"line": 1,
"column": 9
}
}
},
"range": [
0,
9
],
"loc": {
"start": {
"line": 1,
"column": 0
},
"end": {
"line": 1,
"column": 9
}
}
}
to match
Error: Line 1: Illegal yield expression
e => yield* 10: Expected
{
"type": "ExpressionStatement",
"expression": {
"type": "ArrowFunctionExpression",
"id": null,
"params": [
{
"type": "Identifier",
"name": "e",
"range": [
0,
1
],
"loc": {
"start": {
"line": 1,
"column": 0
},
"end": {
"line": 1,
"column": 1
}
}
}
],
"defaults": [],
"body": {
"type": "BinaryExpression",
"operator": "*",
"left": {
"type": "Identifier",
"name": "yield",
"range": [
5,
10
],
"loc": {
"start": {
"line": 1,
"column": 5
},
"end": {
"line": 1,
"column": 10
}
}
},
"right": {
"type": "Literal",
"value": 10,
"raw": "10",
"range": [
12,
14
],
"loc": {
"start": {
"line": 1,
"column": 12
},
"end": {
"line": 1,
"column": 14
}
}
},
"range": [
5,
14
],
"loc": {
"start": {
"line": 1,
"column": 5
},
"end": {
"line": 1,
"column": 14
}
}
},
"rest": null,
"generator": false,
"expression": true,
"range": [
0,
14
],
"loc": {
"start": {
"line": 1,
"column": 0
},
"end": {
"line": 1,
"column": 14
}
}
},
"range": [
0,
14
],
"loc": {
"start": {
"line": 1,
"column": 0
},
"end": {
"line": 1,
"column": 14
}
}
}
to match
Error: Line 1: Illegal yield expression
(function () { yield 10 }): Expected
{"index":21,"lineNumber":1,"column":22,"message":"Error: Line 1: Unexpected number","description":"Unexpected number"}
to match
{"index":20,"lineNumber":1,"column":21,"message":"Error: Line 1: Illegal yield expression","description":"Illegal yield expression"}
Diff:
{
- index: 21
+ index: 20
- column: 22
+ column: 21
- message: "Error: Line 1: Unexpected number"
+ message: "Error: Line 1: Illegal yield expression"
- description: "Unexpected number"
+ description: "Illegal yield expression"
}
(function () { yield* 10 }): Expected
{
"type": "ExpressionStatement",
"expression": {
"type": "FunctionExpression",
"id": null,
"params": [],
"defaults": [],
"body": {
"type": "BlockStatement",
"body": [
{
"type": "ExpressionStatement",
"expression": {
"type": "BinaryExpression",
"operator": "*",
"left": {
"type": "Identifier",
"name": "yield",
"range": [
15,
20
],
"loc": {
"start": {
"line": 1,
"column": 15
},
"end": {
"line": 1,
"column": 20
}
}
},
"right": {
"type": "Literal",
"value": 10,
"raw": "10",
"range": [
22,
24
],
"loc": {
"start": {
"line": 1,
"column": 22
},
"end": {
"line": 1,
"column": 24
}
}
},
"range": [
15,
24
],
"loc": {
"start": {
"line": 1,
"column": 15
},
"end": {
"line": 1,
"column": 24
}
}
},
"range": [
15,
25
],
"loc": {
"start": {
"line": 1,
"column": 15
},
"end": {
"line": 1,
"column": 25
}
}
}
],
"range": [
13,
26
],
"loc": {
"start": {
"line": 1,
"column": 13
},
"end": {
"line": 1,
"column": 26
}
}
},
"rest": null,
"generator": false,
"expression": false,
"range": [
1,
26
],
"loc": {
"start": {
"line": 1,
"column": 1
},
"end": {
"line": 1,
"column": 26
}
}
},
"range": [
0,
27
],
"loc": {
"start": {
"line": 1,
"column": 0
},
"end": {
"line": 1,
"column": 27
}
}
}
to match
Error: Line 1: Illegal yield expression
class A extends yield B { }: Expected
{"index":22,"lineNumber":1,"column":23,"message":"Error: Line 1: Unexpected identifier","description":"Unexpected identifier"}
to match
{"index":21,"lineNumber":1,"column":22,"message":"Error: Line 1: Illegal yield expression","description":"Illegal yield expression"}
Diff:
{
- index: 22
+ index: 21
- column: 23
+ column: 22
- message: "Error: Line 1: Unexpected identifier"
+ message: "Error: Line 1: Illegal yield expression"
- description: "Unexpected identifier"
+ description: "Illegal yield expression"
}
compat: 412 tests. 24 failures. 116 ms
(function(){ (+x) }): Expected
{
"type": "Program",
"body": [
{
"type": "ExpressionStatement",
"expression": {
"type": "FunctionExpression",
"id": null,
"params": [],
"defaults": [],
"body": {
"type": "BlockStatement",
"body": [
{
"type": "ExpressionStatement",
"expression": {
"type": "UnaryExpression",
"operator": "+",
"argument": {
"type": "Identifier",
"name": "x"
},
"prefix": true
}
}
]
},
"rest": null,
"generator": false,
"expression": false
}
}
]
}
to match
{
"type": "Program",
"body": [
{
"type": "ExpressionStatement",
"expression": {
"type": "FunctionExpression",
"id": null,
"params": [],
"defaults": [],
"body": {
"type": "BlockStatement",
"body": [
{
"type": "ExpressionStatement",
"expression": {
"type": "UnaryExpression",
"operator": "+",
"argument": {
"type": "Identifier",
"name": "x"
}
}
}
]
},
"rest": null,
"generator": false,
"expression": false
}
}
]
}
(+x): Expected
{
"type": "Program",
"body": [
{
"type": "ExpressionStatement",
"expression": {
"type": "UnaryExpression",
"operator": "+",
"argument": {
"type": "Identifier",
"name": "x"
},
"prefix": true
}
}
]
}
to match
{
"type": "Program",
"body": [
{
"type": "ExpressionStatement",
"expression": {
"type": "UnaryExpression",
"operator": "+",
"argument": {
"type": "Identifier",
"name": "x"
}
}
}
]
}
(function(){ { (+x) } }): Expected
{
"type": "Program",
"body": [
{
"type": "ExpressionStatement",
"expression": {
"type": "FunctionExpression",
"id": null,
"params": [],
"defaults": [],
"body": {
"type": "BlockStatement",
"body": [
{
"type": "BlockStatement",
"body": [
{
"type": "ExpressionStatement",
"expression": {
"type": "UnaryExpression",
"operator": "+",
"argument": {
"type": "Identifier",
"name": "x"
},
"prefix": true
}
}
]
}
]
},
"rest": null,
"generator": false,
"expression": false
}
}
]
}
to match
{
"type": "Program",
"body": [
{
"type": "ExpressionStatement",
"expression": {
"type": "FunctionExpression",
"id": null,
"params": [],
"defaults": [],
"body": {
"type": "BlockStatement",
"body": [
{
"type": "BlockStatement",
"body": [
{
"type": "ExpressionStatement",
"expression": {
"type": "UnaryExpression",
"operator": "+",
"argument": {
"type": "Identifier",
"name": "x"
}
}
}
]
}
]
},
"rest": null,
"generator": false,
"expression": false
}
}
]
}
(function(){ (-x) }): Expected
{
"type": "Program",
"body": [
{
"type": "ExpressionStatement",
"expression": {
"type": "FunctionExpression",
"id": null,
"params": [],
"defaults": [],
"body": {
"type": "BlockStatement",
"body": [
{
"type": "ExpressionStatement",
"expression": {
"type": "UnaryExpression",
"operator": "-",
"argument": {
"type": "Identifier",
"name": "x"
},
"prefix": true
}
}
]
},
"rest": null,
"generator": false,
"expression": false
}
}
]
}
to match
{
"type": "Program",
"body": [
{
"type": "ExpressionStatement",
"expression": {
"type": "FunctionExpression",
"id": null,
"params": [],
"defaults": [],
"body": {
"type": "BlockStatement",
"body": [
{
"type": "ExpressionStatement",
"expression": {
"type": "UnaryExpression",
"operator": "-",
"argument": {
"type": "Identifier",
"name": "x"
}
}
}
]
},
"rest": null,
"generator": false,
"expression": false
}
}
]
}
(-x): Expected
{
"type": "Program",
"body": [
{
"type": "ExpressionStatement",
"expression": {
"type": "UnaryExpression",
"operator": "-",
"argument": {
"type": "Identifier",
"name": "x"
},
"prefix": true
}
}
]
}
to match
{
"type": "Program",
"body": [
{
"type": "ExpressionStatement",
"expression": {
"type": "UnaryExpression",
"operator": "-",
"argument": {
"type": "Identifier",
"name": "x"
}
}
}
]
}
(function(){ { (-x) } }): Expected
{
"type": "Program",
"body": [
{
"type": "ExpressionStatement",
"expression": {
"type": "FunctionExpression",
"id": null,
"params": [],
"defaults": [],
"body": {
"type": "BlockStatement",
"body": [
{
"type": "BlockStatement",
"body": [
{
"type": "ExpressionStatement",
"expression": {
"type": "UnaryExpression",
"operator": "-",
"argument": {
"type": "Identifier",
"name": "x"
},
"prefix": true
}
}
]
}
]
},
"rest": null,
"generator": false,
"expression": false
}
}
]
}
to match
{
"type": "Program",
"body": [
{
"type": "ExpressionStatement",
"expression": {
"type": "FunctionExpression",
"id": null,
"params": [],
"defaults": [],
"body": {
"type": "BlockStatement",
"body": [
{
"type": "BlockStatement",
"body": [
{
"type": "ExpressionStatement",
"expression": {
"type": "UnaryExpression",
"operator": "-",
"argument": {
"type": "Identifier",
"name": "x"
}
}
}
]
}
]
},
"rest": null,
"generator": false,
"expression": false
}
}
]
}
(function(){ (!x) }): Expected
{
"type": "Program",
"body": [
{
"type": "ExpressionStatement",
"expression": {
"type": "FunctionExpression",
"id": null,
"params": [],
"defaults": [],
"body": {
"type": "BlockStatement",
"body": [
{
"type": "ExpressionStatement",
"expression": {
"type": "UnaryExpression",
"operator": "!",
"argument": {
"type": "Identifier",
"name": "x"
},
"prefix": true
}
}
]
},
"rest": null,
"generator": false,
"expression": false
}
}
]
}
to match
{
"type": "Program",
"body": [
{
"type": "ExpressionStatement",
"expression": {
"type": "FunctionExpression",
"id": null,
"params": [],
"defaults": [],
"body": {
"type": "BlockStatement",
"body": [
{
"type": "ExpressionStatement",
"expression": {
"type": "UnaryExpression",
"operator": "!",
"argument": {
"type": "Identifier",
"name": "x"
}
}
}
]
},
"rest": null,
"generator": false,
"expression": false
}
}
]
}
(!x): Expected
{
"type": "Program",
"body": [
{
"type": "ExpressionStatement",
"expression": {
"type": "UnaryExpression",
"operator": "!",
"argument": {
"type": "Identifier",
"name": "x"
},
"prefix": true
}
}
]
}
to match
{
"type": "Program",
"body": [
{
"type": "ExpressionStatement",
"expression": {
"type": "UnaryExpression",
"operator": "!",
"argument": {
"type": "Identifier",
"name": "x"
}
}
}
]
}
(function(){ { (!x) } }): Expected
{
"type": "Program",
"body": [
{
"type": "ExpressionStatement",
"expression": {
"type": "FunctionExpression",
"id": null,
"params": [],
"defaults": [],
"body": {
"type": "BlockStatement",
"body": [
{
"type": "BlockStatement",
"body": [
{
"type": "ExpressionStatement",
"expression": {
"type": "UnaryExpression",
"operator": "!",
"argument": {
"type": "Identifier",
"name": "x"
},
"prefix": true
}
}
]
}
]
},
"rest": null,
"generator": false,
"expression": false
}
}
]
}
to match
{
"type": "Program",
"body": [
{
"type": "ExpressionStatement",
"expression": {
"type": "FunctionExpression",
"id": null,
"params": [],
"defaults": [],
"body": {
"type": "BlockStatement",
"body": [
{
"type": "BlockStatement",
"body": [
{
"type": "ExpressionStatement",
"expression": {
"type": "UnaryExpression",
"operator": "!",
"argument": {
"type": "Identifier",
"name": "x"
}
}
}
]
}
]
},
"rest": null,
"generator": false,
"expression": false
}
}
]
}
(function(){ (~x) }): Expected
{
"type": "Program",
"body": [
{
"type": "ExpressionStatement",
"expression": {
"type": "FunctionExpression",
"id": null,
"params": [],
"defaults": [],
"body": {
"type": "BlockStatement",
"body": [
{
"type": "ExpressionStatement",
"expression": {
"type": "UnaryExpression",
"operator": "~",
"argument": {
"type": "Identifier",
"name": "x"
},
"prefix": true
}
}
]
},
"rest": null,
"generator": false,
"expression": false
}
}
]
}
to match
{
"type": "Program",
"body": [
{
"type": "ExpressionStatement",
"expression": {
"type": "FunctionExpression",
"id": null,
"params": [],
"defaults": [],
"body": {
"type": "BlockStatement",
"body": [
{
"type": "ExpressionStatement",
"expression": {
"type": "UnaryExpression",
"operator": "~",
"argument": {
"type": "Identifier",
"name": "x"
}
}
}
]
},
"rest": null,
"generator": false,
"expression": false
}
}
]
}
(~x): Expected
{
"type": "Program",
"body": [
{
"type": "ExpressionStatement",
"expression": {
"type": "UnaryExpression",
"operator": "~",
"argument": {
"type": "Identifier",
"name": "x"
},
"prefix": true
}
}
]
}
to match
{
"type": "Program",
"body": [
{
"type": "ExpressionStatement",
"expression": {
"type": "UnaryExpression",
"operator": "~",
"argument": {
"type": "Identifier",
"name": "x"
}
}
}
]
}
(function(){ { (~x) } }): Expected
{
"type": "Program",
"body": [
{
"type": "ExpressionStatement",
"expression": {
"type": "FunctionExpression",
"id": null,
"params": [],
"defaults": [],
"body": {
"type": "BlockStatement",
"body": [
{
"type": "BlockStatement",
"body": [
{
"type": "ExpressionStatement",
"expression": {
"type": "UnaryExpression",
"operator": "~",
"argument": {
"type": "Identifier",
"name": "x"
},
"prefix": true
}
}
]
}
]
},
"rest": null,
"generator": false,
"expression": false
}
}
]
}
to match
{
"type": "Program",
"body": [
{
"type": "ExpressionStatement",
"expression": {
"type": "FunctionExpression",
"id": null,
"params": [],
"defaults": [],
"body": {
"type": "BlockStatement",
"body": [
{
"type": "BlockStatement",
"body": [
{
"type": "ExpressionStatement",
"expression": {
"type": "UnaryExpression",
"operator": "~",
"argument": {
"type": "Identifier",
"name": "x"
}
}
}
]
}
]
},
"rest": null,
"generator": false,
"expression": false
}
}
]
}
(function(){ (delete x) }): Expected
{
"type": "Program",
"body": [
{
"type": "ExpressionStatement",
"expression": {
"type": "FunctionExpression",
"id": null,
"params": [],
"defaults": [],
"body": {
"type": "BlockStatement",
"body": [
{
"type": "ExpressionStatement",
"expression": {
"type": "UnaryExpression",
"operator": "delete",
"argument": {
"type": "Identifier",
"name": "x"
},
"prefix": true
}
}
]
},
"rest": null,
"generator": false,
"expression": false
}
}
]
}
to match
{
"type": "Program",
"body": [
{
"type": "ExpressionStatement",
"expression": {
"type": "FunctionExpression",
"id": null,
"params": [],
"defaults": [],
"body": {
"type": "BlockStatement",
"body": [
{
"type": "ExpressionStatement",
"expression": {
"type": "UnaryExpression",
"operator": "delete",
"argument": {
"type": "Identifier",
"name": "x"
}
}
}
]
},
"rest": null,
"generator": false,
"expression": false
}
}
]
}
(delete x): Expected
{
"type": "Program",
"body": [
{
"type": "ExpressionStatement",
"expression": {
"type": "UnaryExpression",
"operator": "delete",
"argument": {
"type": "Identifier",
"name": "x"
},
"prefix": true
}
}
]
}
to match
{
"type": "Program",
"body": [
{
"type": "ExpressionStatement",
"expression": {
"type": "UnaryExpression",
"operator": "delete",
"argument": {
"type": "Identifier",
"name": "x"
}
}
}
]
}
(function(){ { (delete x) } }): Expected
{
"type": "Program",
"body": [
{
"type": "ExpressionStatement",
"expression": {
"type": "FunctionExpression",
"id": null,
"params": [],
"defaults": [],
"body": {
"type": "BlockStatement",
"body": [
{
"type": "BlockStatement",
"body": [
{
"type": "ExpressionStatement",
"expression": {
"type": "UnaryExpression",
"operator": "delete",
"argument": {
"type": "Identifier",
"name": "x"
},
"prefix": true
}
}
]
}
]
},
"rest": null,
"generator": false,
"expression": false
}
}
]
}
to match
{
"type": "Program",
"body": [
{
"type": "ExpressionStatement",
"expression": {
"type": "FunctionExpression",
"id": null,
"params": [],
"defaults": [],
"body": {
"type": "BlockStatement",
"body": [
{
"type": "BlockStatement",
"body": [
{
"type": "ExpressionStatement",
"expression": {
"type": "UnaryExpression",
"operator": "delete",
"argument": {
"type": "Identifier",
"name": "x"
}
}
}
]
}
]
},
"rest": null,
"generator": false,
"expression": false
}
}
]
}
(function(){ (typeof x) }): Expected
{
"type": "Program",
"body": [
{
"type": "ExpressionStatement",
"expression": {
"type": "FunctionExpression",
"id": null,
"params": [],
"defaults": [],
"body": {
"type": "BlockStatement",
"body": [
{
"type": "ExpressionStatement",
"expression": {
"type": "UnaryExpression",
"operator": "typeof",
"argument": {
"type": "Identifier",
"name": "x"
},
"prefix": true
}
}
]
},
"rest": null,
"generator": false,
"expression": false
}
}
]
}
to match
{
"type": "Program",
"body": [
{
"type": "ExpressionStatement",
"expression": {
"type": "FunctionExpression",
"id": null,
"params": [],
"defaults": [],
"body": {
"type": "BlockStatement",
"body": [
{
"type": "ExpressionStatement",
"expression": {
"type": "UnaryExpression",
"operator": "typeof",
"argument": {
"type": "Identifier",
"name": "x"
}
}
}
]
},
"rest": null,
"generator": false,
"expression": false
}
}
]
}
(typeof x): Expected
{
"type": "Program",
"body": [
{
"type": "ExpressionStatement",
"expression": {
"type": "UnaryExpression",
"operator": "typeof",
"argument": {
"type": "Identifier",
"name": "x"
},
"prefix": true
}
}
]
}
to match
{
"type": "Program",
"body": [
{
"type": "ExpressionStatement",
"expression": {
"type": "UnaryExpression",
"operator": "typeof",
"argument": {
"type": "Identifier",
"name": "x"
}
}
}
]
}
(function(){ { (typeof x) } }): Expected
{
"type": "Program",
"body": [
{
"type": "ExpressionStatement",
"expression": {
"type": "FunctionExpression",
"id": null,
"params": [],
"defaults": [],
"body": {
"type": "BlockStatement",
"body": [
{
"type": "BlockStatement",
"body": [
{
"type": "ExpressionStatement",
"expression": {
"type": "UnaryExpression",
"operator": "typeof",
"argument": {
"type": "Identifier",
"name": "x"
},
"prefix": true
}
}
]
}
]
},
"rest": null,
"generator": false,
"expression": false
}
}
]
}
to match
{
"type": "Program",
"body": [
{
"type": "ExpressionStatement",
"expression": {
"type": "FunctionExpression",
"id": null,
"params": [],
"defaults": [],
"body": {
"type": "BlockStatement",
"body": [
{
"type": "BlockStatement",
"body": [
{
"type": "ExpressionStatement",
"expression": {
"type": "UnaryExpression",
"operator": "typeof",
"argument": {
"type": "Identifier",
"name": "x"
}
}
}
]
}
]
},
"rest": null,
"generator": false,
"expression": false
}
}
]
}
(function(){ (void x) }): Expected
{
"type": "Program",
"body": [
{
"type": "ExpressionStatement",
"expression": {
"type": "FunctionExpression",
"id": null,
"params": [],
"defaults": [],
"body": {
"type": "BlockStatement",
"body": [
{
"type": "ExpressionStatement",
"expression": {
"type": "UnaryExpression",
"operator": "void",
"argument": {
"type": "Identifier",
"name": "x"
},
"prefix": true
}
}
]
},
"rest": null,
"generator": false,
"expression": false
}
}
]
}
to match
{
"type": "Program",
"body": [
{
"type": "ExpressionStatement",
"expression": {
"type": "FunctionExpression",
"id": null,
"params": [],
"defaults": [],
"body": {
"type": "BlockStatement",
"body": [
{
"type": "ExpressionStatement",
"expression": {
"type": "UnaryExpression",
"operator": "void",
"argument": {
"type": "Identifier",
"name": "x"
}
}
}
]
},
"rest": null,
"generator": false,
"expression": false
}
}
]
}
(void x): Expected
{
"type": "Program",
"body": [
{
"type": "ExpressionStatement",
"expression": {
"type": "UnaryExpression",
"operator": "void",
"argument": {
"type": "Identifier",
"name": "x"
},
"prefix": true
}
}
]
}
to match
{
"type": "Program",
"body": [
{
"type": "ExpressionStatement",
"expression": {
"type": "UnaryExpression",
"operator": "void",
"argument": {
"type": "Identifier",
"name": "x"
}
}
}
]
}
(function(){ { (void x) } }): Expected
{
"type": "Program",
"body": [
{
"type": "ExpressionStatement",
"expression": {
"type": "FunctionExpression",
"id": null,
"params": [],
"defaults": [],
"body": {
"type": "BlockStatement",
"body": [
{
"type": "BlockStatement",
"body": [
{
"type": "ExpressionStatement",
"expression": {
"type": "UnaryExpression",
"operator": "void",
"argument": {
"type": "Identifier",
"name": "x"
},
"prefix": true
}
}
]
}
]
},
"rest": null,
"generator": false,
"expression": false
}
}
]
}
to match
{
"type": "Program",
"body": [
{
"type": "ExpressionStatement",
"expression": {
"type": "FunctionExpression",
"id": null,
"params": [],
"defaults": [],
"body": {
"type": "BlockStatement",
"body": [
{
"type": "BlockStatement",
"body": [
{
"type": "ExpressionStatement",
"expression": {
"type": "UnaryExpression",
"operator": "void",
"argument": {
"type": "Identifier",
"name": "x"
}
}
}
]
}
]
},
"rest": null,
"generator": false,
"expression": false
}
}
]
}
(function(){ typeof(0?0:a) }): Expected
{
"type": "Program",
"body": [
{
"type": "ExpressionStatement",
"expression": {
"type": "FunctionExpression",
"id": null,
"params": [],
"defaults": [],
"body": {
"type": "BlockStatement",
"body": [
{
"type": "ExpressionStatement",
"expression": {
"type": "UnaryExpression",
"operator": "typeof",
"argument": {
"type": "ConditionalExpression",
"test": {
"type": "Literal",
"value": 0
},
"consequent": {
"type": "Literal",
"value": 0
},
"alternate": {
"type": "Identifier",
"name": "a"
}
},
"prefix": true
}
}
]
},
"rest": null,
"generator": false,
"expression": false
}
}
]
}
to match
{
"type": "Program",
"body": [
{
"type": "ExpressionStatement",
"expression": {
"type": "FunctionExpression",
"id": null,
"params": [],
"defaults": [],
"body": {
"type": "BlockStatement",
"body": [
{
"type": "ExpressionStatement",
"expression": {
"type": "UnaryExpression",
"operator": "typeof",
"argument": {
"type": "ConditionalExpression",
"test": {
"type": "Literal",
"value": 0
},
"consequent": {
"type": "Literal",
"value": 0
},
"alternate": {
"type": "Identifier",
"name": "a"
}
}
}
}
]
},
"rest": null,
"generator": false,
"expression": false
}
}
]
}
typeof(0?0:a): Expected
{
"type": "Program",
"body": [
{
"type": "ExpressionStatement",
"expression": {
"type": "UnaryExpression",
"operator": "typeof",
"argument": {
"type": "ConditionalExpression",
"test": {
"type": "Literal",
"value": 0
},
"consequent": {
"type": "Literal",
"value": 0
},
"alternate": {
"type": "Identifier",
"name": "a"
}
},
"prefix": true
}
}
]
}
to match
{
"type": "Program",
"body": [
{
"type": "ExpressionStatement",
"expression": {
"type": "UnaryExpression",
"operator": "typeof",
"argument": {
"type": "ConditionalExpression",
"test": {
"type": "Literal",
"value": 0
},
"consequent": {
"type": "Literal",
"value": 0
},
"alternate": {
"type": "Identifier",
"name": "a"
}
}
}
}
]
}
(function(){ { typeof(0?0:a) } }): Expected
{
"type": "Program",
"body": [
{
"type": "ExpressionStatement",
"expression": {
"type": "FunctionExpression",
"id": null,
"params": [],
"defaults": [],
"body": {
"type": "BlockStatement",
"body": [
{
"type": "BlockStatement",
"body": [
{
"type": "ExpressionStatement",
"expression": {
"type": "UnaryExpression",
"operator": "typeof",
"argument": {
"type": "ConditionalExpression",
"test": {
"type": "Literal",
"value": 0
},
"consequent": {
"type": "Literal",
"value": 0
},
"alternate": {
"type": "Identifier",
"name": "a"
}
},
"prefix": true
}
}
]
}
]
},
"rest": null,
"generator": false,
"expression": false
}
}
]
}
to match
{
"type": "Program",
"body": [
{
"type": "ExpressionStatement",
"expression": {
"type": "FunctionExpression",
"id": null,
"params": [],
"defaults": [],
"body": {
"type": "BlockStatement",
"body": [
{
"type": "BlockStatement",
"body": [
{
"type": "ExpressionStatement",
"expression": {
"type": "UnaryExpression",
"operator": "typeof",
"argument": {
"type": "ConditionalExpression",
"test": {
"type": "Literal",
"value": 0
},
"consequent": {
"type": "Literal",
"value": 0
},
"alternate": {
"type": "Identifier",
"name": "a"
}
}
}
}
]
}
]
},
"rest": null,
"generator": false,
"expression": false
}
}
]
}
npm ERR! Test failed. See above for more details.
npm ERR! not ok code 0
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment