Skip to content

Commit

Permalink
v.gen.js: cleanup notices for compiling the JS backend
Browse files Browse the repository at this point in the history
  • Loading branch information
spytheman committed Jan 28, 2024
1 parent aec2a15 commit a327d49
Showing 1 changed file with 2 additions and 7 deletions.
9 changes: 2 additions & 7 deletions vlib/v/gen/js/js.v
Expand Up @@ -102,13 +102,8 @@ pub fn gen(files []&ast.File, table &ast.Table, pref_ &pref.Preferences) string
definitions: strings.new_builder(100)
table: table
pref: pref_
fn_decl: 0
empty_line: true
doc: 0
ns: 0
enable_doc: true
file: 0
sourcemap: 0
}
g.doc = new_jsdoc(g)
// TODO: Add '[-no]-jsdoc' flag
Expand Down Expand Up @@ -441,7 +436,7 @@ pub fn (mut g JsGen) find_class_methods(stmts []ast.Stmt) {
// Found struct method, store it to be generated along with the class.
mut class_name := g.table.get_type_name(stmt.receiver.typ)
// Workaround until `map[key] << val` works.
mut arr := g.method_fn_decls[class_name]
mut arr := unsafe { g.method_fn_decls[class_name] }
arr << stmt
g.method_fn_decls[class_name] = arr
}
Expand Down Expand Up @@ -2049,7 +2044,7 @@ fn (mut g JsGen) gen_struct_decl(node ast.StructDecl) {
}
}
}
fns := g.method_fn_decls[name]
fns := unsafe { g.method_fn_decls[name] }
// gen toString method
fn_names := fns.map(it.name)
if 'toString' !in fn_names {
Expand Down

0 comments on commit a327d49

Please sign in to comment.