jsgen: proper jsdoc for namespace
parent
26cb9e4b9f
commit
cb82ff618b
|
@ -99,7 +99,7 @@ pub fn gen(files []ast.File, table &table.Table, pref &pref.Preferences) string
|
|||
g.finish()
|
||||
mut out := g.hashes() + g.definitions.str() + g.constants.str()
|
||||
for node in deps_resolved.nodes {
|
||||
out += '/* namespace: $node.name */\n'
|
||||
out += g.doc.gen_namespace(node.name)
|
||||
out += 'const $node.name = (function ('
|
||||
imports := g.namespace_imports[node.name]
|
||||
for i, key in imports.keys() {
|
||||
|
|
|
@ -96,3 +96,9 @@ fn (mut d JsDoc) gen_fn(it ast.FnDecl) string {
|
|||
d.write('*/')
|
||||
return d.out.str()
|
||||
}
|
||||
|
||||
fn (mut d JsDoc) gen_namespace(ns string) string {
|
||||
d.reset()
|
||||
d.writeln('/** @namespace ${ns} */')
|
||||
return d.out.str()
|
||||
}
|
||||
|
|
Loading…
Reference in New Issue