mirror of
https://github.com/vlang/v.git
synced 2023-08-10 21:13:21 +03:00
jsgen: basic struct embedding support (#9879)
This commit is contained in:
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
Block a user