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

js: dont use async js_main in '-es5' mode (#12870)

This commit is contained in:
pancake 2021-12-17 15:37:19 +01:00 committed by GitHub
parent 4ecdb28f5a
commit 08766da7e8
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -629,7 +629,7 @@ fn (mut g JsGen) gen_method_decl(it ast.FnDecl, typ FnGenType) {
if is_main {
// there is no concept of main in JS but we do have iife
g.writeln('/* program entry point */')
if g.pref.output_es5 {
if !g.pref.output_es5 {
// main function is always async
g.write('async ')
}