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,117 @@
{
"type": "File",
"start": 0,
"end": 32,
"loc": {
"start": {
"line": 1,
"column": 0
},
"end": {
"line": 1,
"column": 32
}
},
"program": {
"type": "Program",
"start": 0,
"end": 32,
"loc": {
"start": {
"line": 1,
"column": 0
},
"end": {
"line": 1,
"column": 32
}
},
"sourceType": "script",
"body": [
{
"type": "FunctionDeclaration",
"start": 0,
"end": 32,
"loc": {
"start": {
"line": 1,
"column": 0
},
"end": {
"line": 1,
"column": 32
}
},
"id": {
"type": "Identifier",
"start": 9,
"end": 13,
"loc": {
"start": {
"line": 1,
"column": 9
},
"end": {
"line": 1,
"column": 13
}
},
"name": "eval"
},
"generator": false,
"expression": false,
"params": [],
"body": {
"type": "BlockStatement",
"start": 16,
"end": 32,
"loc": {
"start": {
"line": 1,
"column": 16
},
"end": {
"line": 1,
"column": 32
}
},
"body": [
{
"type": "ExpressionStatement",
"start": 17,
"end": 30,
"loc": {
"start": {
"line": 1,
"column": 17
},
"end": {
"line": 1,
"column": 30
}
},
"expression": {
"type": "Literal",
"start": 17,
"end": 29,
"loc": {
"start": {
"line": 1,
"column": 17
},
"end": {
"line": 1,
"column": 29
}
},
"value": "use strict",
"rawValue": "use strict",
"raw": "'use strict'"
}
}
]
}
}
]
}
}

View File

@@ -0,0 +1,117 @@
{
"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": "FunctionDeclaration",
"start": 0,
"end": 37,
"loc": {
"start": {
"line": 1,
"column": 0
},
"end": {
"line": 1,
"column": 37
}
},
"id": {
"type": "Identifier",
"start": 9,
"end": 18,
"loc": {
"start": {
"line": 1,
"column": 9
},
"end": {
"line": 1,
"column": 18
}
},
"name": "arguments"
},
"generator": false,
"expression": false,
"params": [],
"body": {
"type": "BlockStatement",
"start": 21,
"end": 37,
"loc": {
"start": {
"line": 1,
"column": 21
},
"end": {
"line": 1,
"column": 37
}
},
"body": [
{
"type": "ExpressionStatement",
"start": 22,
"end": 35,
"loc": {
"start": {
"line": 1,
"column": 22
},
"end": {
"line": 1,
"column": 35
}
},
"expression": {
"type": "Literal",
"start": 22,
"end": 34,
"loc": {
"start": {
"line": 1,
"column": 22
},
"end": {
"line": 1,
"column": 34
}
},
"value": "use strict",
"rawValue": "use strict",
"raw": "'use strict'"
}
}
]
}
}
]
}
}

View File

@@ -0,0 +1,149 @@
{
"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": "ExpressionStatement",
"start": 0,
"end": 36,
"loc": {
"start": {
"line": 1,
"column": 0
},
"end": {
"line": 1,
"column": 36
}
},
"expression": {
"type": "CallExpression",
"start": 0,
"end": 36,
"loc": {
"start": {
"line": 1,
"column": 0
},
"end": {
"line": 1,
"column": 36
}
},
"callee": {
"type": "FunctionExpression",
"start": 1,
"end": 33,
"loc": {
"start": {
"line": 1,
"column": 1
},
"end": {
"line": 1,
"column": 33
}
},
"id": {
"type": "Identifier",
"start": 10,
"end": 14,
"loc": {
"start": {
"line": 1,
"column": 10
},
"end": {
"line": 1,
"column": 14
}
},
"name": "eval"
},
"generator": false,
"expression": false,
"params": [],
"body": {
"type": "BlockStatement",
"start": 17,
"end": 33,
"loc": {
"start": {
"line": 1,
"column": 17
},
"end": {
"line": 1,
"column": 33
}
},
"body": [
{
"type": "ExpressionStatement",
"start": 18,
"end": 31,
"loc": {
"start": {
"line": 1,
"column": 18
},
"end": {
"line": 1,
"column": 31
}
},
"expression": {
"type": "Literal",
"start": 18,
"end": 30,
"loc": {
"start": {
"line": 1,
"column": 18
},
"end": {
"line": 1,
"column": 30
}
},
"value": "use strict",
"rawValue": "use strict",
"raw": "'use strict'"
}
}
]
},
"parenthesizedExpression": true
},
"arguments": []
}
}
]
}
}

View File

@@ -0,0 +1,149 @@
{
"type": "File",
"start": 0,
"end": 41,
"loc": {
"start": {
"line": 1,
"column": 0
},
"end": {
"line": 1,
"column": 41
}
},
"program": {
"type": "Program",
"start": 0,
"end": 41,
"loc": {
"start": {
"line": 1,
"column": 0
},
"end": {
"line": 1,
"column": 41
}
},
"sourceType": "script",
"body": [
{
"type": "ExpressionStatement",
"start": 0,
"end": 41,
"loc": {
"start": {
"line": 1,
"column": 0
},
"end": {
"line": 1,
"column": 41
}
},
"expression": {
"type": "CallExpression",
"start": 0,
"end": 41,
"loc": {
"start": {
"line": 1,
"column": 0
},
"end": {
"line": 1,
"column": 41
}
},
"callee": {
"type": "FunctionExpression",
"start": 1,
"end": 38,
"loc": {
"start": {
"line": 1,
"column": 1
},
"end": {
"line": 1,
"column": 38
}
},
"id": {
"type": "Identifier",
"start": 10,
"end": 19,
"loc": {
"start": {
"line": 1,
"column": 10
},
"end": {
"line": 1,
"column": 19
}
},
"name": "arguments"
},
"generator": false,
"expression": false,
"params": [],
"body": {
"type": "BlockStatement",
"start": 22,
"end": 38,
"loc": {
"start": {
"line": 1,
"column": 22
},
"end": {
"line": 1,
"column": 38
}
},
"body": [
{
"type": "ExpressionStatement",
"start": 23,
"end": 36,
"loc": {
"start": {
"line": 1,
"column": 23
},
"end": {
"line": 1,
"column": 36
}
},
"expression": {
"type": "Literal",
"start": 23,
"end": 35,
"loc": {
"start": {
"line": 1,
"column": 23
},
"end": {
"line": 1,
"column": 35
}
},
"value": "use strict",
"rawValue": "use strict",
"raw": "'use strict'"
}
}
]
},
"parenthesizedExpression": true
},
"arguments": []
}
}
]
}
}

View File

@@ -0,0 +1,149 @@
{
"type": "File",
"start": 0,
"end": 39,
"loc": {
"start": {
"line": 1,
"column": 0
},
"end": {
"line": 1,
"column": 39
}
},
"program": {
"type": "Program",
"start": 0,
"end": 39,
"loc": {
"start": {
"line": 1,
"column": 0
},
"end": {
"line": 1,
"column": 39
}
},
"sourceType": "script",
"body": [
{
"type": "ExpressionStatement",
"start": 0,
"end": 39,
"loc": {
"start": {
"line": 1,
"column": 0
},
"end": {
"line": 1,
"column": 39
}
},
"expression": {
"type": "CallExpression",
"start": 0,
"end": 39,
"loc": {
"start": {
"line": 1,
"column": 0
},
"end": {
"line": 1,
"column": 39
}
},
"callee": {
"type": "FunctionExpression",
"start": 1,
"end": 36,
"loc": {
"start": {
"line": 1,
"column": 1
},
"end": {
"line": 1,
"column": 36
}
},
"id": {
"type": "Identifier",
"start": 10,
"end": 17,
"loc": {
"start": {
"line": 1,
"column": 10
},
"end": {
"line": 1,
"column": 17
}
},
"name": "package"
},
"generator": false,
"expression": false,
"params": [],
"body": {
"type": "BlockStatement",
"start": 20,
"end": 36,
"loc": {
"start": {
"line": 1,
"column": 20
},
"end": {
"line": 1,
"column": 36
}
},
"body": [
{
"type": "ExpressionStatement",
"start": 21,
"end": 34,
"loc": {
"start": {
"line": 1,
"column": 21
},
"end": {
"line": 1,
"column": 34
}
},
"expression": {
"type": "Literal",
"start": 21,
"end": 33,
"loc": {
"start": {
"line": 1,
"column": 21
},
"end": {
"line": 1,
"column": 33
}
},
"value": "use strict",
"rawValue": "use strict",
"raw": "'use strict'"
}
}
]
},
"parenthesizedExpression": true
},
"arguments": []
}
}
]
}
}

View File

@@ -0,0 +1,134 @@
{
"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": "FunctionDeclaration",
"start": 0,
"end": 36,
"loc": {
"start": {
"line": 1,
"column": 0
},
"end": {
"line": 1,
"column": 36
}
},
"id": {
"type": "Identifier",
"start": 9,
"end": 14,
"loc": {
"start": {
"line": 1,
"column": 9
},
"end": {
"line": 1,
"column": 14
}
},
"name": "hello"
},
"generator": false,
"expression": false,
"params": [
{
"type": "Identifier",
"start": 15,
"end": 19,
"loc": {
"start": {
"line": 1,
"column": 15
},
"end": {
"line": 1,
"column": 19
}
},
"name": "eval"
}
],
"body": {
"type": "BlockStatement",
"start": 21,
"end": 36,
"loc": {
"start": {
"line": 1,
"column": 21
},
"end": {
"line": 1,
"column": 36
}
},
"body": [
{
"type": "ExpressionStatement",
"start": 22,
"end": 35,
"loc": {
"start": {
"line": 1,
"column": 22
},
"end": {
"line": 1,
"column": 35
}
},
"expression": {
"type": "Literal",
"start": 22,
"end": 34,
"loc": {
"start": {
"line": 1,
"column": 22
},
"end": {
"line": 1,
"column": 34
}
},
"value": "use strict",
"rawValue": "use strict",
"raw": "'use strict'"
}
}
]
}
}
]
}
}

View File

@@ -0,0 +1,134 @@
{
"type": "File",
"start": 0,
"end": 41,
"loc": {
"start": {
"line": 1,
"column": 0
},
"end": {
"line": 1,
"column": 41
}
},
"program": {
"type": "Program",
"start": 0,
"end": 41,
"loc": {
"start": {
"line": 1,
"column": 0
},
"end": {
"line": 1,
"column": 41
}
},
"sourceType": "script",
"body": [
{
"type": "FunctionDeclaration",
"start": 0,
"end": 41,
"loc": {
"start": {
"line": 1,
"column": 0
},
"end": {
"line": 1,
"column": 41
}
},
"id": {
"type": "Identifier",
"start": 9,
"end": 14,
"loc": {
"start": {
"line": 1,
"column": 9
},
"end": {
"line": 1,
"column": 14
}
},
"name": "hello"
},
"generator": false,
"expression": false,
"params": [
{
"type": "Identifier",
"start": 15,
"end": 24,
"loc": {
"start": {
"line": 1,
"column": 15
},
"end": {
"line": 1,
"column": 24
}
},
"name": "arguments"
}
],
"body": {
"type": "BlockStatement",
"start": 26,
"end": 41,
"loc": {
"start": {
"line": 1,
"column": 26
},
"end": {
"line": 1,
"column": 41
}
},
"body": [
{
"type": "ExpressionStatement",
"start": 27,
"end": 40,
"loc": {
"start": {
"line": 1,
"column": 27
},
"end": {
"line": 1,
"column": 40
}
},
"expression": {
"type": "Literal",
"start": 27,
"end": 39,
"loc": {
"start": {
"line": 1,
"column": 27
},
"end": {
"line": 1,
"column": 39
}
},
"value": "use strict",
"rawValue": "use strict",
"raw": "'use strict'"
}
}
]
}
}
]
}
}

View File

@@ -0,0 +1,134 @@
{
"type": "File",
"start": 0,
"end": 40,
"loc": {
"start": {
"line": 1,
"column": 0
},
"end": {
"line": 1,
"column": 40
}
},
"program": {
"type": "Program",
"start": 0,
"end": 40,
"loc": {
"start": {
"line": 1,
"column": 0
},
"end": {
"line": 1,
"column": 40
}
},
"sourceType": "script",
"body": [
{
"type": "FunctionDeclaration",
"start": 0,
"end": 40,
"loc": {
"start": {
"line": 1,
"column": 0
},
"end": {
"line": 1,
"column": 40
}
},
"id": {
"type": "Identifier",
"start": 9,
"end": 14,
"loc": {
"start": {
"line": 1,
"column": 9
},
"end": {
"line": 1,
"column": 14
}
},
"name": "hello"
},
"generator": false,
"expression": false,
"params": [
{
"type": "Identifier",
"start": 15,
"end": 21,
"loc": {
"start": {
"line": 1,
"column": 15
},
"end": {
"line": 1,
"column": 21
}
},
"name": "static"
}
],
"body": {
"type": "BlockStatement",
"start": 23,
"end": 40,
"loc": {
"start": {
"line": 1,
"column": 23
},
"end": {
"line": 1,
"column": 40
}
},
"body": [
{
"type": "ExpressionStatement",
"start": 25,
"end": 38,
"loc": {
"start": {
"line": 1,
"column": 25
},
"end": {
"line": 1,
"column": 38
}
},
"expression": {
"type": "Literal",
"start": 25,
"end": 37,
"loc": {
"start": {
"line": 1,
"column": 25
},
"end": {
"line": 1,
"column": 37
}
},
"value": "use strict",
"rawValue": "use strict",
"raw": "\"use strict\""
}
}
]
}
}
]
}
}

