From 9c66a00755bcc7b14e91c922ce95a2b0aa9f763f Mon Sep 17 00:00:00 2001 From: Michael Mathews Date: Tue, 10 Aug 2010 17:26:20 +0100 Subject: [PATCH] Fixed bug that prevented functions from being attached to non-classes in Haruki template. --- templates/haruki/publish.js | 9 +++++---- 1 file changed, 5 insertions(+), 4 deletions(-) diff --git a/templates/haruki/publish.js b/templates/haruki/publish.js index 2c10c5c1..0b5233a9 100644 --- a/templates/haruki/publish.js +++ b/templates/haruki/publish.js @@ -18,9 +18,10 @@ addDocNode(thisNamespace, from, element.path, element.name); } else if (element.kind === 'method') { - //var _to = to; if (element.scope === 'static') { - to = to.constructor; + if (to.constructo) { // like a class + to = to.constructor; + } } if (! to.functions) { @@ -28,6 +29,7 @@ } var thisFunction = to.functions[element.name] = { "name" : element.name, + "access": element.access || "", "description" : element.desc || "", "parameters": [ ] @@ -43,8 +45,6 @@ "nullable": typeof element.param[i].nullable === 'boolean'? element.param[i].nullable : "" }); } - //to = _to; - } else if (element.kind === 'property') { if (! to.properties) { @@ -52,6 +52,7 @@ } to.properties[element.name] = { "name" : element.name, + "access": element.access || "", "description" : element.desc || "", "type": element.type? (element.type.length === 1? element.type[0] : element.type) : "" };