* feat: v8intrinsic syntax plugin Implement V8 Intrinsic Syntax Extension. Here we check the execution branch inside the parseSubscript to make sure the V8IntrinsicIdentifier is immediately followed by a call expression. * feat: disable combining placeholders and v8intrisic per https://github.com/babel/babel/issues/10104#issuecomment-506950969 * test: add more error cases * refactor: parse v8 intrinsic in parseExprAtom This approach is identical to V8’s implementation. Move the test cases as the behaviour changes. * fix: plugin-name typo * test: add yield-expression test case * feat: require startsExpr on modulo for v8intrinsic * perf: skip eof and braceR check as they must return false * Print V8IntrinsicIdentifier * feat: add v8intrinsic to parser typings * Add generated type helpers * fix: incorrect type definition * fix: allow V8IntrinsicIdentifier to be callee
124 lines
2.5 KiB
JSON
124 lines
2.5 KiB
JSON
{
|
|
"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",
|
|
"interpreter": null,
|
|
"body": [
|
|
{
|
|
"type": "ExpressionStatement",
|
|
"start": 0,
|
|
"end": 26,
|
|
"loc": {
|
|
"start": {
|
|
"line": 1,
|
|
"column": 0
|
|
},
|
|
"end": {
|
|
"line": 1,
|
|
"column": 26
|
|
}
|
|
},
|
|
"expression": {
|
|
"type": "CallExpression",
|
|
"start": 0,
|
|
"end": 25,
|
|
"loc": {
|
|
"start": {
|
|
"line": 1,
|
|
"column": 0
|
|
},
|
|
"end": {
|
|
"line": 1,
|
|
"column": 25
|
|
}
|
|
},
|
|
"callee": {
|
|
"type": "V8IntrinsicIdentifier",
|
|
"start": 0,
|
|
"end": 15,
|
|
"loc": {
|
|
"start": {
|
|
"line": 1,
|
|
"column": 0
|
|
},
|
|
"end": {
|
|
"line": 1,
|
|
"column": 15
|
|
},
|
|
"identifierName": "StringParseInt"
|
|
},
|
|
"name": "StringParseInt"
|
|
},
|
|
"arguments": [
|
|
{
|
|
"type": "StringLiteral",
|
|
"start": 16,
|
|
"end": 20,
|
|
"loc": {
|
|
"start": {
|
|
"line": 1,
|
|
"column": 16
|
|
},
|
|
"end": {
|
|
"line": 1,
|
|
"column": 20
|
|
}
|
|
},
|
|
"extra": {
|
|
"rawValue": "42",
|
|
"raw": "\"42\""
|
|
},
|
|
"value": "42"
|
|
},
|
|
{
|
|
"type": "NumericLiteral",
|
|
"start": 22,
|
|
"end": 24,
|
|
"loc": {
|
|
"start": {
|
|
"line": 1,
|
|
"column": 22
|
|
},
|
|
"end": {
|
|
"line": 1,
|
|
"column": 24
|
|
}
|
|
},
|
|
"extra": {
|
|
"rawValue": 10,
|
|
"raw": "10"
|
|
},
|
|
"value": 10
|
|
}
|
|
]
|
|
}
|
|
}
|
|
],
|
|
"directives": []
|
|
}
|
|
} |