add esprima tests and fix bugs picked up by it

This commit is contained in:
Sebastian McKenzie
2015-08-11 00:59:15 +01:00
parent c318c88050
commit df021c7f23
2091 changed files with 82939 additions and 111 deletions

View File

@@ -0,0 +1 @@
"\x";

View File

@@ -0,0 +1,3 @@
{
"throws": "Bad character escape sequence (1:3)"
}

View File

@@ -0,0 +1 @@
"\x0";

View File

@@ -0,0 +1,3 @@
{
"throws": "Bad character escape sequence (1:3)"
}

View File

@@ -0,0 +1 @@
"\xx";

View File

@@ -0,0 +1,3 @@
{
"throws": "Bad character escape sequence (1:3)"
}

View File

@@ -0,0 +1 @@
"\u";

View File

@@ -0,0 +1,3 @@
{
"throws": "Bad character escape sequence (1:3)"
}

View File

@@ -0,0 +1 @@
"\u0";

View File

@@ -0,0 +1,3 @@
{
"throws": "Bad character escape sequence (1:3)"
}

View File

@@ -0,0 +1 @@
"\ux";

View File

@@ -0,0 +1,3 @@
{
"throws": "Bad character escape sequence (1:3)"
}

View File

@@ -0,0 +1 @@
"\u00";

View File

@@ -0,0 +1,3 @@
{
"throws": "Bad character escape sequence (1:3)"
}

View File

@@ -0,0 +1 @@
"\u000";

View File

@@ -0,0 +1,3 @@
{
"throws": "Bad character escape sequence (1:3)"
}

View File

@@ -0,0 +1 @@
"\9";

View File

@@ -0,0 +1,66 @@
{
"type": "File",
"start": 0,
"end": 5,
"loc": {
"start": {
"line": 1,
"column": 0
},
"end": {
"line": 1,
"column": 5
}
},
"program": {
"type": "Program",
"start": 0,
"end": 5,
"loc": {
"start": {
"line": 1,
"column": 0
},
"end": {
"line": 1,
"column": 5
}
},
"sourceType": "script",
"body": [
{
"type": "ExpressionStatement",
"start": 0,
"end": 5,
"loc": {
"start": {
"line": 1,
"column": 0
},
"end": {
"line": 1,
"column": 5
}
},
"expression": {
"type": "Literal",
"start": 0,
"end": 4,
"loc": {
"start": {
"line": 1,
"column": 0
},
"end": {
"line": 1,
"column": 4
}
},
"value": "9",
"rawValue": "9",
"raw": "\"\\9\""
}
}
]
}
}

View File

@@ -0,0 +1,3 @@
{
"throws": "Unexpected token (1:4)"
}

View File

@@ -0,0 +1 @@
{

View File

@@ -0,0 +1,3 @@
{
"throws": "Unexpected token (1:1)"
}

View File

@@ -0,0 +1 @@
}

View File

@@ -0,0 +1,3 @@
{
"throws": "Unexpected token (1:0)"
}

View File

@@ -0,0 +1 @@
3ea

View File

@@ -0,0 +1,3 @@
{
"throws": "Invalid number (1:0)"
}

View File

@@ -0,0 +1 @@
3in []

View File

@@ -0,0 +1,3 @@
{
"throws": "Identifier directly after number (1:1)"
}

View File

@@ -0,0 +1 @@
3e

View File

@@ -0,0 +1,3 @@
{
"throws": "Invalid number (1:0)"
}

View File

@@ -0,0 +1 @@
3e+

View File

@@ -0,0 +1,3 @@
{
"throws": "Invalid number (1:0)"
}

View File

@@ -0,0 +1 @@
3e-

View File

@@ -0,0 +1,3 @@
{
"throws": "Invalid number (1:0)"
}

View File

@@ -0,0 +1 @@
3x

View File

@@ -0,0 +1,3 @@
{
"throws": "Identifier directly after number (1:1)"
}

View File

@@ -0,0 +1 @@
3x0

View File

@@ -0,0 +1,3 @@
{
"throws": "Identifier directly after number (1:1)"
}

View File

@@ -0,0 +1 @@
0x

View File

@@ -0,0 +1,3 @@
{
"throws": "Expected number in radix 16 (1:2)"
}

View File

@@ -0,0 +1 @@
01a

View File

@@ -0,0 +1,3 @@
{
"throws": "Identifier directly after number (1:2)"
}

View File

@@ -0,0 +1 @@
0o1a

View File

@@ -0,0 +1,3 @@
{
"throws": "Identifier directly after number (1:3)"
}

View File

@@ -0,0 +1 @@
0o

View File

@@ -0,0 +1,3 @@
{
"throws": "Expected number in radix 8 (1:2)"
}

View File

@@ -0,0 +1 @@
0O

View File

@@ -0,0 +1,3 @@
{
"throws": "Expected number in radix 8 (1:2)"
}

View File

