parser: don't disallow closures in the JS backend (#9884)

pull/9887/head
spaceface 2021-04-26 09:00:39 +02:00 committed by GitHub
parent f5ce9388de
commit 9d68f924c3
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
1 changed files with 3 additions and 1 deletions

View File

@ -590,7 +590,9 @@ fn (mut p Parser) anon_fn() ast.AnonFn {
return ast.AnonFn{}
}
p.open_scope()
p.scope.detached_from_parent = true
if p.pref.backend != .js {
p.scope.detached_from_parent = true
}
// TODO generics
args, _, is_variadic := p.fn_args()
for arg in args {