View File

@@ -0,0 +1,117 @@
{
"type": "File",
"start": 0,
"end": 35,
"loc": {
"start": {
"line": 1,
"column": 0
},
"end": {
"line": 1,
"column": 35
}
},
"program": {
"type": "Program",
"start": 0,
"end": 35,
"loc": {
"start": {
"line": 1,
"column": 0
},
"end": {
"line": 1,
"column": 35
}
},
"sourceType": "script",
"body": [
{
"type": "FunctionDeclaration",
"start": 0,
"end": 35,
"loc": {
"start": {
"line": 1,
"column": 0
},
"end": {
"line": 1,
"column": 35
}
},
"id": {
"type": "Identifier",
"start": 9,
"end": 15,
"loc": {
"start": {
"line": 1,
"column": 9
},
"end": {
"line": 1,
"column": 15
}
},
"name": "static"
},
"generator": false,
"expression": false,
"params": [],
"body": {
"type": "BlockStatement",
"start": 18,
"end": 35,
"loc": {
"start": {
"line": 1,
"column": 18
},
"end": {
"line": 1,
"column": 35
}
},
"body": [
{
"type": "ExpressionStatement",
"start": 20,
"end": 33,
"loc": {
"start": {
"line": 1,
"column": 20
},
"end": {
"line": 1,
"column": 33
}
},
"expression": {
"type": "Literal",
"start": 20,
"end": 32,
"loc": {
"start": {
"line": 1,
"column": 20
},
"end": {
"line": 1,
"column": 32
}
},
"value": "use strict",
"rawValue": "use strict",
"raw": "\"use strict\""
}
}
]
}
}
]
}
}

View File

@@ -0,0 +1,134 @@
{
"type": "File",
"start": 0,
"end": 34,
"loc": {
"start": {
"line": 1,
"column": 0
},
"end": {
"line": 1,
"column": 34
}
},
"program": {
"type": "Program",
"start": 0,
"end": 34,
"loc": {
"start": {
"line": 1,
"column": 0
},
"end": {
"line": 1,
"column": 34
}
},
"sourceType": "script",
"body": [
{
"type": "FunctionDeclaration",
"start": 0,
"end": 34,
"loc": {
"start": {
"line": 1,
"column": 0
},
"end": {
"line": 1,
"column": 34
}
},
"id": {
"type": "Identifier",
"start": 9,
"end": 10,
"loc": {
"start": {
"line": 1,
"column": 9
},
"end": {
"line": 1,
"column": 10
}
},
"name": "a"
},
"generator": false,
"expression": false,
"params": [
{
"type": "Identifier",
"start": 11,
"end": 15,
"loc": {
"start": {
"line": 1,
"column": 11
},
"end": {
"line": 1,
"column": 15
}
},
"name": "eval"
}
],
"body": {
"type": "BlockStatement",
"start": 17,
"end": 34,
"loc": {
"start": {
"line": 1,
"column": 17
},
"end": {
"line": 1,
"column": 34
}
},
"body": [
{
"type": "ExpressionStatement",
"start": 19,
"end": 32,
"loc": {
"start": {
"line": 1,
"column": 19
},
"end": {
"line": 1,
"column": 32
}
},
"expression": {
"type": "Literal",
"start": 19,
"end": 31,
"loc": {
"start": {
"line": 1,
"column": 19
},
"end": {
"line": 1,
"column": 31
}
},
"value": "use strict",
"rawValue": "use strict",
"raw": "\"use strict\""
}
}
]
}
}
]
}
}

View File

@@ -0,0 +1,134 @@
{
"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": "FunctionDeclaration",
"start": 0,
"end": 37,
"loc": {
"start": {
"line": 1,
"column": 0
},
"end": {
"line": 1,
"column": 37
}
},
"id": {
"type": "Identifier",
"start": 9,
"end": 10,
"loc": {
"start": {
"line": 1,
"column": 9
},
"end": {
"line": 1,
"column": 10
}
},
"name": "a"
},
"generator": false,
"expression": false,
"params": [
{
"type": "Identifier",
"start": 11,
"end": 18,
"loc": {
"start": {
"line": 1,
"column": 11
},
"end": {
"line": 1,
"column": 18
}
},
"name": "package"
}
],
"body": {
"type": "BlockStatement",
"start": 20,
"end": 37,
"loc": {
"start": {
"line": 1,
"column": 20
},
"end": {
"line": 1,
"column": 37
}
},
"body": [
{
"type": "ExpressionStatement",
"start": 22,
"end": 35,
"loc": {
"start": {
"line": 1,
"column": 22
},
"end": {
"line": 1,
"column": 35
}
},
"expression": {
"type": "Literal",
"start": 22,
"end": 34,
"loc": {
"start": {
"line": 1,
"column": 22
},
"end": {
"line": 1,
"column": 34
}
},
"value": "use strict",
"rawValue": "use strict",
"raw": "\"use strict\""
}
}
]
}
}
]
}
}

View File

@@ -0,0 +1,150 @@
{
"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": "ExpressionStatement",
"start": 0,
"end": 36,
"loc": {
"start": {
"line": 1,
"column": 0
},
"end": {
"line": 1,
"column": 36
}
},
"expression": {
"type": "FunctionExpression",
"start": 1,
"end": 35,
"loc": {
"start": {
"line": 1,
"column": 1
},
"end": {
"line": 1,
"column": 35
}
},
"id": {
"type": "Identifier",
"start": 10,
"end": 11,
"loc": {
"start": {
"line": 1,
"column": 10
},
"end": {
"line": 1,
"column": 11
}
},
"name": "a"
},
"generator": false,
"expression": false,
"params": [
{
"type": "Identifier",
"start": 12,
"end": 16,
"loc": {
"start": {
"line": 1,
"column": 12
},
"end": {
"line": 1,
"column": 16
}
},
"name": "eval"
}
],
"body": {
"type": "BlockStatement",
"start": 18,
"end": 35,
"loc": {
"start": {
"line": 1,
"column": 18
},
"end": {
"line": 1,
"column": 35
}
},
"body": [
{
"type": "ExpressionStatement",
"start": 20,
"end": 33,
"loc": {
"start": {
"line": 1,
"column": 20
},
"end": {
"line": 1,
"column": 33
}
},
"expression": {
"type": "Literal",
"start": 20,
"end": 32,
"loc": {
"start": {
"line": 1,
"column": 20
},
"end": {
"line": 1,
"column": 32
}
},
"value": "use strict",
"rawValue": "use strict",
"raw": "\"use strict\""
}
}
]
},
"parenthesizedExpression": true
}
}
]
}
}

View File

@@ -0,0 +1,150 @@
{
"type": "File",
"start": 0,
"end": 39,
"loc": {
"start": {
"line": 1,
"column": 0
},
"end": {
"line": 1,
"column": 39
}
},
"program": {
"type": "Program",
"start": 0,
"end": 39,
"loc": {
"start": {
"line": 1,
"column": 0
},
"end": {
"line": 1,
"column": 39
}
},
"sourceType": "script",
"body": [
{
"type": "ExpressionStatement",
"start": 0,
"end": 39,
"loc": {
"start": {
"line": 1,
"column": 0
},
"end": {
"line": 1,
"column": 39
}
},
"expression": {
"type": "FunctionExpression",
"start": 1,
"end": 38,
"loc": {
"start": {
"line": 1,
"column": 1
},
"end": {
"line": 1,
"column": 38
}
},
"id": {
"type": "Identifier",
"start": 10,
"end": 11,
"loc": {
"start": {
"line": 1,
"column": 10
},
"end": {
"line": 1,
"column": 11
}
},
"name": "a"
},
"generator": false,
"expression": false,
"params": [
{
"type": "Identifier",
"start": 12,
"end": 19,
"loc": {
"start": {
"line": 1,
"column": 12
},
"end": {
"line": 1,
"column": 19
}
},
"name": "package"
}
],
"body": {
"type": "BlockStatement",
"start": 21,
"end": 38,
"loc": {
"start": {
"line": 1,
"column": 21
},
"end": {
"line": 1,
"column": 38
}
},
"body": [
{
"type": "ExpressionStatement",
"start": 23,
"end": 36,
"loc": {
"start": {
"line": 1,
"column": 23
},
"end": {
"line": 1,
"column": 36
}
},
"expression": {
"type": "Literal",
"start": 23,
"end": 35,
"loc": {
"start": {
"line": 1,
"column": 23
},
"end": {
"line": 1,
"column": 35
}
},
"value": "use strict",
"rawValue": "use strict",
"raw": "\"use strict\""
}
}
]
},
"parenthesizedExpression": true
}
}
]
}
}

View File

@@ -0,0 +1,83 @@
{
"type": "File",
"start": 0,
"end": 8,
"loc": {
"start": {
"line": 1,
"column": 0
},
"end": {
"line": 1,
"column": 8
}
},
"program": {
"type": "Program",
"start": 0,
"end": 8,
"loc": {
"start": {
"line": 1,
"column": 0
},
"end": {
"line": 1,
"column": 8
}
},
"sourceType": "script",
"body": [
{
"type": "VariableDeclaration",
"start": 0,
"end": 8,
"loc": {
"start": {
"line": 1,
"column": 0
},
"end": {
"line": 1,
"column": 8
}
},
"declarations": [
{
"type": "VariableDeclarator",
"start": 6,
"end": 7,
"loc": {
"start": {
"line": 1,
"column": 6
},
"end": {
"line": 1,
"column": 7
}
},
"id": {
"type": "Identifier",
"start": 6,
"end": 7,
"loc": {
"start": {
"line": 1,
"column": 6
},
"end": {
"line": 1,
"column": 7
}
},
"name": "a"
},
"init": null
}
],
"kind": "var"
}
]
}
}

21
test/fixtures/esprima/LICENSE vendored Normal file
View File

@@ -0,0 +1,21 @@
Copyright (c) jQuery Foundation, Inc. and Contributors, All Rights Reserved.
Redistribution and use in source and binary forms, with or without
modification, are permitted provided that the following conditions are met:
* Redistributions of source code must retain the above copyright
notice, this list of conditions and the following disclaimer.
* Redistributions in binary form must reproduce the above copyright
notice, this list of conditions and the following disclaimer in the
documentation and/or other materials provided with the distribution.
THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
ARE DISCLAIMED. IN NO EVENT SHALL <COPYRIGHT HOLDER> BE LIABLE FOR ANY
DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
(INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
(INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF
THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.

View File

@@ -0,0 +1,2 @@
{ x
++y }

View File

@@ -0,0 +1,129 @@
{
"type": "File",
"start": 0,
"end": 9,
"loc": {
"start": {
"line": 1,
"column": 0
},
"end": {
"line": 2,
"column": 5
}
},
"program": {
"type": "Program",
"start": 0,
"end": 9,
"loc": {
"start": {
"line": 1,
"column": 0
},
"end": {
"line": 2,
"column": 5
}
},
"sourceType": "script",
"body": [
{
"type": "BlockStatement",
"start": 0,
"end": 9,
"loc": {
"start": {
"line": 1,
"column": 0
},
"end": {
"line": 2,
"column": 5
}
},
"body": [
{
"type": "ExpressionStatement",
"start": 2,
"end": 3,
"loc": {
"start": {
"line": 1,
"column": 2
},
"end": {
"line": 1,
"column": 3
}
},
"expression": {
"type": "Identifier",
"start": 2,
"end": 3,
"loc": {
"start": {
"line": 1,
"column": 2
},
"end": {
"line": 1,
"column": 3
}
},
"name": "x"
}
},
{
"type": "ExpressionStatement",
"start": 4,
"end": 7,
"loc": {
"start": {
"line": 2,
"column": 0
},
"end": {
"line": 2,
"column": 3
}
},
"expression": {
"type": "UpdateExpression",
"start": 4,
"end": 7,
"loc": {
"start": {
"line": 2,
"column": 0
},
"end": {
"line": 2,
"column": 3
}
},
"operator": "++",
"prefix": true,
"argument": {
"type": "Identifier",
"start": 6,
"end": 7,
"loc": {
"start": {
"line": 2,
"column": 2
},
"end": {
"line": 2,
"column": 3
}
},
"name": "y"
}
}
}
]
}
]
}
}

View File

@@ -0,0 +1,2 @@
{ x
--y }

View File

@@ -0,0 +1,129 @@
{
"type": "File",
"start": 0,
"end": 9,
"loc": {
"start": {
"line": 1,
"column": 0
},
"end": {
"line": 2,
"column": 5
}
},
"program": {
"type": "Program",
"start": 0,
"end": 9,
"loc": {
"start": {
"line": 1,
"column": 0
},
"end": {
"line": 2,
"column": 5
}
},
"sourceType": "script",
"body": [
{
"type": "BlockStatement",
"start": 0,
"end": 9,
"loc": {
"start": {
"line": 1,
"column": 0
},
"end": {
"line": 2,
"column": 5
}
},
"body": [
{
"type": "ExpressionStatement",
"start": 2,
"end": 3,
"loc": {
"start": {
"line": 1,
"column": 2
},
"end": {
"line": 1,
"column": 3
}
},
"expression": {
"type": "Identifier",
"start": 2,
"end": 3,
"loc": {
"start": {
"line": 1,
"column": 2
},
"end": {
"line": 1,
"column": 3
}
},
"name": "x"
}
},
{
"type": "ExpressionStatement",
"start": 4,
"end": 7,
"loc": {
"start": {
"line": 2,
"column": 0
},
"end": {
"line": 2,
"column": 3
}
},
"expression": {
"type": "UpdateExpression",
"start": 4,
"end": 7,
"loc": {
"start": {
"line": 2,
"column": 0
},
"end": {
"line": 2,
"column": 3
}
},
"operator": "--",
"prefix": true,
"argument": {
"type": "Identifier",
"start": 6,
"end": 7,
"loc": {
"start": {
"line": 2,
"column": 2
},
"end": {
"line": 2,
"column": 3
}
},
"name": "y"
}
}
}
]
}
]
}
}

View File

@@ -0,0 +1 @@
var x /* comment */;

View File

@@ -0,0 +1,129 @@
{
"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": 5,
"loc": {
"start": {
"line": 1,
"column": 4
},
"end": {
"line": 1,
"column": 5
}
},
"id": {
"type": "Identifier",
"start": 4,
"end": 5,
"loc": {
"start": {
"line": 1,
"column": 4
},
"end": {
"line": 1,
"column": 5
}
},
"name": "x",
"leadingComments": null,
"trailingComments": null
},
"init": null,
"trailingComments": [
{
"type": "CommentBlock",
"value": " comment ",
"start": 6,
"end": 19,
"loc": {
"start": {
"line": 1,
"column": 6
},
"end": {
"line": 1,
"column": 19
}
},
"range": [
6,
19
]
}
]
}
],
"kind": "var"
}
]
},
"comments": [
{
"type": "CommentBlock",
"value": " comment ",
"start": 6,
"end": 19,
"loc": {
"start": {
"line": 1,
"column": 6
},
"end": {
"line": 1,
"column": 19
}
},
"range": [
6,
19
]
}
]
}

