1
0
mirror of https://github.com/vlang/v.git synced 2023-08-10 21:13:21 +03:00

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

This commit is contained in:
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

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 {