@@ -0,0 +1 @@
0o9

View File

@@ -0,0 +1,3 @@
{
"throws": "Expected number in radix 8 (1:2)"
}

View File

@@ -0,0 +1 @@
0o18

View File

@@ -0,0 +1,3 @@
{
"throws": "Unexpected token (1:3)"
}

View File

@@ -0,0 +1 @@
0O1a

View File

@@ -0,0 +1,3 @@
{
"throws": "Identifier directly after number (1:3)"
}

View File

@@ -0,0 +1 @@
0b

View File

@@ -0,0 +1,3 @@
{
"throws": "Expected number in radix 2 (1:2)"
}

View File

@@ -0,0 +1 @@
0b1a

View File

@@ -0,0 +1,3 @@
{
"throws": "Identifier directly after number (1:3)"
}

View File

@@ -0,0 +1 @@
0b9

View File

@@ -0,0 +1,3 @@
{
"throws": "Expected number in radix 2 (1:2)"
}

View File

@@ -0,0 +1 @@
0b18

View File

@@ -0,0 +1,3 @@
{
"throws": "Unexpected token (1:3)"
}

View File

@@ -0,0 +1 @@
0b12

View File

@@ -0,0 +1,3 @@
{
"throws": "Unexpected token (1:3)"
}

View File

@@ -0,0 +1 @@
0B

View File

@@ -0,0 +1,3 @@
{
"throws": "Expected number in radix 2 (1:2)"
}

View File

@@ -0,0 +1 @@
0B1a

View File

@@ -0,0 +1,3 @@
{
"throws": "Identifier directly after number (1:3)"
}

View File

@@ -0,0 +1 @@
0B9

View File

@@ -0,0 +1,3 @@
{
"throws": "Expected number in radix 2 (1:2)"
}

View File

@@ -0,0 +1 @@
0B18

View File

@@ -0,0 +1,3 @@
{
"throws": "Unexpected token (1:3)"
}

View File

@@ -0,0 +1 @@
0B12

View File

@@ -0,0 +1,3 @@
{
"throws": "Unexpected token (1:3)"
}

View File

@@ -0,0 +1 @@
0O9

View File

@@ -0,0 +1,3 @@
{
"throws": "Expected number in radix 8 (1:2)"
}

View File

@@ -0,0 +1 @@
0O18

View File

@@ -0,0 +1,3 @@
{
"throws": "Unexpected token (1:3)"
}

View File

@@ -0,0 +1 @@
3in[]

View File

@@ -0,0 +1,3 @@
{
"throws": "Identifier directly after number (1:1)"
}

View File

@@ -0,0 +1 @@
0x3in[]

View File

@@ -0,0 +1,3 @@
{
"throws": "Identifier directly after number (1:3)"
}

View File

@@ -0,0 +1,2 @@
"Hello
World"

View File

@@ -0,0 +1,3 @@
{
"throws": "Unterminated string constant (1:0)"
}

View File

@@ -0,0 +1 @@
x\

View File

@@ -0,0 +1,3 @@
{
"throws": "Expecting Unicode escape sequence \\uXXXX (1:2)"
}

View File

@@ -0,0 +1 @@
var source = 'x\\u005c';

View File

@@ -0,0 +1,100 @@
{
"type": "File",
"start": 0,
"end": 24,
"loc": {
"start": {
"line": 1,
"column": 0
},
"end": {
"line": 1,
"column": 24
}
},
"program": {
"type": "Program",
"start": 0,
"end": 24,
"loc": {
"start": {
"line": 1,
"column": 0
},
"end": {
"line": 1,
"column": 24
}
},
"sourceType": "script",
"body": [
{
"type": "VariableDeclaration",
"start": 0,
"end": 24,
"loc": {
"start": {
"line": 1,
"column": 0
},
"end": {
"line": 1,
"column": 24
}
},
"declarations": [
{
"type": "VariableDeclarator",
"start": 4,
"end": 23,
"loc": {
"start": {
"line": 1,
"column": 4
},
"end": {
"line": 1,
"column": 23
}
},
"id": {
"type": "Identifier",
"start": 4,
"end": 10,
"loc": {
"start": {
"line": 1,
"column": 4
},
"end": {
"line": 1,
"column": 10
}
},
"name": "source"
},
"init": {
"type": "Literal",
"start": 13,
"end": 23,
"loc": {
"start": {
"line": 1,
"column": 13
},
"end": {
"line": 1,
"column": 23
}
},
"value": "x\\u005c",
"rawValue": "x\\u005c",
"raw": "'x\\\\u005c'"
}
}
],
"kind": "var"
}
]
}
}

View File

@@ -0,0 +1,3 @@
{
"throws": "Unexpected token (1:8)"
}

View File

@@ -0,0 +1 @@
var source = 'x\\u002a';

View File