View File

@@ -0,0 +1,2 @@
{ var x = 14, y = 3
z; }

View File

@@ -0,0 +1,197 @@
{
"type": "File",
"start": 0,
"end": 24,
"loc": {
"start": {
"line": 1,
"column": 0
},
"end": {
"line": 2,
"column": 4
}
},
"program": {
"type": "Program",
"start": 0,
"end": 24,
"loc": {
"start": {
"line": 1,
"column": 0
},
"end": {
"line": 2,
"column": 4
}
},
"sourceType": "script",
"body": [
{
"type": "BlockStatement",
"start": 0,
"end": 24,
"loc": {
"start": {
"line": 1,
"column": 0
},
"end": {
"line": 2,
"column": 4
}
},
"body": [
{
"type": "VariableDeclaration",
"start": 2,
"end": 19,
"loc": {
"start": {
"line": 1,
"column": 2
},
"end": {
"line": 1,
"column": 19
}
},
"declarations": [
{
"type": "VariableDeclarator",
"start": 6,
"end": 12,
"loc": {
"start": {
"line": 1,
"column": 6
},
"end": {
"line": 1,
"column": 12
}
},
"id": {
"type": "Identifier",
"start": 6,
"end": 7,
"loc": {
"start": {
"line": 1,
"column": 6
},
"end": {
"line": 1,
"column": 7
}
},
"name": "x"
},
"init": {
"type": "Literal",
"start": 10,
"end": 12,
"loc": {
"start": {
"line": 1,
"column": 10
},
"end": {
"line": 1,
"column": 12
}
},
"value": 14,
"rawValue": 14,
"raw": "14"
}
},
{
"type": "VariableDeclarator",
"start": 14,
"end": 19,
"loc": {
"start": {
"line": 1,
"column": 14
},
"end": {
"line": 1,
"column": 19
}
},
"id": {
"type": "Identifier",
"start": 14,
"end": 15,
"loc": {
"start": {
"line": 1,
"column": 14
},
"end": {
"line": 1,
"column": 15
}
},
"name": "y"
},
"init": {
"type": "Literal",
"start": 18,
"end": 19,
"loc": {
"start": {
"line": 1,
"column": 18
},
"end": {
"line": 1,
"column": 19
}
},
"value": 3,
"rawValue": 3,
"raw": "3"
}
}
],
"kind": "var"
},
{
"type": "ExpressionStatement",
"start": 20,
"end": 22,
"loc": {
"start": {
"line": 2,
"column": 0
},
"end": {
"line": 2,
"column": 2
}
},
"expression": {
"type": "Identifier",
"start": 20,
"end": 21,
"loc": {
"start": {
"line": 2,
"column": 0
},
"end": {
"line": 2,
"column": 1
}
},
"name": "z"
}
}
]
}
]
}
}

View File

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

View File

@@ -0,0 +1,130 @@
{
"type": "File",
"start": 0,
"end": 32,
"loc": {
"start": {
"line": 1,
"column": 0
},
"end": {
"line": 2,
"column": 8
}
},
"program": {
"type": "Program",
"start": 0,
"end": 32,
"loc": {
"start": {
"line": 1,
"column": 0
},
"end": {
"line": 2,
"column": 8
}
},
"sourceType": "script",
"body": [
{
"type": "WhileStatement",
"start": 0,
"end": 32,
"loc": {
"start": {
"line": 1,
"column": 0
},
"end": {
"line": 2,
"column": 8
}
},
"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": 32,
"loc": {
"start": {
"line": 1,
"column": 13
},
"end": {
"line": 2,
"column": 8
}
},
"body": [
{
"type": "ContinueStatement",
"start": 15,
"end": 23,
"loc": {
"start": {
"line": 1,
"column": 15
},
"end": {
"line": 1,
"column": 23
}
},
"label": null
},
{
"type": "ExpressionStatement",
"start": 24,
"end": 30,
"loc": {
"start": {
"line": 2,
"column": 0
},
"end": {
"line": 2,
"column": 6
}
},
"expression": {
"type": "Identifier",
"start": 24,
"end": 29,
"loc": {
"start": {
"line": 2,
"column": 0
},
"end": {
"line": 2,
"column": 5
}
},
"name": "there"
}
}
]
}
}
]
}
}

View File

@@ -0,0 +1,2 @@
while (true) { continue // Comment
there; }

View File

@@ -0,0 +1,198 @@
{
"type": "File",
"start": 0,
"end": 43,
"loc": {
"start": {
"line": 1,
"column": 0
},
"end": {
"line": 2,
"column": 8
}
},
"program": {
"type": "Program",
"start": 0,
"end": 43,
"loc": {
"start": {
"line": 1,
"column": 0
},
"end": {
"line": 2,
"column": 8
}
},
"sourceType": "script",
"body": [
{
"type": "WhileStatement",
"start": 0,
"end": 43,
"loc": {
"start": {
"line": 1,
"column": 0
},
"end": {
"line": 2,
"column": 8
}
},
"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": 43,
"loc": {
"start": {
"line": 1,
"column": 13
},
"end": {
"line": 2,
"column": 8
}
},
"body": [
{
"type": "ContinueStatement",
"start": 15,
"end": 23,
"loc": {
"start": {
"line": 1,
"column": 15
},
"end": {
"line": 1,
"column": 23
}
},
"label": null,
"leadingComments": null,
"trailingComments": [
{
"type": "CommentLine",
"value": " Comment",
"start": 24,
"end": 34,
"loc": {
"start": {
"line": 1,
"column": 24
},
"end": {
"line": 1,
"column": 34
}
},
"range": [
24,
34
]
}
]
},
{
"type": "ExpressionStatement",
"start": 35,
"end": 41,
"loc": {
"start": {
"line": 2,
"column": 0
},
"end": {
"line": 2,
"column": 6
}
},
"expression": {
"type": "Identifier",
"start": 35,
"end": 40,
"loc": {
"start": {
"line": 2,
"column": 0
},
"end": {
"line": 2,
"column": 5
}
},
"name": "there",
"leadingComments": null
},
"leadingComments": [
{
"type": "CommentLine",
"value": " Comment",
"start": 24,
"end": 34,
"loc": {
"start": {
"line": 1,
"column": 24
},
"end": {
"line": 1,
"column": 34
}
},
"range": [
24,
34
]
}
]
}
]
}
}
]
},
"comments": [
{
"type": "CommentLine",
"value": " Comment",
"start": 24,
"end": 34,
"loc": {
"start": {
"line": 1,
"column": 24
},
"end": {
"line": 1,
"column": 34
}
},
"range": [
24,
34
]
}
]
}

View File

@@ -0,0 +1,2 @@
while (true) { continue /* Multiline
Comment */there; }

View File

@@ -0,0 +1,198 @@
{
"type": "File",
"start": 0,
"end": 55,
"loc": {
"start": {
"line": 1,
"column": 0
},
"end": {
"line": 2,
"column": 18
}
},
"program": {
"type": "Program",
"start": 0,
"end": 55,
"loc": {
"start": {
"line": 1,
"column": 0
},
"end": {
"line": 2,
"column": 18
}
},
"sourceType": "script",
"body": [
{
"type": "WhileStatement",
"start": 0,
"end": 55,
"loc": {
"start": {
"line": 1,
"column": 0
},
"end": {
"line": 2,
"column": 18
}
},
"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": 55,
"loc": {
"start": {
"line": 1,
"column": 13
},
"end": {
"line": 2,
"column": 18
}
},
"body": [
{
"type": "ContinueStatement",
"start": 15,
"end": 23,
"loc": {
"start": {
"line": 1,
"column": 15
},
"end": {
"line": 1,
"column": 23
}
},
"label": null,
"leadingComments": null,
"trailingComments": [
{
"type": "CommentBlock",
"value": " Multiline\nComment ",
"start": 24,
"end": 47,
"loc": {
"start": {
"line": 1,
"column": 24
},
"end": {
"line": 2,
"column": 10
}
},
"range": [
24,
47
]
}
]
},
{
"type": "ExpressionStatement",
"start": 47,
"end": 53,
"loc": {
"start": {
"line": 2,
"column": 10
},
"end": {
"line": 2,
"column": 16
}
},
"expression": {
"type": "Identifier",
"start": 47,
"end": 52,
"loc": {
"start": {
"line": 2,
"column": 10
},
"end": {
"line": 2,
"column": 15
}
},
"name": "there",
"leadingComments": null
},
"leadingComments": [
{
"type": "CommentBlock",
"value": " Multiline\nComment ",
"start": 24,
"end": 47,
"loc": {
"start": {
"line": 1,
"column": 24
},
"end": {
"line": 2,
"column": 10
}
},
"range": [
24,
47
]
}
]
}
]
}
}
]
},
"comments": [
{
"type": "CommentBlock",
"value": " Multiline\nComment ",
"start": 24,
"end": 47,
"loc": {
"start": {
"line": 1,
"column": 24
},
"end": {
"line": 2,
"column": 10
}
},
"range": [
24,
47
]
}
]
}

View File

@@ -0,0 +1,2 @@
while (true) { break
there; }

View File

@@ -0,0 +1,130 @@
{
"type": "File",
"start": 0,
"end": 29,
"loc": {
"start": {
"line": 1,
"column": 0
},
"end": {
"line": 2,
"column": 8
}
},
"program": {
"type": "Program",
"start": 0,
"end": 29,
"loc": {
"start": {
"line": 1,
"column": 0
},
"end": {
"line": 2,
"column": 8
}
},
"sourceType": "script",
"body": [
{
"type": "WhileStatement",
"start": 0,
"end": 29,
"loc": {
"start": {
"line": 1,
"column": 0
},
"end": {
"line": 2,
"column": 8
}
},
"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": 29,
"loc": {
"start": {
"line": 1,
"column": 13
},
"end": {
"line": 2,
"column": 8
}
},
"body": [
{
"type": "BreakStatement",
"start": 15,
"end": 20,
"loc": {
"start": {
"line": 1,
"column": 15
},
"end": {
"line": 1,
"column": 20
}
},
"label": null
},
{
"type": "ExpressionStatement",
"start": 21,
"end": 27,
"loc": {
"start": {
"line": 2,
"column": 0
},
"end": {
"line": 2,
"column": 6
}
},
"expression": {
"type": "Identifier",
"start": 21,
"end": 26,
"loc": {
"start": {
"line": 2,
"column": 0
},
"end": {
"line": 2,
"column": 5
}
},
"name": "there"
}
}
]
}
}
]
}
}

View File

@@ -0,0 +1,2 @@
while (true) { break // Comment
there; }

View File

