diff --git a/cli/lib/tsd-jsdoc/README.md b/cli/lib/tsd-jsdoc/README.md index 316719e12..beed748fc 100644 --- a/cli/lib/tsd-jsdoc/README.md +++ b/cli/lib/tsd-jsdoc/README.md @@ -1,7 +1,7 @@ protobuf.js fork of tsd-jsdoc ============================= -This is a slightly modified and restructured version of [tsd-jsdoc](https://github.com/englercj/tsd-jsdoc) for use with protobuf.js, parked here so we can process issues and pull requests. +This is a modified version of [tsd-jsdoc](https://github.com/englercj/tsd-jsdoc) v1.0.1 for use with protobuf.js, parked here so we can process issues and pull requests. The ultimate goal is to switch back to the a recent version of tsd-jsdoc once it meets our needs. Options ------- diff --git a/cli/targets/static.js b/cli/targets/static.js index 7a3dea453..e6844f7bc 100644 --- a/cli/targets/static.js +++ b/cli/targets/static.js @@ -279,7 +279,7 @@ function toJsType(field) { type = "Uint8Array"; break; default: - if (field.resolvedType instanceof Enum) + if (field.resolve().resolvedType instanceof Enum) type = field.resolvedType.fullName.substring(1); // reference the enum else if (field.resolvedType instanceof Type) type = field.resolvedType.fullName.substring(1) + "$Properties"; // reference the interface @@ -302,10 +302,9 @@ function buildType(ref, type) { "@type {Object}" ]; type.fieldsArray.forEach(function(field) { - var jsType = toJsType(field), - prop = util.safeProp(field.name); + var prop = util.safeProp(field.name); prop = prop.substring(1, prop.charAt(0) === "[" ? prop.length - 1 : prop.length); - typeDef.push("@property {" + jsType + "} " + (field.optional ? "[" + prop + "]" : field.name) + " " + (field.comment || type.name + " " + field.name + ".")); + typeDef.push("@property {" + toJsType(field) + "} " + (field.optional ? "[" + prop + "]" : field.name) + " " + (field.comment || type.name + " " + field.name + ".")); }); push(""); pushComment(typeDef);