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

jsgen: fix jsdoc class namespacing bug

This commit is contained in:
spaceface777 2020-05-20 20:34:37 +02:00 committed by GitHub
parent 10ad5332e8
commit d4c1ea4bba
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
3 changed files with 5 additions and 5 deletions

View File

@ -212,8 +212,8 @@ pub fn (mut g JsGen) typ(t table.Type) string {
return res + ') => ' + g.typ(info.func.return_type)
}
// Struct instance => ns["class"]["prototype"]
if sym.kind == .struct_ {
return g.to_js_typ(styp) + '["prototype"]'
if sym.kind == .struct_ && get_ns(styp).len > 0 {
return g.to_js_typ(g.get_alias(styp)) + '["prototype"]'
}
return g.to_js_typ(styp)
}

View File

@ -1,5 +1,5 @@
// V_COMMIT_HASH 74686d0
// V_CURRENT_COMMIT_HASH 577d252
// V_CURRENT_COMMIT_HASH 0d3f133
// Generated by the V compiler
"use strict";
@ -74,7 +74,7 @@ const hello = (function () {
const main = (function (hl) {
class Foo {
/**
* @param {{a?: hello["A"]["prototype"]}} values - values for this class fields
* @param {{a?: hl["A"]["prototype"]}} values - values for this class fields
* @constructor
*/
constructor(values) {

View File

@ -1,5 +1,5 @@
// V_COMMIT_HASH 74686d0
// V_CURRENT_COMMIT_HASH 577d252
// V_CURRENT_COMMIT_HASH 0d3f133
// Generated by the V compiler
"use strict";