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 @@
while (true) { continue; }

View File

@@ -0,0 +1,99 @@
{
"type": "File",
"start": 0,
"end": 26,
"loc": {
"start": {
"line": 1,
"column": 0
},
"end": {
"line": 1,
"column": 26
}
},
"program": {
"type": "Program",
"start": 0,
"end": 26,
"loc": {
"start": {
"line": 1,
"column": 0
},
"end": {
"line": 1,
"column": 26
}
},
"sourceType": "script",
"body": [
{
"type": "WhileStatement",
"start": 0,
"end": 26,
"loc": {
"start": {
"line": 1,
"column": 0
},
"end": {
"line": 1,
"column": 26
}
},
"test": {
"type": "Literal",
"start": 7,
"end": 11,
"loc": {
"start": {
"line": 1,
"column": 7
},
"end": {
"line": 1,
"column": 11
}
},
"value": true,
"rawValue": true,
"raw": "true"
},
"body": {
"type": "BlockStatement",
"start": 13,
"end": 26,
"loc": {
"start": {
"line": 1,
"column": 13
},
"end": {
"line": 1,
"column": 26
}
},
"body": [
{
"type": "ContinueStatement",
"start": 15,
"end": 24,
"loc": {
"start": {
"line": 1,
"column": 15
},
"end": {
"line": 1,
"column": 24
}
},
"label": null
}
]
}
}
]
}
}

View File

@@ -0,0 +1 @@
while (true) { continue }

View File

@@ -0,0 +1,99 @@
{
"type": "File",
"start": 0,
"end": 25,
"loc": {
"start": {
"line": 1,
"column": 0
},
"end": {
"line": 1,
"column": 25
}
},
"program": {
"type": "Program",
"start": 0,
"end": 25,
"loc": {
"start": {
"line": 1,
"column": 0
},
"end": {
"line": 1,
"column": 25
}
},
"sourceType": "script",
"body": [
{
"type": "WhileStatement",
"start": 0,
"end": 25,
"loc": {
"start": {
"line": 1,
"column": 0
},
"end": {
"line": 1,
"column": 25
}
},
"test": {
"type": "Literal",
"start": 7,
"end": 11,
"loc": {
"start": {
"line": 1,
"column": 7
},
"end": {
"line": 1,
"column": 11
}
},
"value": true,
"rawValue": true,
"raw": "true"
},
"body": {
"type": "BlockStatement",
"start": 13,
"end": 25,
"loc": {
"start": {
"line": 1,
"column": 13
},
"end": {
"line": 1,
"column": 25
}
},
"body": [
{
"type": "ContinueStatement",
"start": 15,
"end": 23,
"loc": {
"start": {
"line": 1,
"column": 15
},
"end": {
"line": 1,
"column": 23
}
},
"label": null
}
]
}
}
]
}
}

View File

@@ -0,0 +1 @@
done: while (true) { continue done }

View File

@@ -0,0 +1,145 @@
{
"type": "File",
"start": 0,
"end": 36,
"loc": {
"start": {
"line": 1,
"column": 0
},
"end": {
"line": 1,
"column": 36
}
},
"program": {
"type": "Program",
"start": 0,
"end": 36,
"loc": {
"start": {
"line": 1,
"column": 0
},
"end": {
"line": 1,
"column": 36
}
},
"sourceType": "script",
"body": [
{
"type": "LabeledStatement",
"start": 0,
"end": 36,
"loc": {
"start": {
"line": 1,
"column": 0
},
"end": {
"line": 1,
"column": 36
}
},
"body": {
"type": "WhileStatement",
"start": 6,
"end": 36,
"loc": {
"start": {
"line": 1,
"column": 6
},
"end": {
"line": 1,
"column": 36
}
},
"test": {
"type": "Literal",
"start": 13,
"end": 17,
"loc": {
"start": {
"line": 1,
"column": 13
},
"end": {
"line": 1,
"column": 17
}
},
"value": true,
"rawValue": true,
"raw": "true"
},
"body": {
"type": "BlockStatement",
"start": 19,
"end": 36,
"loc": {
"start": {
"line": 1,
"column": 19
},
"end": {
"line": 1,
"column": 36
}
},
"body": [
{
"type": "ContinueStatement",
"start": 21,
"end": 34,
"loc": {
"start": {
"line": 1,
"column": 21
},
"end": {
"line": 1,
"column": 34
}
},
"label": {
"type": "Identifier",
"start": 30,
"end": 34,
"loc": {
"start": {
"line": 1,
"column": 30
},
"end": {
"line": 1,
"column": 34
}
},
"name": "done"
}
}
]
}
},
"label": {
"type": "Identifier",
"start": 0,
"end": 4,
"loc": {
"start": {
"line": 1,
"column": 0
},
"end": {
"line": 1,
"column": 4
}
},
"name": "done"
}
}
]
}
}