@@ -0,0 +1,198 @@
{
"type": "File",
"start": 0,
"end": 40,
"loc": {
"start": {
"line": 1,
"column": 0
},
"end": {
"line": 2,
"column": 8
}
},
"program": {
"type": "Program",
"start": 0,
"end": 40,
"loc": {
"start": {
"line": 1,
"column": 0
},
"end": {
"line": 2,
"column": 8
}
},
"sourceType": "script",
"body": [
{
"type": "WhileStatement",
"start": 0,
"end": 40,
"loc": {
"start": {
"line": 1,
"column": 0
},
"end": {
"line": 2,
"column": 8
}
},
"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": 40,
"loc": {
"start": {
"line": 1,
"column": 13
},
"end": {
"line": 2,
"column": 8
}
},
"body": [
{
"type": "BreakStatement",
"start": 15,
"end": 20,
"loc": {
"start": {
"line": 1,
"column": 15
},
"end": {
"line": 1,
"column": 20
}
},
"label": null,
"leadingComments": null,
"trailingComments": [
{
"type": "CommentLine",
"value": " Comment",
"start": 21,
"end": 31,
"loc": {
"start": {
"line": 1,
"column": 21
},
"end": {
"line": 1,
"column": 31
}
},
"range": [
21,
31
]
}
]
},
{
"type": "ExpressionStatement",
"start": 32,
"end": 38,
"loc": {
"start": {
"line": 2,
"column": 0
},
"end": {
"line": 2,
"column": 6
}
},
"expression": {
"type": "Identifier",
"start": 32,
"end": 37,
"loc": {
"start": {
"line": 2,
"column": 0
},
"end": {
"line": 2,
"column": 5
}
},
"name": "there",
"leadingComments": null
},
"leadingComments": [
{
"type": "CommentLine",
"value": " Comment",
"start": 21,
"end": 31,
"loc": {
"start": {
"line": 1,
"column": 21
},
"end": {
"line": 1,
"column": 31
}
},
"range": [
21,
31
]
}
]
}
]
}
}
]
},
"comments": [
{
"type": "CommentLine",
"value": " Comment",
"start": 21,
"end": 31,
"loc": {
"start": {
"line": 1,
"column": 21
},
"end": {
"line": 1,
"column": 31
}
},
"range": [
21,
31
]
}
]
}

View File

@@ -0,0 +1,2 @@
while (true) { break /* Multiline
Comment */there; }

View File

@@ -0,0 +1,198 @@
{
"type": "File",
"start": 0,
"end": 52,
"loc": {
"start": {
"line": 1,
"column": 0
},
"end": {
"line": 2,
"column": 18
}
},
"program": {
"type": "Program",
"start": 0,
"end": 52,
"loc": {
"start": {
"line": 1,
"column": 0
},
"end": {
"line": 2,
"column": 18
}
},
"sourceType": "script",
"body": [
{
"type": "WhileStatement",
"start": 0,
"end": 52,
"loc": {
"start": {
"line": 1,
"column": 0
},
"end": {
"line": 2,
"column": 18
}
},
"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": 52,
"loc": {
"start": {
"line": 1,
"column": 13
},
"end": {
"line": 2,
"column": 18
}
},
"body": [
{
"type": "BreakStatement",
"start": 15,
"end": 20,
"loc": {
"start": {
"line": 1,
"column": 15
},
"end": {
"line": 1,
"column": 20
}
},
"label": null,
"leadingComments": null,
"trailingComments": [
{
"type": "CommentBlock",
"value": " Multiline\nComment ",
"start": 21,
"end": 44,
"loc": {
"start": {
"line": 1,
"column": 21
},
"end": {
"line": 2,
"column": 10
}
},
"range": [
21,
44
]
}
]
},
{
"type": "ExpressionStatement",
"start": 44,
"end": 50,
"loc": {
"start": {
"line": 2,
"column": 10
},
"end": {
"line": 2,
"column": 16
}
},
"expression": {
"type": "Identifier",
"start": 44,
"end": 49,
"loc": {
"start": {
"line": 2,
"column": 10
},
"end": {
"line": 2,
"column": 15
}
},
"name": "there",
"leadingComments": null
},
"leadingComments": [
{
"type": "CommentBlock",
"value": " Multiline\nComment ",
"start": 21,
"end": 44,
"loc": {
"start": {
"line": 1,
"column": 21
},
"end": {
"line": 2,
"column": 10
}
},
"range": [
21,
44
]
}
]
}
]
}
}
]
},
"comments": [
{
"type": "CommentBlock",
"value": " Multiline\nComment ",
"start": 21,
"end": 44,
"loc": {
"start": {
"line": 1,
"column": 21
},
"end": {
"line": 2,
"column": 10
}
},
"range": [
21,
44
]
}
]
}

View File

@@ -0,0 +1,2 @@
(function(){ return
x; })

View File

@@ -0,0 +1,132 @@
{
"type": "File",
"start": 0,
"end": 25,
"loc": {
"start": {
"line": 1,
"column": 0
},
"end": {
"line": 2,
"column": 5
}
},
"program": {
"type": "Program",
"start": 0,
"end": 25,
"loc": {
"start": {
"line": 1,
"column": 0
},
"end": {
"line": 2,
"column": 5
}
},
"sourceType": "script",
"body": [
{
"type": "ExpressionStatement",
"start": 0,
"end": 25,
"loc": {
"start": {
"line": 1,
"column": 0
},
"end": {
"line": 2,
"column": 5
}
},
"expression": {
"type": "FunctionExpression",
"start": 1,
"end": 24,
"loc": {
"start": {
"line": 1,
"column": 1
},
"end": {
"line": 2,
"column": 4
}
},
"id": null,
"generator": false,
"expression": false,
"params": [],
"body": {
"type": "BlockStatement",
"start": 11,
"end": 24,
"loc": {
"start": {
"line": 1,
"column": 11
},
"end": {
"line": 2,
"column": 4
}
},
"body": [
{
"type": "ReturnStatement",
"start": 13,
"end": 19,
"loc": {
"start": {
"line": 1,
"column": 13
},
"end": {
"line": 1,
"column": 19
}
},
"argument": null
},
{
"type": "ExpressionStatement",
"start": 20,
"end": 22,
"loc": {
"start": {
"line": 2,
"column": 0
},
"end": {
"line": 2,
"column": 2
}
},
"expression": {
"type": "Identifier",
"start": 20,
"end": 21,
"loc": {
"start": {
"line": 2,
"column": 0
},
"end": {
"line": 2,
"column": 1
}
},
"name": "x"
}
}
]
},
"parenthesizedExpression": true
}
}
]
}
}

View File

@@ -0,0 +1,2 @@
(function(){ return // Comment
x; })

View File

@@ -0,0 +1,200 @@
{
"type": "File",
"start": 0,
"end": 36,
"loc": {
"start": {
"line": 1,
"column": 0
},
"end": {
"line": 2,
"column": 5
}
},
"program": {
"type": "Program",
"start": 0,
"end": 36,
"loc": {
"start": {
"line": 1,
"column": 0
},
"end": {
"line": 2,
"column": 5
}
},
"sourceType": "script",
"body": [
{
"type": "ExpressionStatement",
"start": 0,
"end": 36,
"loc": {
"start": {
"line": 1,
"column": 0
},
"end": {
"line": 2,
"column": 5
}
},
"expression": {
"type": "FunctionExpression",
"start": 1,
"end": 35,
"loc": {
"start": {
"line": 1,
"column": 1
},
"end": {
"line": 2,
"column": 4
}
},
"id": null,
"generator": false,
"expression": false,
"params": [],
"body": {
"type": "BlockStatement",
"start": 11,
"end": 35,
"loc": {
"start": {
"line": 1,
"column": 11
},
"end": {
"line": 2,
"column": 4
}
},
"body": [
{
"type": "ReturnStatement",
"start": 13,
"end": 19,
"loc": {
"start": {
"line": 1,
"column": 13
},
"end": {
"line": 1,
"column": 19
}
},
"argument": null,
"leadingComments": null,
"trailingComments": [
{
"type": "CommentLine",
"value": " Comment",
"start": 20,
"end": 30,
"loc": {
"start": {
"line": 1,
"column": 20
},
"end": {
"line": 1,
"column": 30
}
},
"range": [
20,
30
]
}
]
},
{
"type": "ExpressionStatement",
"start": 31,
"end": 33,
"loc": {
"start": {
"line": 2,
"column": 0
},
"end": {
"line": 2,
"column": 2
}
},
"expression": {
"type": "Identifier",
"start": 31,
"end": 32,
"loc": {
"start": {
"line": 2,
"column": 0
},
"end": {
"line": 2,
"column": 1
}
},
"name": "x",
"leadingComments": null
},
"leadingComments": [
{
"type": "CommentLine",
"value": " Comment",
"start": 20,
"end": 30,
"loc": {
"start": {
"line": 1,
"column": 20
},
"end": {
"line": 1,
"column": 30
}
},
"range": [
20,
30
]
}
]
}
]
},
"parenthesizedExpression": true
}
}
]
},
"comments": [
{
"type": "CommentLine",
"value": " Comment",
"start": 20,
"end": 30,
"loc": {
"start": {
"line": 1,
"column": 20
},
"end": {
"line": 1,
"column": 30
}
},
"range": [
20,
30
]
}
]
}

View File

@@ -0,0 +1,2 @@
(function(){ return/* Multiline
Comment */x; })

View File

@@ -0,0 +1,200 @@
{
"type": "File",
"start": 0,
"end": 47,
"loc": {
"start": {
"line": 1,
"column": 0
},
"end": {
"line": 2,
"column": 15
}
},
"program": {
"type": "Program",
"start": 0,
"end": 47,
"loc": {
"start": {
"line": 1,
"column": 0
},
"end": {
"line": 2,
"column": 15
}
},
"sourceType": "script",
"body": [
{
"type": "ExpressionStatement",
"start": 0,
"end": 47,
"loc": {
"start": {
"line": 1,
"column": 0
},
"end": {
"line": 2,
"column": 15
}
},
"expression": {
"type": "FunctionExpression",
"start": 1,
"end": 46,
"loc": {
"start": {
"line": 1,
"column": 1
},
"end": {
"line": 2,
"column": 14
}
},
"id": null,
"generator": false,
"expression": false,
"params": [],
"body": {
"type": "BlockStatement",
"start": 11,
"end": 46,
"loc": {
"start": {
"line": 1,
"column": 11
},
"end": {
"line": 2,
"column": 14
}
},
"body": [
{
"type": "ReturnStatement",
"start": 13,
"end": 19,
"loc": {
"start": {
"line": 1,
"column": 13
},
"end": {
"line": 1,
"column": 19
}
},
"argument": null,
"leadingComments": null,
"trailingComments": [
{
"type": "CommentBlock",
"value": " Multiline\nComment ",
"start": 19,
"end": 42,
"loc": {
"start": {
"line": 1,
"column": 19
},
"end": {
"line": 2,
"column": 10
}
},
"range": [
19,
42
]
}
]
},
{
"type": "ExpressionStatement",
"start": 42,
"end": 44,
"loc": {
"start": {
"line": 2,
"column": 10
},
"end": {
"line": 2,
"column": 12
}
},
"expression": {
"type": "Identifier",
"start": 42,
"end": 43,
"loc": {
"start": {
"line": 2,
"column": 10
},
"end": {
"line": 2,
"column": 11
}
},
"name": "x",
"leadingComments": null
},
"leadingComments": [
{
"type": "CommentBlock",
"value": " Multiline\nComment ",
"start": 19,
"end": 42,
"loc": {
"start": {
"line": 1,
"column": 19
},
"end": {
"line": 2,
"column": 10
}
},
"range": [
19,
42
]
}
]
}
]
},
"parenthesizedExpression": true
}
}
]
},
"comments": [
{
"type": "CommentBlock",
"value": " Multiline\nComment ",
"start": 19,
"end": 42,
"loc": {
"start": {
"line": 1,
"column": 19
},
"end": {
"line": 2,
"column": 10
}
},
"range": [
19,
42
]
}
]
}

View File

@@ -0,0 +1,2 @@
{ throw error
error; }

View File

@@ -0,0 +1,112 @@
{
"type": "File",
"start": 0,
"end": 22,
"loc": {
"start": {
"line": 1,
"column": 0
},
"end": {
"line": 2,
"column": 8
}
},
"program": {
"type": "Program",
"start": 0,
"end": 22,
"loc": {
"start": {
"line": 1,
"column": 0
},
"end": {
"line": 2,
"column": 8
}
},
"sourceType": "script",
"body": [
{
"type": "BlockStatement",
"start": 0,
"end": 22,
"loc": {
"start": {
"line": 1,
"column": 0
},
"end": {
"line": 2,
"column": 8
}
},
"body": [
{
"type": "ThrowStatement",
"start": 2,
"end": 13,
"loc": {
"start": {
"line": 1,
"column": 2
},
"end": {
"line": 1,
"column": 13
}
},
"argument": {
"type": "Identifier",
"start": 8,
"end": 13,
"loc": {
"start": {
"line": 1,
"column": 8
},
"end": {
"line": 1,
"column": 13
}
},
"name": "error"
}
},
{
"type": "ExpressionStatement",
"start": 14,
"end": 20,
"loc": {
"start": {
"line": 2,
"column": 0
},
"end": {
"line": 2,
"column": 6
}
},
"expression": {
"type": "Identifier",
"start": 14,
"end": 19,
"loc": {
"start": {
"line": 2,
"column": 0
},
"end": {
"line": 2,
"column": 5
}
},
"name": "error"
}
}
]
}
]
}
}

View File

@@ -0,0 +1,2 @@
{ throw error// Comment
error; }

View File

