fix parser bug where arrow functions have a higher precedence than they should - fixes #2118
This commit is contained in:
1
packages/babylon/test/fixtures/experimental/async-functions/expression-statement/actual.js
vendored
Normal file
1
packages/babylon/test/fixtures/experimental/async-functions/expression-statement/actual.js
vendored
Normal file
@@ -0,0 +1 @@
|
||||
async () => {}
|
||||
86
packages/babylon/test/fixtures/experimental/async-functions/expression-statement/expected.json
vendored
Normal file
86
packages/babylon/test/fixtures/experimental/async-functions/expression-statement/expected.json
vendored
Normal file
@@ -0,0 +1,86 @@
|
||||
{
|
||||
"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": "ArrowFunctionExpression",
|
||||
"start": 0,
|
||||
"end": 14,
|
||||
"loc": {
|
||||
"start": {
|
||||
"line": 1,
|
||||
"column": 0
|
||||
},
|
||||
"end": {
|
||||
"line": 1,
|
||||
"column": 14
|
||||
}
|
||||
},
|
||||
"id": null,
|
||||
"generator": false,
|
||||
"expression": false,
|
||||
"async": true,
|
||||
"params": [],
|
||||
"body": {
|
||||
"type": "BlockStatement",
|
||||
"start": 12,
|
||||
"end": 14,
|
||||
"loc": {
|
||||
"start": {
|
||||
"line": 1,
|
||||
"column": 12
|
||||
},
|
||||
"end": {
|
||||
"line": 1,
|
||||
"column": 14
|
||||
}
|
||||
},
|
||||
"body": [],
|
||||
"directives": []
|
||||
}
|
||||
}
|
||||
}
|
||||
],
|
||||
"directives": []
|
||||
}
|
||||
}
|
||||
1
packages/babylon/test/fixtures/experimental/async-functions/no-callee/actual.js
vendored
Normal file
1
packages/babylon/test/fixtures/experimental/async-functions/no-callee/actual.js
vendored
Normal file
@@ -0,0 +1 @@
|
||||
async () => {}()
|
||||
3
packages/babylon/test/fixtures/experimental/async-functions/no-callee/options.json
vendored
Normal file
3
packages/babylon/test/fixtures/experimental/async-functions/no-callee/options.json
vendored
Normal file
@@ -0,0 +1,3 @@
|
||||
{
|
||||
"throws": "Unexpected token (1:14)"
|
||||
}
|
||||
1
packages/babylon/test/fixtures/flow/regression/issue-2154/actual.js
vendored
Normal file
1
packages/babylon/test/fixtures/flow/regression/issue-2154/actual.js
vendored
Normal file
@@ -0,0 +1 @@
|
||||
!()=>0
|
||||
3
packages/babylon/test/fixtures/flow/regression/issue-2154/options.json
vendored
Normal file
3
packages/babylon/test/fixtures/flow/regression/issue-2154/options.json
vendored
Normal file
@@ -0,0 +1,3 @@
|
||||
{
|
||||
"throws": "Unexpected token (1:2)"
|
||||
}
|
||||
@@ -1 +1 @@
|
||||
var foo = bar ? (foo) : number => {} : baz;
|
||||
var foo = bar ? (foo) : number => {} : baz;
|
||||
|
||||
1
packages/babylon/test/fixtures/harmony/arrow-functions/no-callee/actual.js
vendored
Normal file
1
packages/babylon/test/fixtures/harmony/arrow-functions/no-callee/actual.js
vendored
Normal file
@@ -0,0 +1 @@
|
||||
() => {}()
|
||||
3
packages/babylon/test/fixtures/harmony/arrow-functions/no-callee/options.json
vendored
Normal file
3
packages/babylon/test/fixtures/harmony/arrow-functions/no-callee/options.json
vendored
Normal file
@@ -0,0 +1,3 @@
|
||||
{
|
||||
"throws": "Unexpected token (1:8)"
|
||||
}
|
||||
Reference in New Issue
Block a user