View File

@@ -0,0 +1 @@
done: while (true) { continue done; }

View File

@@ -0,0 +1,145 @@
{
"type": "File",
"start": 0,
"end": 37,
"loc": {
"start": {
"line": 1,
"column": 0
},
"end": {
"line": 1,
"column": 37
}
},
"program": {
"type": "Program",
"start": 0,
"end": 37,
"loc": {
"start": {
"line": 1,
"column": 0
},
"end": {
"line": 1,
"column": 37
}
},
"sourceType": "script",
"body": [
{
"type": "LabeledStatement",
"start": 0,
"end": 37,
"loc": {
"start": {
"line": 1,
"column": 0
},
"end": {
"line": 1,
"column": 37
}
},
"body": {
"type": "WhileStatement",
"start": 6,
"end": 37,
"loc": {
"start": {
"line": 1,
"column": 6
},
"end": {
"line": 1,
"column": 37
}
},
"test": {
"type": "Literal",
"start": 13,
"end": 17,
"loc": {
"start": {
"line": 1,
"column": 13
},
"end": {
"line": 1,
"column": 17
}
},
"value": true,
"rawValue": true,
"raw": "true"
},
"body": {
"type": "BlockStatement",
"start": 19,
"end": 37,
"loc": {
"start": {
"line": 1,
"column": 19
},
"end": {
"line": 1,
"column": 37
}
},
"body": [
{
"type": "ContinueStatement",
"start": 21,
"end": 35,
"loc": {
"start": {
"line": 1,
"column": 21
},
"end": {
"line": 1,
"column": 35
}
},
"label": {
"type": "Identifier",
"start": 30,
"end": 34,
"loc": {
"start": {
"line": 1,
"column": 30
},
"end": {
"line": 1,
"column": 34
}
},
"name": "done"
}
}
]
}
},
"label": {
"type": "Identifier",
"start": 0,
"end": 4,
"loc": {
"start": {
"line": 1,
"column": 0
},
"end": {
"line": 1,
"column": 4
}
},
"name": "done"
}
}
]
}
}

View File

@@ -0,0 +1 @@
__proto__: while (true) { continue __proto__; }

View File

@@ -0,0 +1,145 @@
{
"type": "File",
"start": 0,
"end": 47,
"loc": {
"start": {
"line": 1,
"column": 0
},
"end": {
"line": 1,
"column": 47
}
},
"program": {
"type": "Program",
"start": 0,
"end": 47,
"loc": {
"start": {
"line": 1,
"column": 0
},
"end": {
"line": 1,
"column": 47
}
},
"sourceType": "script",
"body": [
{
"type": "LabeledStatement",
"start": 0,
"end": 47,
"loc": {
"start": {
"line": 1,
"column": 0
},
"end": {
"line": 1,
"column": 47
}
},
"body": {
"type": "WhileStatement",
"start": 11,
"end": 47,
"loc": {
"start": {
"line": 1,
"column": 11
},
"end": {
"line": 1,
"column": 47
}
},
"test": {
"type": "Literal",
"start": 18,
"end": 22,
"loc": {
"start": {
"line": 1,
"column": 18
},
"end": {
"line": 1,
"column": 22
}
},
"value": true,
"rawValue": true,
"raw": "true"
},
"body": {
"type": "BlockStatement",
"start": 24,
"end": 47,
"loc": {
"start": {
"line": 1,
"column": 24
},
"end": {
"line": 1,
"column": 47
}
},
"body": [
{
"type": "ContinueStatement",
"start": 26,
"end": 45,
"loc": {
"start": {
"line": 1,
"column": 26
},
"end": {
"line": 1,
"column": 45
}
},
"label": {
"type": "Identifier",
"start": 35,
"end": 44,
"loc": {
"start": {
"line": 1,
"column": 35
},
"end": {
"line": 1,
"column": 44
}
},
"name": "__proto__"
}
}
]
}
},
"label": {
"type": "Identifier",
"start": 0,
"end": 9,
"loc": {
"start": {
"line": 1,
"column": 0
},
"end": {
"line": 1,
"column": 9
}
},
"name": "__proto__"
}
}
]
}
}