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

gen: fix js main entry point generation

This commit is contained in:
Delyan Angelov 2020-07-01 19:37:18 +03:00
parent 5de0f944bd
commit 56ae814cbc

View File

@ -811,7 +811,7 @@ fn fn_has_go(it ast.FnDecl) bool {
fn (mut g JsGen) gen_method_decl(it ast.FnDecl) { fn (mut g JsGen) gen_method_decl(it ast.FnDecl) {
g.fn_decl = &it g.fn_decl = &it
has_go := fn_has_go(it) has_go := fn_has_go(it)
is_main := it.name == 'main' is_main := it.name == 'main.main'
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 */')