@@ -0,0 +1,181 @@
{
"type": "File",
"start": 0,
"end": 32,
"loc": {
"start": {
"line": 1,
"column": 0
},
"end": {
"line": 2,
"column": 8
}
},
"program": {
"type": "Program",
"start": 0,
"end": 32,
"loc": {
"start": {
"line": 1,
"column": 0
},
"end": {
"line": 2,
"column": 8
}
},
"sourceType": "script",
"body": [
{
"type": "BlockStatement",
"start": 0,
"end": 32,
"loc": {
"start": {
"line": 1,
"column": 0
},
"end": {
"line": 2,
"column": 8
}
},
"body": [
{
"type": "ThrowStatement",
"start": 2,
"end": 13,
"loc": {
"start": {
"line": 1,
"column": 2
},
"end": {
"line": 1,
"column": 13
}
},
"argument": {
"type": "Identifier",
"start": 8,
"end": 13,
"loc": {
"start": {
"line": 1,
"column": 8
},
"end": {
"line": 1,
"column": 13
}
},
"name": "error",
"leadingComments": null,
"trailingComments": null
},
"trailingComments": [
{
"type": "CommentLine",
"value": " Comment",
"start": 13,
"end": 23,
"loc": {
"start": {
"line": 1,
"column": 13
},
"end": {
"line": 1,
"column": 23
}
},
"range": [
13,
23
]
}
]
},
{
"type": "ExpressionStatement",
"start": 24,
"end": 30,
"loc": {
"start": {
"line": 2,
"column": 0
},
"end": {
"line": 2,
"column": 6
}
},
"expression": {
"type": "Identifier",
"start": 24,
"end": 29,
"loc": {
"start": {
"line": 2,
"column": 0
},
"end": {
"line": 2,
"column": 5
}
},
"name": "error",
"leadingComments": null
},
"leadingComments": [
{
"type": "CommentLine",
"value": " Comment",
"start": 13,
"end": 23,
"loc": {
"start": {
"line": 1,
"column": 13
},
"end": {
"line": 1,
"column": 23
}
},
"range": [
13,
23
]
}
]
}
]
}
]
},
"comments": [
{
"type": "CommentLine",
"value": " Comment",
"start": 13,
"end": 23,
"loc": {
"start": {
"line": 1,
"column": 13
},
"end": {
"line": 1,
"column": 23
}
},
"range": [
13,
23
]
}
]
}

View File

@@ -0,0 +1,2 @@
{ throw error/* Multiline
Comment */error; }

View File

@@ -0,0 +1,181 @@
{
"type": "File",
"start": 0,
"end": 44,
"loc": {
"start": {
"line": 1,
"column": 0
},
"end": {
"line": 2,
"column": 18
}
},
"program": {
"type": "Program",
"start": 0,
"end": 44,
"loc": {
"start": {
"line": 1,
"column": 0
},
"end": {
"line": 2,
"column": 18
}
},
"sourceType": "script",
"body": [
{
"type": "BlockStatement",
"start": 0,
"end": 44,
"loc": {
"start": {
"line": 1,
"column": 0
},
"end": {
"line": 2,
"column": 18
}
},
"body": [
{
"type": "ThrowStatement",
"start": 2,
"end": 13,
"loc": {
"start": {
"line": 1,
"column": 2
},
"end": {
"line": 1,
"column": 13
}
},
"argument": {
"type": "Identifier",
"start": 8,
"end": 13,
"loc": {
"start": {
"line": 1,
"column": 8
},
"end": {
"line": 1,
"column": 13
}
},
"name": "error",
"leadingComments": null,
"trailingComments": null
},
"trailingComments": [
{
"type": "CommentBlock",
"value": " Multiline\nComment ",
"start": 13,
"end": 36,
"loc": {
"start": {
"line": 1,
"column": 13
},
"end": {
"line": 2,
"column": 10
}
},
"range": [
13,
36
]
}
]
},
{
"type": "ExpressionStatement",
"start": 36,
"end": 42,
"loc": {
"start": {
"line": 2,
"column": 10
},
"end": {
"line": 2,
"column": 16
}
},
"expression": {
"type": "Identifier",
"start": 36,
"end": 41,
"loc": {
"start": {
"line": 2,
"column": 10
},
"end": {
"line": 2,
"column": 15
}
},
"name": "error",
"leadingComments": null
},
"leadingComments": [
{
"type": "CommentBlock",
"value": " Multiline\nComment ",
"start": 13,
"end": 36,
"loc": {
"start": {
"line": 1,
"column": 13
},
"end": {
"line": 2,
"column": 10
}
},
"range": [
13,
36
]
}
]
}
]
}
]
},
"comments": [
{
"type": "CommentBlock",
"value": " Multiline\nComment ",
"start": 13,
"end": 36,
"loc": {
"start": {
"line": 1,
"column": 13
},
"end": {
"line": 2,
"column": 10
}
},
"range": [
13,
36
]
}
]
}

View File

@@ -0,0 +1 @@
const x = 42

View File

@@ -0,0 +1,100 @@
{
"type": "File",
"start": 0,
"end": 12,
"loc": {
"start": {
"line": 1,
"column": 0
},
"end": {
"line": 1,
"column": 12
}
},
"program": {
"type": "Program",
"start": 0,
"end": 12,
"loc": {
"start": {
"line": 1,
"column": 0
},
"end": {
"line": 1,
"column": 12
}
},
"sourceType": "script",
"body": [
{
"type": "VariableDeclaration",
"start": 0,
"end": 12,
"loc": {
"start": {
"line": 1,
"column": 0
},
"end": {
"line": 1,
"column": 12
}
},
"declarations": [
{
"type": "VariableDeclarator",
"start": 6,
"end": 12,
"loc": {
"start": {
"line": 1,
"column": 6
},
"end": {
"line": 1,
"column": 12
}
},
"id": {
"type": "Identifier",
"start": 6,
"end": 7,
"loc": {
"start": {
"line": 1,
"column": 6
},
"end": {
"line": 1,
"column": 7
}
},
"name": "x"
},
"init": {
"type": "Literal",
"start": 10,
"end": 12,
"loc": {
"start": {
"line": 1,
"column": 10
},
"end": {
"line": 1,
"column": 12
}
},
"value": 42,
"rawValue": 42,
"raw": "42"
}
}
],
"kind": "const"
}
]
}
}

View File

@@ -0,0 +1 @@
{ const x = 42 }

View File

@@ -0,0 +1,117 @@
{
"type": "File",
"start": 0,
"end": 16,
"loc": {
"start": {
"line": 1,
"column": 0
},
"end": {
"line": 1,
"column": 16
}
},
"program": {
"type": "Program",
"start": 0,
"end": 16,
"loc": {
"start": {
"line": 1,
"column": 0
},
"end": {
"line": 1,
"column": 16
}
},
"sourceType": "script",
"body": [
{
"type": "BlockStatement",
"start": 0,
"end": 16,
"loc": {
"start": {
"line": 1,
"column": 0
},
"end": {
"line": 1,
"column": 16
}
},
"body": [
{
"type": "VariableDeclaration",
"start": 2,
"end": 14,
"loc": {
"start": {
"line": 1,
"column": 2
},
"end": {
"line": 1,
"column": 14
}
},
"declarations": [
{
"type": "VariableDeclarator",
"start": 8,
"end": 14,
"loc": {
"start": {
"line": 1,
"column": 8
},
"end": {
"line": 1,
"column": 14
}
},
"id": {
"type": "Identifier",
"start": 8,
"end": 9,
"loc": {
"start": {
"line": 1,
"column": 8
},
"end": {
"line": 1,
"column": 9
}
},
"name": "x"
},
"init": {
"type": "Literal",
"start": 12,
"end": 14,
"loc": {
"start": {
"line": 1,
"column": 12
},
"end": {
"line": 1,
"column": 14
}
},
"value": 42,
"rawValue": 42,
"raw": "42"
}
}
],
"kind": "const"
}
]
}
]
}
}

View File

@@ -0,0 +1 @@
{ const x = 14, y = 3, z = 1977 }

View File

@@ -0,0 +1,215 @@
{
"type": "File",
"start": 0,
"end": 33,
"loc": {
"start": {
"line": 1,
"column": 0
},
"end": {
"line": 1,
"column": 33
}
},
"program": {
"type": "Program",
"start": 0,
"end": 33,
"loc": {
"start": {
"line": 1,
"column": 0
},
"end": {
"line": 1,
"column": 33
}
},
"sourceType": "script",
"body": [
{
"type": "BlockStatement",
"start": 0,
"end": 33,
"loc": {
"start": {
"line": 1,
"column": 0
},
"end": {
"line": 1,
"column": 33
}
},
"body": [
{
"type": "VariableDeclaration",
"start": 2,
"end": 31,
"loc": {
"start": {
"line": 1,
"column": 2
},
"end": {
"line": 1,
"column": 31
}
},
"declarations": [
{
"type": "VariableDeclarator",
"start": 8,
"end": 14,
"loc": {
"start": {
"line": 1,
"column": 8
},
"end": {
"line": 1,
"column": 14
}
},
"id": {
"type": "Identifier",
"start": 8,
"end": 9,
"loc": {
"start": {
"line": 1,
"column": 8
},
"end": {
"line": 1,
"column": 9
}
},
"name": "x"
},
"init": {
"type": "Literal",
"start": 12,
"end": 14,
"loc": {
"start": {
"line": 1,
"column": 12
},
"end": {
"line": 1,
"column": 14
}
},
"value": 14,
"rawValue": 14,
"raw": "14"
}
},
{
"type": "VariableDeclarator",
"start": 16,
"end": 21,
"loc": {
"start": {
"line": 1,
"column": 16
},
"end": {
"line": 1,
"column": 21
}
},
"id": {
"type": "Identifier",
"start": 16,
"end": 17,
"loc": {
"start": {
"line": 1,
"column": 16
},
"end": {
"line": 1,
"column": 17
}
},
"name": "y"
},
"init": {
"type": "Literal",
"start": 20,
"end": 21,
"loc": {
"start": {
"line": 1,
"column": 20
},
"end": {
"line": 1,
"column": 21
}
},
"value": 3,
"rawValue": 3,
"raw": "3"
}
},
{
"type": "VariableDeclarator",
"start": 23,
"end": 31,
"loc": {
"start": {
"line": 1,
"column": 23
},
"end": {
"line": 1,
"column": 31
}
},
"id": {
"type": "Identifier",
"start": 23,
"end": 24,
"loc": {
"start": {
"line": 1,
"column": 23
},
"end": {
"line": 1,
"column": 24
}
},
"name": "z"
},
"init": {
"type": "Literal",
"start": 27,
"end": 31,
"loc": {
"start": {
"line": 1,
"column": 27
},
"end": {
"line": 1,
"column": 31
}
},
"value": 1977,
"rawValue": 1977,
"raw": "1977"
}
}
],
"kind": "const"
}
]
}
]
}
}

View File

@@ -0,0 +1 @@
function a(x, x) {'use strict';}

View File

@@ -0,0 +1 @@
function a([], []) {'use strict';}

View File

@@ -0,0 +1,150 @@
{
"type": "File",
"start": 0,
"end": 34,
"loc": {
"start": {
"line": 1,
"column": 0
},
"end": {
"line": 1,
"column": 34
}
},
"program": {
"type": "Program",
"start": 0,
"end": 34,
"loc": {
"start": {
"line": 1,
"column": 0
},
"end": {
"line": 1,
"column": 34
}
},
"sourceType": "script",
"body": [
{
"type": "FunctionDeclaration",
"start": 0,
"end": 34,
"loc": {
"start": {
"line": 1,
"column": 0
},
"end": {
"line": 1,
"column": 34
}
},
"id": {
"type": "Identifier",
"start": 9,
"end": 10,
"loc": {
"start": {
"line": 1,
"column": 9
},
"end": {
"line": 1,
"column": 10
}
},
"name": "a"
},
"generator": false,
"expression": false,
"params": [
{
"type": "ArrayPattern",
"start": 11,
"end": 13,
"loc": {
"start": {
"line": 1,
"column": 11
},
"end": {
"line": 1,
"column": 13
}
},
"elements": []
},
{
"type": "ArrayPattern",
"start": 15,
"end": 17,
"loc": {
"start": {
"line": 1,
"column": 15
},
"end": {
"line": 1,
"column": 17
}
},
"elements": []
}
],
"body": {
"type": "BlockStatement",
"start": 19,
"end": 34,
"loc": {
"start": {
"line": 1,
"column": 19
},
"end": {
"line": 1,
"column": 34
}
},
"body": [
{
"type": "ExpressionStatement",
"start": 20,
"end": 33,
"loc": {
"start": {
"line": 1,
"column": 20
},
"end": {
"line": 1,
"column": 33
}
},
"expression": {
"type": "Literal",
"start": 20,
"end": 32,
"loc": {
"start": {
"line": 1,
"column": 20
},
"end": {
"line": 1,
"column": 32
}
},
"value": "use strict",
"rawValue": "use strict",
"raw": "'use strict'"
}
}
]
}
}
]
}
}

View File

@@ -0,0 +1 @@
function hello() { sayHi(); }

View File

