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

pull/12885/head
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
1 changed files with 1 additions and 1 deletions

View File

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