From dac7203816a81af6ded08c3e71619568fc8bbde6 Mon Sep 17 00:00:00 2001 From: Jeff Williams Date: Tue, 3 Jul 2012 19:07:19 -0700 Subject: [PATCH] don't use each() to iterate over an array, and remove another unnecessary semicolon this fixes a JSHint error that cannot be suppressed. --- rhino_modules/jsdoc/doclet.js | 4 ++-- rhino_modules/jsdoc/src/parser.js | 12 +++++++++--- 2 files changed, 11 insertions(+), 5 deletions(-) diff --git a/rhino_modules/jsdoc/doclet.js b/rhino_modules/jsdoc/doclet.js index 48d9f86c..1e415e09 100644 --- a/rhino_modules/jsdoc/doclet.js +++ b/rhino_modules/jsdoc/doclet.js @@ -269,8 +269,8 @@ function toTags(docletSrc) { docletSrc = unwrap(docletSrc); tagSrcs = split(docletSrc); - for each(tagSrc in tagSrcs) { - tags.push( {title: tagSrc.title, text: tagSrc.text} ); + for (var i = 0, l = tagSrcs.length; i < l; i++) { + tags.push( {title: tagSrcs[i].title, text: tagSrcs[i].text} ); } return tags; diff --git a/rhino_modules/jsdoc/src/parser.js b/rhino_modules/jsdoc/src/parser.js index 2d8e61e6..55253ab9 100644 --- a/rhino_modules/jsdoc/src/parser.js +++ b/rhino_modules/jsdoc/src/parser.js @@ -321,12 +321,18 @@ exports.Parser.prototype.resolveEnum = function(e) { /** @private */ function visitNode(node) { var e, - commentSrc; + nodeComments, + comment, + commentSrc, + i, + l; // look for stand-alone doc comments if (node.type === Token.SCRIPT && node.comments) { // note: ALL comments are seen in this block... - for each(var comment in node.comments.toArray()) { + nodeComments = node.comments.toArray(); + for (i = 0, l = nodeComments.length; i < l; i++) { + comment = nodeComments[i]; if (comment.commentType !== Token.CommentType.JSDOC) { continue; } @@ -578,7 +584,7 @@ function nodeToString(node) { } return '' + str; -}; +} /** @private @memberof module:src/parser.Parser