@@ -0,0 +1,131 @@
{
"type": "File",
"start": 0,
"end": 29,
"loc": {
"start": {
"line": 1,
"column": 0
},
"end": {
"line": 1,
"column": 29
}
},
"program": {
"type": "Program",
"start": 0,
"end": 29,
"loc": {
"start": {
"line": 1,
"column": 0
},
"end": {
"line": 1,
"column": 29
}
},
"sourceType": "script",
"body": [
{
"type": "FunctionDeclaration",
"start": 0,
"end": 29,
"loc": {
"start": {
"line": 1,
"column": 0
},
"end": {
"line": 1,
"column": 29
}
},
"id": {
"type": "Identifier",
"start": 9,
"end": 14,
"loc": {
"start": {
"line": 1,
"column": 9
},
"end": {
"line": 1,
"column": 14
}
},
"name": "hello"
},
"generator": false,
"expression": false,
"params": [],
"body": {
"type": "BlockStatement",
"start": 17,
"end": 29,
"loc": {
"start": {
"line": 1,
"column": 17
},
"end": {
"line": 1,
"column": 29
}
},
"body": [
{
"type": "ExpressionStatement",
"start": 19,
"end": 27,
"loc": {
"start": {
"line": 1,
"column": 19
},
"end": {
"line": 1,
"column": 27
}
},
"expression": {
"type": "CallExpression",
"start": 19,
"end": 26,
"loc": {
"start": {
"line": 1,
"column": 19
},
"end": {
"line": 1,
"column": 26
}
},
"callee": {
"type": "Identifier",
"start": 19,
"end": 24,
"loc": {
"start": {
"line": 1,
"column": 19
},
"end": {
"line": 1,
"column": 24
}
},
"name": "sayHi"
},
"arguments": []
}
}
]
}
}
]
}
}

View File

@@ -0,0 +1 @@
function eval() { }

View File

@@ -0,0 +1,83 @@
{
"type": "File",
"start": 0,
"end": 19,
"loc": {
"start": {
"line": 1,
"column": 0
},
"end": {
"line": 1,
"column": 19
}
},
"program": {
"type": "Program",
"start": 0,
"end": 19,
"loc": {
"start": {
"line": 1,
"column": 0
},
"end": {
"line": 1,
"column": 19
}
},
"sourceType": "script",
"body": [
{
"type": "FunctionDeclaration",
"start": 0,
"end": 19,
"loc": {
"start": {
"line": 1,
"column": 0
},
"end": {
"line": 1,
"column": 19
}
},
"id": {
"type": "Identifier",
"start": 9,
"end": 13,
"loc": {
"start": {
"line": 1,
"column": 9
},
"end": {
"line": 1,
"column": 13
}
},
"name": "eval"
},
"generator": false,
"expression": false,
"params": [],
"body": {
"type": "BlockStatement",
"start": 16,
"end": 19,
"loc": {
"start": {
"line": 1,
"column": 16
},
"end": {
"line": 1,
"column": 19
}
},
"body": []
}
}
]
}
}

View File

@@ -0,0 +1 @@
function arguments() { }

View File

@@ -0,0 +1,83 @@
{
"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": "FunctionDeclaration",
"start": 0,
"end": 24,
"loc": {
"start": {
"line": 1,
"column": 0
},
"end": {
"line": 1,
"column": 24
}
},
"id": {
"type": "Identifier",
"start": 9,
"end": 18,
"loc": {
"start": {
"line": 1,
"column": 9
},
"end": {
"line": 1,
"column": 18
}
},
"name": "arguments"
},
"generator": false,
"expression": false,
"params": [],
"body": {
"type": "BlockStatement",
"start": 21,
"end": 24,
"loc": {
"start": {
"line": 1,
"column": 21
},
"end": {
"line": 1,
"column": 24
}
},
"body": []
}
}
]
}
}

View File

@@ -0,0 +1 @@
function test(t, t) { }

View File

@@ -0,0 +1,116 @@
{
"type": "File",
"start": 0,
"end": 23,
"loc": {
"start": {
"line": 1,
"column": 0
},
"end": {
"line": 1,
"column": 23
}
},
"program": {
"type": "Program",
"start": 0,
"end": 23,
"loc": {
"start": {
"line": 1,
"column": 0
},
"end": {
"line": 1,
"column": 23
}
},
"sourceType": "script",
"body": [
{
"type": "FunctionDeclaration",
"start": 0,
"end": 23,
"loc": {
"start": {
"line": 1,
"column": 0
},
"end": {
"line": 1,
"column": 23
}
},
"id": {
"type": "Identifier",
"start": 9,
"end": 13,
"loc": {
"start": {
"line": 1,
"column": 9
},
"end": {
"line": 1,
"column": 13
}
},
"name": "test"
},
"generator": false,
"expression": false,
"params": [
{
"type": "Identifier",
"start": 14,
"end": 15,
"loc": {
"start": {
"line": 1,
"column": 14
},
"end": {
"line": 1,
"column": 15
}
},
"name": "t"
},
{
"type": "Identifier",
"start": 17,
"end": 18,
"loc": {
"start": {
"line": 1,
"column": 17
},
"end": {
"line": 1,
"column": 18
}
},
"name": "t"
}
],
"body": {
"type": "BlockStatement",
"start": 20,
"end": 23,
"loc": {
"start": {
"line": 1,
"column": 20
},
"end": {
"line": 1,
"column": 23
}
},
"body": []
}
}
]
}
}

View File

@@ -0,0 +1 @@
(function test(t, t) { })

View File

@@ -0,0 +1,132 @@
{
"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": "ExpressionStatement",
"start": 0,
"end": 25,
"loc": {
"start": {
"line": 1,
"column": 0
},
"end": {
"line": 1,
"column": 25
}
},
"expression": {
"type": "FunctionExpression",
"start": 1,
"end": 24,
"loc": {
"start": {
"line": 1,
"column": 1
},
"end": {
"line": 1,
"column": 24
}
},
"id": {
"type": "Identifier",
"start": 10,
"end": 14,
"loc": {
"start": {
"line": 1,
"column": 10
},
"end": {
"line": 1,
"column": 14
}
},
"name": "test"
},
"generator": false,
"expression": false,
"params": [
{
"type": "Identifier",
"start": 15,
"end": 16,
"loc": {
"start": {
"line": 1,
"column": 15
},
"end": {
"line": 1,
"column": 16
}
},
"name": "t"
},
{
"type": "Identifier",
"start": 18,
"end": 19,
"loc": {
"start": {
"line": 1,
"column": 18
},
"end": {
"line": 1,
"column": 19
}
},
"name": "t"
}
],
"body": {
"type": "BlockStatement",
"start": 21,
"end": 24,
"loc": {
"start": {
"line": 1,
"column": 21
},
"end": {
"line": 1,
"column": 24
}
},
"body": []
},
"parenthesizedExpression": true
}
}
]
}
}

View File

@@ -0,0 +1 @@
function eval() { function inner() { "use strict" } }

View File

@@ -0,0 +1,168 @@
{
"type": "File",
"start": 0,
"end": 53,
"loc": {
"start": {
"line": 1,
"column": 0
},
"end": {
"line": 1,
"column": 53
}
},
"program": {
"type": "Program",
"start": 0,
"end": 53,
"loc": {
"start": {
"line": 1,
"column": 0
},
"end": {
"line": 1,
"column": 53
}
},
"sourceType": "script",
"body": [
{
"type": "FunctionDeclaration",
"start": 0,
"end": 53,
"loc": {
"start": {
"line": 1,
"column": 0
},
"end": {
"line": 1,
"column": 53
}
},
"id": {
"type": "Identifier",
"start": 9,
"end": 13,
"loc": {
"start": {
"line": 1,
"column": 9
},
"end": {
"line": 1,
"column": 13
}
},
"name": "eval"
},
"generator": false,
"expression": false,
"params": [],
"body": {
"type": "BlockStatement",
"start": 16,
"end": 53,
"loc": {
"start": {
"line": 1,
"column": 16
},
"end": {
"line": 1,
"column": 53
}
},
"body": [
{
"type": "FunctionDeclaration",
"start": 18,
"end": 51,
"loc": {
"start": {
"line": 1,
"column": 18
},
"end": {
"line": 1,
"column": 51
}
},
"id": {
"type": "Identifier",
"start": 27,
"end": 32,
"loc": {
"start": {
"line": 1,
"column": 27
},
"end": {
"line": 1,
"column": 32
}
},
"name": "inner"
},
"generator": false,
"expression": false,
"params": [],
"body": {
"type": "BlockStatement",
"start": 35,
"end": 51,
"loc": {
"start": {
"line": 1,
"column": 35
},
"end": {
"line": 1,
"column": 51
}
},
"body": [
{
"type": "ExpressionStatement",
"start": 37,
"end": 49,
"loc": {
"start": {
"line": 1,
"column": 37
},
"end": {
"line": 1,
"column": 49
}
},
"expression": {
"type": "Literal",
"start": 37,
"end": 49,
"loc": {
"start": {
"line": 1,
"column": 37
},
"end": {
"line": 1,
"column": 49
}
},
"value": "use strict",
"rawValue": "use strict",
"raw": "\"use strict\""
}
}
]
}
}
]
}
}
]
}
}

View File

@@ -0,0 +1 @@
function hello(a) { sayHi(); }

View File

@@ -0,0 +1,148 @@
{
"type": "File",
"start": 0,
"end": 30,
"loc": {
"start": {
"line": 1,
"column": 0
},
"end": {
"line": 1,
"column": 30
}
},
"program": {
"type": "Program",
"start": 0,
"end": 30,
"loc": {
"start": {
"line": 1,
"column": 0
},
"end": {
"line": 1,
"column": 30
}
},
"sourceType": "script",
"body": [
{
"type": "FunctionDeclaration",
"start": 0,
"end": 30,
"loc": {
"start": {
"line": 1,
"column": 0
},
"end": {
"line": 1,
"column": 30
}
},
"id": {
"type": "Identifier",
"start": 9,
"end": 14,
"loc": {
"start": {
"line": 1,
"column": 9
},
"end": {
"line": 1,
"column": 14
}
},
"name": "hello"
},
"generator": false,
"expression": false,
"params": [
{
"type": "Identifier",
"start": 15,
"end": 16,
"loc": {
"start": {
"line": 1,
"column": 15
},
"end": {
"line": 1,
"column": 16
}
},
"name": "a"
}
],
"body": {
"type": "BlockStatement",
"start": 18,
"end": 30,
"loc": {
"start": {
"line": 1,
"column": 18
},
"end": {
"line": 1,
"column": 30
}
},
"body": [
{
"type": "ExpressionStatement",
"start": 20,
"end": 28,
"loc": {
"start": {
"line": 1,
"column": 20
},
"end": {
"line": 1,
"column": 28
}
},
"expression": {
"type": "CallExpression",
"start": 20,
"end": 27,
"loc": {
"start": {
"line": 1,
"column": 20
},
"end": {
"line": 1,
"column": 27
}
},
"callee": {
"type": "Identifier",
"start": 20,
"end": 25,
"loc": {
"start": {
"line": 1,
"column": 20
},
"end": {
"line": 1,
"column": 25
}
},
"name": "sayHi"
},
"arguments": []
}
}
]
}
}
]
}
}

View File

@@ -0,0 +1 @@
function hello(a, b) { sayHi(); }

View File

@@ -0,0 +1,164 @@
{
"type": "File",
"start": 0,
"end": 33,
"loc": {
"start": {
"line": 1,
"column": 0
},
"end": {
"line": 1,
"column": 33
}
},
"program": {
"type": "Program",
"start": 0,
"end": 33,
"loc": {
"start": {
"line": 1,
"column": 0
},
"end": {
"line": 1,
"column": 33
}
},
"sourceType": "script",
"body": [
{
"type": "FunctionDeclaration",
"start": 0,
"end": 33,
"loc": {
"start": {
"line": 1,
"column": 0
},
"end": {
"line": 1,
"column": 33
}
},
"id": {
"type": "Identifier",
"start": 9,
"end": 14,
"loc": {
"start": {
"line": 1,
"column": 9
},
"end": {
"line": 1,
"column": 14
}
},
"name": "hello"
},
"generator": false,
"expression": false,
"params": [
{
"type": "Identifier",
"start": 15,
"end": 16,
"loc": {
"start": {
"line": 1,
"column": 15
},
"end": {
"line": 1,
"column": 16
}
},
"name": "a"
},
{
"type": "Identifier",
"start": 18,
"end": 19,
"loc": {
"start": {
"line": 1,
"column": 18
},
"end": {
"line": 1,
"column": 19
}
},
"name": "b"
}
],
"body": {
"type": "BlockStatement",
"start": 21,
"end": 33,
"loc": {
"start": {
"line": 1,
"column": 21
},
"end": {
"line": 1,
"column": 33
}
},
"body": [
{
"type": "ExpressionStatement",
"start": 23,
"end": 31,
"loc": {
"start": {
"line": 1,
"column": 23
},
"end": {
"line": 1,
"column": 31
}
},
"expression": {
"type": "CallExpression",
"start": 23,
"end": 30,
"loc": {
"start": {
"line": 1,
"column": 23
},
"end": {
"line": 1,
"column": 30
}
},
"callee": {
"type": "Identifier",
"start": 23,
"end": 28,
"loc": {
"start": {
"line": 1,
"column": 23
},
"end": {
"line": 1,
"column": 28
}
},
"name": "sayHi"
},
"arguments": []
}
}
]
}
}
]
}
}

View File

@@ -0,0 +1 @@
var hi = function() { sayHi() };

View File

