jsgen: basic struct embedding support (#9879)
parent
3c0a368af3
commit
8b22dbbadb
|
@ -1085,6 +1085,10 @@ fn (mut g JsGen) gen_struct_decl(node ast.StructDecl) {
|
|||
g.writeln('};')
|
||||
g.writeln('${js_name}.prototype = {')
|
||||
g.inc_indent()
|
||||
for embed in node.embeds {
|
||||
etyp := g.typ(embed.typ)
|
||||
g.writeln('...${etyp}.prototype,')
|
||||
}
|
||||
fns := g.method_fn_decls[name]
|
||||
for field in node.fields {
|
||||
typ := g.typ(field.typ)
|
||||
|
|
Loading…
Reference in New Issue