@@ -0,0 +1,100 @@
{
"type": "File",
"start": 0,
"end": 24,
"loc": {
"start": {
"line": 1,
"column": 0
},
"end": {
"line": 1,
"column": 24
}
},
"program": {
"type": "Program",
"start": 0,
"end": 24,
"loc": {
"start": {
"line": 1,
"column": 0
},
"end": {
"line": 1,
"column": 24
}
},
"sourceType": "script",
"body": [
{
"type": "VariableDeclaration",
"start": 0,
"end": 24,
"loc": {
"start": {
"line": 1,
"column": 0
},
"end": {
"line": 1,
"column": 24
}
},
"declarations": [
{
"type": "VariableDeclarator",
"start": 4,
"end": 23,
"loc": {
"start": {
"line": 1,
"column": 4
},
"end": {
"line": 1,
"column": 23
}
},
"id": {
"type": "Identifier",
"start": 4,
"end": 10,
"loc": {
"start": {
"line": 1,
"column": 4
},
"end": {
"line": 1,
"column": 10
}
},
"name": "source"
},
"init": {
"type": "Literal",
"start": 13,
"end": 23,
"loc": {
"start": {
"line": 1,
"column": 13
},
"end": {
"line": 1,
"column": 23
}
},
"value": "x\\u002a",
"rawValue": "x\\u002a",
"raw": "'x\\\\u002a'"
}
}
],
"kind": "var"
}
]
}
}

View File

@@ -0,0 +1,3 @@
{
"throws": "Unexpected token (1:8)"
}

View File

@@ -0,0 +1 @@
var x = /(s/g

View File

@@ -0,0 +1,3 @@
{
"throws": "Error parsing regular expression: Invalid regular expression: /(s/: Unterminated group (1:9)"
}

View File

@@ -0,0 +1 @@
var source = 'a\\u';

View File

@@ -0,0 +1,100 @@
{
"type": "File",
"start": 0,
"end": 20,
"loc": {
"start": {
"line": 1,
"column": 0
},
"end": {
"line": 1,
"column": 20
}
},
"program": {
"type": "Program",
"start": 0,
"end": 20,
"loc": {
"start": {
"line": 1,
"column": 0
},
"end": {
"line": 1,
"column": 20
}
},
"sourceType": "script",
"body": [
{
"type": "VariableDeclaration",
"start": 0,
"end": 20,
"loc": {
"start": {
"line": 1,
"column": 0
},
"end": {
"line": 1,
"column": 20
}
},
"declarations": [
{
"type": "VariableDeclarator",
"start": 4,
"end": 19,
"loc": {
"start": {
"line": 1,
"column": 4
},
"end": {
"line": 1,
"column": 19
}
},
"id": {
"type": "Identifier",
"start": 4,
"end": 10,
"loc": {
"start": {
"line": 1,
"column": 4
},
"end": {
"line": 1,
"column": 10
}
},
"name": "source"
},
"init": {
"type": "Literal",
"start": 13,
"end": 19,
"loc": {
"start": {
"line": 1,
"column": 13
},
"end": {
"line": 1,
"column": 19
}
},
"value": "a\\u",
"rawValue": "a\\u",
"raw": "'a\\\\u'"
}
}
],
"kind": "var"
}
]
}
}

View File

@@ -0,0 +1,3 @@
{
"throws": "Unexpected token (1:4)"
}

View File

@@ -0,0 +1 @@
var source = '\\ua';

View File

@@ -0,0 +1,100 @@
{
"type": "File",
"start": 0,
"end": 20,
"loc": {
"start": {
"line": 1,
"column": 0
},
"end": {
"line": 1,
"column": 20
}
},
"program": {
"type": "Program",
"start": 0,
"end": 20,
"loc": {
"start": {
"line": 1,
"column": 0
},
"end": {
"line": 1,
"column": 20
}
},
"sourceType": "script",
"body": [
{
"type": "VariableDeclaration",
"start": 0,
"end": 20,
"loc": {
"start": {
"line": 1,
"column": 0
},
"end": {
"line": 1,
"column": 20
}
},
"declarations": [
{
"type": "VariableDeclarator",
"start": 4,
"end": 19,
"loc": {
"start": {
"line": 1,
"column": 4
},
"end": {
"line": 1,
"column": 19
}
},
"id": {
"type": "Identifier",
"start": 4,
"end": 10,
"loc": {
"start": {
"line": 1,
"column": 4
},
"end": {
"line": 1,
"column": 10
}
},
"name": "source"
},
"init": {
"type": "Literal",
"start": 13,
"end": 19,
"loc": {
"start": {
"line": 1,
"column": 13
},
"end": {
"line": 1,
"column": 19
}
},
"value": "\\ua",
"rawValue": "\\ua",
"raw": "'\\\\ua'"
}
}
],
"kind": "var"
}
]
}
}

View File

@@ -0,0 +1,3 @@
{
"throws": "Unexpected token (1:4)"
}

View File

@@ -0,0 +1 @@
/

Some files were not shown because too many files have changed in this diff Show More