@@ -0,0 +1,165 @@
{
"type": "File",
"start": 0,
"end": 32,
"loc": {
"start": {
"line": 1,
"column": 0
},
"end": {
"line": 1,
"column": 32
}
},
"program": {
"type": "Program",
"start": 0,
"end": 32,
"loc": {
"start": {
"line": 1,
"column": 0
},
"end": {
"line": 1,
"column": 32
}
},
"sourceType": "script",
"body": [
{
"type": "VariableDeclaration",
"start": 0,
"end": 32,
"loc": {
"start": {
"line": 1,
"column": 0
},
"end": {
"line": 1,
"column": 32
}
},
"declarations": [
{
"type": "VariableDeclarator",
"start": 4,
"end": 31,
"loc": {
"start": {
"line": 1,
"column": 4
},
"end": {
"line": 1,
"column": 31
}
},
"id": {
"type": "Identifier",
"start": 4,
"end": 6,
"loc": {
"start": {
"line": 1,
"column": 4
},
"end": {
"line": 1,
"column": 6
}
},
"name": "hi"
},
"init": {
"type": "FunctionExpression",
"start": 9,
"end": 31,
"loc": {
"start": {
"line": 1,
"column": 9
},
"end": {
"line": 1,
"column": 31
}
},
"id": null,
"generator": false,
"expression": false,
"params": [],
"body": {
"type": "BlockStatement",
"start": 20,
"end": 31,
"loc": {
"start": {
"line": 1,
"column": 20
},
"end": {
"line": 1,
"column": 31
}
},
"body": [
{
"type": "ExpressionStatement",
"start": 22,
"end": 29,
"loc": {
"start": {
"line": 1,
"column": 22
},
"end": {
"line": 1,
"column": 29
}
},
"expression": {
"type": "CallExpression",
"start": 22,
"end": 29,
"loc": {
"start": {
"line": 1,
"column": 22
},
"end": {
"line": 1,
"column": 29
}
},
"callee": {
"type": "Identifier",
"start": 22,
"end": 27,
"loc": {
"start": {
"line": 1,
"column": 22
},
"end": {
"line": 1,
"column": 27
}
},
"name": "sayHi"
},
"arguments": []
}
}
]
}
}
}
],
"kind": "var"
}
]
}
}

View File

@@ -0,0 +1 @@
var hi = function eval() { };

View File

@@ -0,0 +1,132 @@
{
"type": "File",
"start": 0,
"end": 29,
"loc": {
"start": {
"line": 1,
"column": 0
},
"end": {
"line": 1,
"column": 29
}
},
"program": {
"type": "Program",
"start": 0,
"end": 29,
"loc": {
"start": {
"line": 1,
"column": 0
},
"end": {
"line": 1,
"column": 29
}
},
"sourceType": "script",
"body": [
{
"type": "VariableDeclaration",
"start": 0,
"end": 29,
"loc": {
"start": {
"line": 1,
"column": 0
},
"end": {
"line": 1,
"column": 29
}
},
"declarations": [
{
"type": "VariableDeclarator",
"start": 4,
"end": 28,
"loc": {
"start": {
"line": 1,
"column": 4
},
"end": {
"line": 1,
"column": 28
}
},
"id": {
"type": "Identifier",
"start": 4,
"end": 6,
"loc": {
"start": {
"line": 1,
"column": 4
},
"end": {
"line": 1,
"column": 6
}
},
"name": "hi"
},
"init": {
"type": "FunctionExpression",
"start": 9,
"end": 28,
"loc": {
"start": {
"line": 1,
"column": 9
},
"end": {
"line": 1,
"column": 28
}
},
"id": {
"type": "Identifier",
"start": 18,
"end": 22,
"loc": {
"start": {
"line": 1,
"column": 18
},
"end": {
"line": 1,
"column": 22
}
},
"name": "eval"
},
"generator": false,
"expression": false,
"params": [],
"body": {
"type": "BlockStatement",
"start": 25,
"end": 28,
"loc": {
"start": {
"line": 1,
"column": 25
},
"end": {
"line": 1,
"column": 28
}
},
"body": []
}
}
}
],
"kind": "var"
}
]
}
}

View File

@@ -0,0 +1 @@
var hi = function arguments() { };

View File

@@ -0,0 +1,132 @@
{
"type": "File",
"start": 0,
"end": 34,
"loc": {
"start": {
"line": 1,
"column": 0
},
"end": {
"line": 1,
"column": 34
}
},
"program": {
"type": "Program",
"start": 0,
"end": 34,
"loc": {
"start": {
"line": 1,
"column": 0
},
"end": {
"line": 1,
"column": 34
}
},
"sourceType": "script",
"body": [
{
"type": "VariableDeclaration",
"start": 0,
"end": 34,
"loc": {
"start": {
"line": 1,
"column": 0
},
"end": {
"line": 1,
"column": 34
}
},
"declarations": [
{
"type": "VariableDeclarator",
"start": 4,
"end": 33,
"loc": {
"start": {
"line": 1,
"column": 4
},
"end": {
"line": 1,
"column": 33
}
},
"id": {
"type": "Identifier",
"start": 4,
"end": 6,
"loc": {
"start": {
"line": 1,
"column": 4
},
"end": {
"line": 1,
"column": 6
}
},
"name": "hi"
},
"init": {
"type": "FunctionExpression",
"start": 9,
"end": 33,
"loc": {
"start": {
"line": 1,
"column": 9
},
"end": {
"line": 1,
"column": 33
}
},
"id": {
"type": "Identifier",
"start": 18,
"end": 27,
"loc": {
"start": {
"line": 1,
"column": 18
},
"end": {
"line": 1,
"column": 27
}
},
"name": "arguments"
},
"generator": false,
"expression": false,
"params": [],
"body": {
"type": "BlockStatement",
"start": 30,
"end": 33,
"loc": {
"start": {
"line": 1,
"column": 30
},
"end": {
"line": 1,
"column": 33
}
},
"body": []
}
}
}
],
"kind": "var"
}
]
}
}

View File

@@ -0,0 +1 @@
var hello = function hi() { sayHi() };

View File

@@ -0,0 +1,180 @@
{
"type": "File",
"start": 0,
"end": 38,
"loc": {
"start": {
"line": 1,
"column": 0
},
"end": {
"line": 1,
"column": 38
}
},
"program": {
"type": "Program",
"start": 0,
"end": 38,
"loc": {
"start": {
"line": 1,
"column": 0
},
"end": {
"line": 1,
"column": 38
}
},
"sourceType": "script",
"body": [
{
"type": "VariableDeclaration",
"start": 0,
"end": 38,
"loc": {
"start": {
"line": 1,
"column": 0
},
"end": {
"line": 1,
"column": 38
}
},
"declarations": [
{
"type": "VariableDeclarator",
"start": 4,
"end": 37,
"loc": {
"start": {
"line": 1,
"column": 4
},
"end": {
"line": 1,
"column": 37
}
},
"id": {
"type": "Identifier",
"start": 4,
"end": 9,
"loc": {
"start": {
"line": 1,
"column": 4
},
"end": {
"line": 1,
"column": 9
}
},
"name": "hello"
},
"init": {
"type": "FunctionExpression",
"start": 12,
"end": 37,
"loc": {
"start": {
"line": 1,
"column": 12
},
"end": {
"line": 1,
"column": 37
}
},
"id": {
"type": "Identifier",
"start": 21,
"end": 23,
"loc": {
"start": {
"line": 1,
"column": 21
},
"end": {
"line": 1,
"column": 23
}
},
"name": "hi"
},
"generator": false,
"expression": false,
"params": [],
"body": {
"type": "BlockStatement",
"start": 26,
"end": 37,
"loc": {
"start": {
"line": 1,
"column": 26
},
"end": {
"line": 1,
"column": 37
}
},
"body": [
{
"type": "ExpressionStatement",
"start": 28,
"end": 35,
"loc": {
"start": {
"line": 1,
"column": 28
},
"end": {
"line": 1,
"column": 35
}
},
"expression": {
"type": "CallExpression",
"start": 28,
"end": 35,
"loc": {
"start": {
"line": 1,
"column": 28
},
"end": {
"line": 1,
"column": 35
}
},
"callee": {
"type": "Identifier",
"start": 28,
"end": 33,
"loc": {
"start": {
"line": 1,
"column": 28
},
"end": {
"line": 1,
"column": 33
}
},
"name": "sayHi"
},
"arguments": []
}
}
]
}
}
}
],
"kind": "var"
}
]
}
}

View File

@@ -0,0 +1 @@
(function(){})

View File

@@ -0,0 +1,84 @@
{
"type": "File",
"start": 0,
"end": 14,
"loc": {
"start": {
"line": 1,
"column": 0
},
"end": {
"line": 1,
"column": 14
}
},
"program": {
"type": "Program",
"start": 0,
"end": 14,
"loc": {
"start": {
"line": 1,
"column": 0
},
"end": {
"line": 1,
"column": 14
}
},
"sourceType": "script",
"body": [
{
"type": "ExpressionStatement",
"start": 0,
"end": 14,
"loc": {
"start": {
"line": 1,
"column": 0
},
"end": {
"line": 1,
"column": 14
}
},
"expression": {
"type": "FunctionExpression",
"start": 1,
"end": 13,
"loc": {
"start": {
"line": 1,
"column": 1
},
"end": {
"line": 1,
"column": 13
}
},
"id": null,
"generator": false,
"expression": false,
"params": [],
"body": {
"type": "BlockStatement",
"start": 11,
"end": 13,
"loc": {
"start": {
"line": 1,
"column": 11
},
"end": {
"line": 1,
"column": 13
}
},
"body": []
},
"parenthesizedExpression": true
}
}
]
}
}

View File

@@ -0,0 +1 @@
function universe(__proto__) { }

View File

@@ -0,0 +1,100 @@
{
"type": "File",
"start": 0,
"end": 32,
"loc": {
"start": {
"line": 1,
"column": 0
},
"end": {
"line": 1,
"column": 32
}
},
"program": {
"type": "Program",
"start": 0,
"end": 32,
"loc": {
"start": {
"line": 1,
"column": 0
},
"end": {
"line": 1,
"column": 32
}
},
"sourceType": "script",
"body": [
{
"type": "FunctionDeclaration",
"start": 0,
"end": 32,
"loc": {
"start": {
"line": 1,
"column": 0
},
"end": {
"line": 1,
"column": 32
}
},
"id": {
"type": "Identifier",
"start": 9,
"end": 17,
"loc": {
"start": {
"line": 1,
"column": 9
},
"end": {
"line": 1,
"column": 17
}
},
"name": "universe"
},
"generator": false,
"expression": false,
"params": [
{
"type": "Identifier",
"start": 18,
"end": 27,
"loc": {
"start": {
"line": 1,
"column": 18
},
"end": {
"line": 1,
"column": 27
}
},
"name": "__proto__"
}
],
"body": {
"type": "BlockStatement",
"start": 29,
"end": 32,
"loc": {
"start": {
"line": 1,
"column": 29
},
"end": {
"line": 1,
"column": 32
}
},
"body": []
}
}
]
}
}

View File

@@ -0,0 +1 @@
function test() { "use strict" + 42; }

View File

@@ -0,0 +1,151 @@
{
"type": "File",
"start": 0,
"end": 38,
"loc": {
"start": {
"line": 1,
"column": 0
},
"end": {
"line": 1,
"column": 38
}
},
"program": {
"type": "Program",
"start": 0,
"end": 38,
"loc": {
"start": {
"line": 1,
"column": 0
},
"end": {
"line": 1,
"column": 38
}
},
"sourceType": "script",
"body": [
{
"type": "FunctionDeclaration",
"start": 0,
"end": 38,
"loc": {
"start": {
"line": 1,
"column": 0
},
"end": {
"line": 1,
"column": 38
}
},
"id": {
"type": "Identifier",
"start": 9,
"end": 13,
"loc": {
"start": {
"line": 1,
"column": 9
},
"end": {
"line": 1,
"column": 13
}
},
"name": "test"
},
"generator": false,
"expression": false,
"params": [],
"body": {
"type": "BlockStatement",
"start": 16,
"end": 38,
"loc": {
"start": {
"line": 1,
"column": 16
},
"end": {
"line": 1,
"column": 38
}
},
"body": [
{
"type": "ExpressionStatement",
"start": 18,
"end": 36,
"loc": {
"start": {
"line": 1,
"column": 18
},
"end": {
"line": 1,
"column": 36
}
},
"expression": {
"type": "BinaryExpression",
"start": 18,
"end": 35,
"loc": {
"start": {
"line": 1,
"column": 18
},
"end": {
"line": 1,
"column": 35
}
},
"left": {
"type": "Literal",
"start": 18,
"end": 30,
"loc": {
"start": {
"line": 1,
"column": 18
},
"end": {
"line": 1,
"column": 30
}
},
"value": "use strict",
"rawValue": "use strict",
"raw": "\"use strict\""
},
"operator": "+",
"right": {
"type": "Literal",
"start": 33,
"end": 35,
"loc": {
"start": {
"line": 1,
"column": 33
},
"end": {
"line": 1,
"column": 35
}
},
"value": 42,
"rawValue": 42,
"raw": "42"
}
}
}
]
}
}
]
}
}

View File

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

View File

@@ -0,0 +1,83 @@
{
"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": "VariableDeclaration",
"start": 0,
"end": 5,
"loc": {
"start": {
"line": 1,
"column": 0
},
"end": {
"line": 1,
"column": 5
}
},
"declarations": [
{
"type": "VariableDeclarator",
"start": 4,
"end": 5,
"loc": {
"start": {
"line": 1,
"column": 4
},
"end": {
"line": 1,
"column": 5
}
},
"id": {
"type": "Identifier",
"start": 4,
"end": 5,
"loc": {
"start": {
"line": 1,
"column": 4
},
"end": {
"line": 1,
"column": 5
}
},
"name": "x"
},
"init": null
}
],
"kind": "let"
}
]
}
}

