Disallow async functions as loop bodies (#9314)
This commit is contained in:
committed by
Henry Zhu
parent
a27b9b4299
commit
0a88230ec4
@@ -0,0 +1,3 @@
|
||||
{
|
||||
"throws": "Function declaration not allowed in this context (1:10)"
|
||||
}
|
||||
@@ -0,0 +1 @@
|
||||
while (1) foo: bar: function foo(){}
|
||||
@@ -0,0 +1,3 @@
|
||||
{
|
||||
"throws": "Function declaration not allowed in this context (1:20)"
|
||||
}
|
||||
@@ -1,3 +0,0 @@
|
||||
{
|
||||
"throws": "Unexpected token (1:10)"
|
||||
}
|
||||
1
packages/babel-parser/test/fixtures/es2017/async-functions/invalid-inside-loop/input.js
vendored
Normal file
1
packages/babel-parser/test/fixtures/es2017/async-functions/invalid-inside-loop/input.js
vendored
Normal file
@@ -0,0 +1 @@
|
||||
while (1) async function foo(){}
|
||||
3
packages/babel-parser/test/fixtures/es2017/async-functions/invalid-inside-loop/options.json
vendored
Normal file
3
packages/babel-parser/test/fixtures/es2017/async-functions/invalid-inside-loop/options.json
vendored
Normal file
@@ -0,0 +1,3 @@
|
||||
{
|
||||
"throws": "Function declaration not allowed in this context (1:10)"
|
||||
}
|
||||
Reference in New Issue
Block a user