forbid function declarations that reference block scoped variables
This commit is contained in:
7
test/fixtures/syntax/let-scoping/no-nested-function-declarations/actual.js
vendored
Normal file
7
test/fixtures/syntax/let-scoping/no-nested-function-declarations/actual.js
vendored
Normal file
@@ -0,0 +1,7 @@
|
||||
var numbers = [1, 2, 3];
|
||||
|
||||
for (let i in numbers) {
|
||||
function foo() {
|
||||
return i;
|
||||
}
|
||||
}
|
||||
3
test/fixtures/syntax/let-scoping/no-nested-function-declarations/options.json
vendored
Normal file
3
test/fixtures/syntax/let-scoping/no-nested-function-declarations/options.json
vendored
Normal file
@@ -0,0 +1,3 @@
|
||||
{
|
||||
"throws": "`FunctionDeclaration`s that use `let` and `constant` references aren't allowed outside of the root scope"
|
||||
}
|
||||
Reference in New Issue
Block a user