Small tweaks required to get ready for upgrade to rhino 1.7r4.

This commit is contained in:
Michael Mathews 2012-07-04 23:53:19 +01:00
parent 81f145708d
commit 901d17baa3
3 changed files with 8 additions and 6 deletions

1
jsdoc
View File

@ -8,6 +8,7 @@ BASEPATH="$( cd -P "$( dirname "$SOURCE" )" && pwd )"
# for whatever reason, Rhino requires module paths to be valid URIs # for whatever reason, Rhino requires module paths to be valid URIs
URLPATH="file://"$BASEPATH URLPATH="file://"$BASEPATH
URLPATH=`echo "$URLPATH" | sed -e 's/ /%20/g'` URLPATH=`echo "$URLPATH" | sed -e 's/ /%20/g'`
ENCODEDBASEPATH=`echo "$BASEPATH" | sed -e 's/ /%20/g'`
if test $1 = "--debug" if test $1 = "--debug"
then then

View File

@ -76,7 +76,7 @@ function include(filepath) {
load(filepath); load(filepath);
} }
catch (e) { catch (e) {
console.log('Cannot include "' + __dirname + '/' + filepath + '": '+e); console.log('Cannot include "' + filepath + '": '+e);
} }
} }
include.resolve = function(filepath) { include.resolve = function(filepath) {

View File

@ -349,7 +349,7 @@ function visitNode(node) {
else if (node.type === Token.ASSIGN) { else if (node.type === Token.ASSIGN) {
e = { e = {
id: 'astnode'+node.hashCode(), // the id of the ASSIGN node id: 'astnode'+node.hashCode(), // the id of the ASSIGN node
comment: String(node.jsDoc||'@undocumented'), comment: String(node.getJsDoc()||'@undocumented'),
lineno: node.left.getLineno(), lineno: node.left.getLineno(),
filename: currentSourceName, filename: currentSourceName,
astnode: node, astnode: node,
@ -365,7 +365,7 @@ function visitNode(node) {
else if (node.type === Token.COLON) { // assignment within an object literal else if (node.type === Token.COLON) { // assignment within an object literal
e = { e = {
id: 'astnode'+node.hashCode(), // the id of the COLON node id: 'astnode'+node.hashCode(), // the id of the COLON node
comment: String(node.left.jsDoc||'@undocumented'), comment: String(node.left.getJsDoc()||'@undocumented'),
lineno: node.left.getLineno(), lineno: node.left.getLineno(),
filename: currentSourceName, filename: currentSourceName,
astnode: node, astnode: node,
@ -382,12 +382,13 @@ function visitNode(node) {
if (node.parent.variables.toArray()[0] === node) { // like /** blah */ var a=1, b=2, c=3; if (node.parent.variables.toArray()[0] === node) { // like /** blah */ var a=1, b=2, c=3;
// the first var assignment gets any jsDoc before the whole var series // the first var assignment gets any jsDoc before the whole var series
node.jsDoc = node.parent.jsDoc; if (typeof node.setJsDoc !== 'undefined') { node.setJsDoc( node.parent.getJsDoc() ); }
//node.jsDoc = node.parent.jsDoc;
} }
e = { e = {
id: 'astnode'+node.hashCode(), // the id of the VARIABLE node id: 'astnode'+node.hashCode(), // the id of the VARIABLE node
comment: String(node.jsDoc||'@undocumented'), comment: String(node.getJsDoc()||'@undocumented'),
lineno: node.getLineno(), lineno: node.getLineno(),
filename: currentSourceName, filename: currentSourceName,
astnode: node, astnode: node,
@ -412,7 +413,7 @@ function visitNode(node) {
else if (node.type == Token.FUNCTION || node.type == tkn.NAMEDFUNCTIONSTATEMENT) { else if (node.type == Token.FUNCTION || node.type == tkn.NAMEDFUNCTIONSTATEMENT) {
e = { e = {
id: 'astnode'+node.hashCode(), // the id of the COLON node id: 'astnode'+node.hashCode(), // the id of the COLON node
comment: String(node.jsDoc||'@undocumented'), comment: String(node.getJsDoc()||'@undocumented'),
lineno: node.getLineno(), lineno: node.getLineno(),
filename: currentSourceName, filename: currentSourceName,
astnode: node, astnode: node,