View File

@@ -0,0 +1 @@
{ let x }

View File

@@ -0,0 +1,100 @@
{
"type": "File",
"start": 0,
"end": 9,
"loc": {
"start": {
"line": 1,
"column": 0
},
"end": {
"line": 1,
"column": 9
}
},
"program": {
"type": "Program",
"start": 0,
"end": 9,
"loc": {
"start": {
"line": 1,
"column": 0
},
"end": {
"line": 1,
"column": 9
}
},
"sourceType": "script",
"body": [
{
"type": "BlockStatement",
"start": 0,
"end": 9,
"loc": {
"start": {
"line": 1,
"column": 0
},
"end": {
"line": 1,
"column": 9
}
},
"body": [
{
"type": "VariableDeclaration",
"start": 2,
"end": 7,
"loc": {
"start": {
"line": 1,
"column": 2
},
"end": {
"line": 1,
"column": 7
}
},
"declarations": [
{
"type": "VariableDeclarator",
"start": 6,
"end": 7,
"loc": {
"start": {
"line": 1,
"column": 6
},
"end": {
"line": 1,
"column": 7
}
},
"id": {
"type": "Identifier",
"start": 6,
"end": 7,
"loc": {
"start": {
"line": 1,
"column": 6
},
"end": {
"line": 1,
"column": 7
}
},
"name": "x"
},
"init": null
}
],
"kind": "let"
}
]
}
]
}
}

View File

@@ -0,0 +1 @@
{ let x = 42 }

View File

@@ -0,0 +1,117 @@
{
"type": "File",
"start": 0,
"end": 14,
"loc": {
"start": {
"line": 1,
"column": 0
},
"end": {
"line": 1,
"column": 14
}
},
"program": {
"type": "Program",
"start": 0,
"end": 14,
"loc": {
"start": {
"line": 1,
"column": 0
},
"end": {
"line": 1,
"column": 14
}
},
"sourceType": "script",
"body": [
{
"type": "BlockStatement",
"start": 0,
"end": 14,
"loc": {
"start": {
"line": 1,
"column": 0
},
"end": {
"line": 1,
"column": 14
}
},
"body": [
{
"type": "VariableDeclaration",
"start": 2,
"end": 12,
"loc": {
"start": {
"line": 1,
"column": 2
},
"end": {
"line": 1,
"column": 12
}
},
"declarations": [
{
"type": "VariableDeclarator",
"start": 6,
"end": 12,
"loc": {
"start": {
"line": 1,
"column": 6
},
"end": {
"line": 1,
"column": 12
}
},
"id": {
"type": "Identifier",
"start": 6,
"end": 7,
"loc": {
"start": {
"line": 1,
"column": 6
},
"end": {
"line": 1,
"column": 7
}
},
"name": "x"
},
"init": {
"type": "Literal",
"start": 10,
"end": 12,
"loc": {
"start": {
"line": 1,
"column": 10
},
"end": {
"line": 1,
"column": 12
}
},
"value": 42,
"rawValue": 42,
"raw": "42"
}
}
],
"kind": "let"
}
]
}
]
}
}

View File

@@ -0,0 +1 @@
{ let x = 14, y = 3, z = 1977 }

View File

@@ -0,0 +1,215 @@
{
"type": "File",
"start": 0,
"end": 31,
"loc": {
"start": {
"line": 1,
"column": 0
},
"end": {
"line": 1,
"column": 31
}
},
"program": {
"type": "Program",
"start": 0,
"end": 31,
"loc": {
"start": {
"line": 1,
"column": 0
},
"end": {
"line": 1,
"column": 31
}
},
"sourceType": "script",
"body": [
{
"type": "BlockStatement",
"start": 0,
"end": 31,
"loc": {
"start": {
"line": 1,
"column": 0
},
"end": {
"line": 1,
"column": 31
}
},
"body": [
{
"type": "VariableDeclaration",
"start": 2,
"end": 29,
"loc": {
"start": {
"line": 1,
"column": 2
},
"end": {
"line": 1,
"column": 29
}
},
"declarations": [
{
"type": "VariableDeclarator",
"start": 6,
"end": 12,
"loc": {
"start": {
"line": 1,
"column": 6
},
"end": {
"line": 1,
"column": 12
}
},
"id": {
"type": "Identifier",
"start": 6,
"end": 7,
"loc": {
"start": {
"line": 1,
"column": 6
},
"end": {
"line": 1,
"column": 7
}
},
"name": "x"
},
"init": {
"type": "Literal",
"start": 10,
"end": 12,
"loc": {
"start": {
"line": 1,
"column": 10
},
"end": {
"line": 1,
"column": 12
}
},
"value": 14,
"rawValue": 14,
"raw": "14"
}
},
{
"type": "VariableDeclarator",
"start": 14,
"end": 19,
"loc": {
"start": {
"line": 1,
"column": 14
},
"end": {
"line": 1,
"column": 19
}
},
"id": {
"type": "Identifier",
"start": 14,
"end": 15,
"loc": {
"start": {
"line": 1,
"column": 14
},
"end": {
"line": 1,
"column": 15
}
},
"name": "y"
},
"init": {
"type": "Literal",
"start": 18,
"end": 19,
"loc": {
"start": {
"line": 1,
"column": 18
},
"end": {
"line": 1,
"column": 19
}
},
"value": 3,
"rawValue": 3,
"raw": "3"
}
},
{
"type": "VariableDeclarator",
"start": 21,
"end": 29,
"loc": {
"start": {
"line": 1,
"column": 21
},
"end": {
"line": 1,
"column": 29
}
},
"id": {
"type": "Identifier",
"start": 21,
"end": 22,
"loc": {
"start": {
"line": 1,
"column": 21
},
"end": {
"line": 1,
"column": 22
}
},
"name": "z"
},
"init": {
"type": "Literal",
"start": 25,
"end": 29,
"loc": {
"start": {
"line": 1,
"column": 25
},
"end": {
"line": 1,
"column": 29
}
},
"value": 1977,
"rawValue": 1977,
"raw": "1977"
}
}
],
"kind": "let"
}
]
}
]
}
}

View File

@@ -0,0 +1 @@
(function () { 'use\x20strict'; with (i); }())

View File

@@ -0,0 +1,180 @@
{
"type": "File",
"start": 0,
"end": 46,
"loc": {
"start": {
"line": 1,
"column": 0
},
"end": {
"line": 1,
"column": 46
}
},
"program": {
"type": "Program",
"start": 0,
"end": 46,
"loc": {
"start": {
"line": 1,
"column": 0
},
"end": {
"line": 1,
"column": 46
}
},
"sourceType": "script",
"body": [
{
"type": "ExpressionStatement",
"start": 0,
"end": 46,
"loc": {
"start": {
"line": 1,
"column": 0
},
"end": {
"line": 1,
"column": 46
}
},
"expression": {
"type": "CallExpression",
"start": 1,
"end": 45,
"loc": {
"start": {
"line": 1,
"column": 1
},
"end": {
"line": 1,
"column": 45
}
},
"callee": {
"type": "FunctionExpression",
"start": 1,
"end": 43,
"loc": {
"start": {
"line": 1,
"column": 1
},
"end": {
"line": 1,
"column": 43
}
},
"id": null,
"generator": false,
"expression": false,
"params": [],
"body": {
"type": "BlockStatement",
"start": 13,
"end": 43,
"loc": {
"start": {
"line": 1,
"column": 13
},
"end": {
"line": 1,
"column": 43
}
},
"body": [
{
"type": "ExpressionStatement",
"start": 15,
"end": 31,
"loc": {
"start": {
"line": 1,
"column": 15
},
"end": {
"line": 1,
"column": 31
}
},
"expression": {
"type": "Literal",
"start": 15,
"end": 30,
"loc": {
"start": {
"line": 1,
"column": 15
},
"end": {
"line": 1,
"column": 30
}
},
"value": "use strict",
"rawValue": "use strict",
"raw": "'use\\x20strict'"
}
},
{
"type": "WithStatement",
"start": 32,
"end": 41,
"loc": {
"start": {
"line": 1,
"column": 32
},
"end": {
"line": 1,
"column": 41
}
},
"object": {
"type": "Identifier",
"start": 38,
"end": 39,
"loc": {
"start": {
"line": 1,
"column": 38
},
"end": {
"line": 1,
"column": 39
}
},
"name": "i"
},
"body": {
"type": "EmptyStatement",
"start": 40,
"end": 41,
"loc": {
"start": {
"line": 1,
"column": 40
},
"end": {
"line": 1,
"column": 41
}
}
}
}
]
}
},
"arguments": [],
"parenthesizedExpression": true
}
}
]
}
}

View File

@@ -0,0 +1 @@
(function () { 'use\nstrict'; with (i); }())

View File

@@ -0,0 +1,180 @@
{
"type": "File",
"start": 0,
"end": 44,
"loc": {
"start": {
"line": 1,
"column": 0
},
"end": {
"line": 1,
"column": 44
}
},
"program": {
"type": "Program",
"start": 0,
"end": 44,
"loc": {
"start": {
"line": 1,
"column": 0
},
"end": {
"line": 1,
"column": 44
}
},
"sourceType": "script",
"body": [
{
"type": "ExpressionStatement",
"start": 0,
"end": 44,
"loc": {
"start": {
"line": 1,
"column": 0
},
"end": {
"line": 1,
"column": 44
}
},
"expression": {
"type": "CallExpression",
"start": 1,
"end": 43,
"loc": {
"start": {
"line": 1,
"column": 1
},
"end": {
"line": 1,
"column": 43
}
},
"callee": {
"type": "FunctionExpression",
"start": 1,
"end": 41,
"loc": {
"start": {
"line": 1,
"column": 1
},
"end": {
"line": 1,
"column": 41
}
},
"id": null,
"generator": false,
"expression": false,
"params": [],
"body": {
"type": "BlockStatement",
"start": 13,
"end": 41,
"loc": {
"start": {
"line": 1,
"column": 13
},
"end": {
"line": 1,
"column": 41
}
},
"body": [
{
"type": "ExpressionStatement",
"start": 15,
"end": 29,
"loc": {
"start": {
"line": 1,
"column": 15
},
"end": {
"line": 1,
"column": 29
}
},
"expression": {
"type": "Literal",
"start": 15,
"end": 28,
"loc": {
"start": {
"line": 1,
"column": 15
},
"end": {
"line": 1,
"column": 28
}
},
"value": "use\nstrict",
"rawValue": "use\nstrict",
"raw": "'use\\nstrict'"
}
},
{
"type": "WithStatement",
"start": 30,
"end": 39,
"loc": {
"start": {
"line": 1,
"column": 30
},
"end": {
"line": 1,
"column": 39
}
},
"object": {
"type": "Identifier",
"start": 36,
"end": 37,
"loc": {
"start": {
"line": 1,
"column": 36
},
"end": {
"line": 1,
"column": 37
}
},
"name": "i"
},
"body": {
"type": "EmptyStatement",
"start": 38,
"end": 39,
"loc": {
"start": {
"line": 1,
"column": 38
},
"end": {
"line": 1,
"column": 39
}
}
}
}
]
}
},
"arguments": [],
"parenthesizedExpression": true
}
}
]
}
}

View File

@@ -0,0 +1 @@
([a]) => [0];

View File

@@ -0,0 +1,136 @@
{
"type": "File",
"start": 0,
"end": 13,
"loc": {
"start": {
"line": 1,
"column": 0
},
"end": {
"line": 1,
"column": 13
}
},
"program": {
"type": "Program",
"start": 0,
"end": 13,
"loc": {
"start": {
"line": 1,
"column": 0
},
"end": {
"line": 1,
"column": 13
}
},
"sourceType": "script",
"body": [
{
"type": "ExpressionStatement",
"start": 0,
"end": 13,
"loc": {
"start": {
"line": 1,
"column": 0
},
"end": {
"line": 1,
"column": 13
}
},
"expression": {
"type": "ArrowFunctionExpression",
"start": 0,
"end": 12,
"loc": {
"start": {
"line": 1,
"column": 0
},
"end": {
"line": 1,
"column": 12
}
},
"id": null,
"generator": false,
"expression": true,
"params": [
{
"type": "ArrayPattern",
"start": 1,
"end": 4,
"loc": {
"start": {
"line": 1,
"column": 1
},
"end": {
"line": 1,
"column": 4
}
},
"elements": [
{
"type": "Identifier",
"start": 2,
"end": 3,
"loc": {
"start": {
"line": 1,
"column": 2
},
"end": {
"line": 1,
"column": 3
}
},
"name": "a"
}
]
}
],
"body": {
"type": "ArrayExpression",
"start": 9,
"end": 12,
"loc": {
"start": {
"line": 1,
"column": 9
},
"end": {
"line": 1,
"column": 12
}
},
"elements": [
{
"type": "Literal",
"start": 10,
"end": 11,
"loc": {
"start": {
"line": 1,
"column": 10
},
"end": {
"line": 1,
"column": 11
}
},
"value": 0,
"rawValue": 0,
"raw": "0"
}
]
}
}
}
]
}
}

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