Nicolò Ribaudo 34937f13d5
Trailing comma after rest - The final fix (#10491)
* [parser] Track trailing commas in extras instead of state

* Update existing tests

* Update test262 whitelist

* Improve error message and location

* nit

* Use lookaheadCharCode
2019-10-08 23:08:50 +02:00

181 lines
4.1 KiB
JSON

{
"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",
"interpreter": null,
"body": [
{
"type": "ExpressionStatement",
"start": 0,
"end": 39,
"loc": {
"start": {
"line": 1,
"column": 0
},
"end": {
"line": 1,
"column": 39
}
},
"expression": {
"type": "ObjectExpression",
"start": 1,
"end": 38,
"loc": {
"start": {
"line": 1,
"column": 1
},
"end": {
"line": 1,
"column": 38
}
},
"properties": [
{
"type": "ObjectProperty",
"start": 3,
"end": 20,
"loc": {
"start": {
"line": 1,
"column": 3
},
"end": {
"line": 1,
"column": 20
}
},
"method": false,
"key": {
"type": "StringLiteral",
"start": 3,
"end": 14,
"loc": {
"start": {
"line": 1,
"column": 3
},
"end": {
"line": 1,
"column": 14
}
},
"extra": {
"rawValue": "__proto__",
"raw": "\"__proto__\""
},
"value": "__proto__"
},
"computed": false,
"shorthand": false,
"value": {
"type": "NullLiteral",
"start": 16,
"end": 20,
"loc": {
"start": {
"line": 1,
"column": 16
},
"end": {
"line": 1,
"column": 20
}
}
}
},
{
"type": "ObjectMethod",
"start": 22,
"end": 35,
"loc": {
"start": {
"line": 1,
"column": 22
},
"end": {
"line": 1,
"column": 35
}
},
"method": true,
"key": {
"type": "Identifier",
"start": 22,
"end": 31,
"loc": {
"start": {
"line": 1,
"column": 22
},
"end": {
"line": 1,
"column": 31
},
"identifierName": "__proto__"
},
"name": "__proto__"
},
"computed": false,
"kind": "method",
"id": null,
"generator": false,
"async": false,
"params": [],
"body": {
"type": "BlockStatement",
"start": 33,
"end": 35,
"loc": {
"start": {
"line": 1,
"column": 33
},
"end": {
"line": 1,
"column": 35
}
},
"body": [],
"directives": []
}
}
],
"extra": {
"trailingComma": 35,
"parenthesized": true,
"parenStart": 0
}
}
}
],
"directives": []
}
}