From b51fb9cfa9a3a22621bb7340c119bcd3dd797077 Mon Sep 17 00:00:00 2001 From: Jeremy Ruston Date: Fri, 5 Jul 2013 22:37:55 +0100 Subject: [PATCH] Linting --- core/modules/commands/server.js | 2 +- core/modules/filters/backlinks.js | 2 +- core/modules/filters/field.js | 2 +- core/modules/filters/has.js | 2 +- core/modules/filters/links.js | 2 +- core/modules/filters/list.js | 2 +- core/modules/filters/prefix.js | 2 +- core/modules/filters/sameday.js | 2 +- core/modules/filters/tag.js | 2 +- core/modules/filters/tagging.js | 2 +- core/modules/filters/tags.js | 2 +- core/modules/filters/title.js | 2 +- core/modules/parsers/wikiparser/rules/html.js | 4 ++-- core/modules/parsers/wikiparser/rules/list.js | 2 +- core/modules/rendertree/wikirendertree.js | 11 ++++++----- 15 files changed, 21 insertions(+), 20 deletions(-) diff --git a/core/modules/commands/server.js b/core/modules/commands/server.js index ec8cdbbc0..3b6f39b22 100644 --- a/core/modules/commands/server.js +++ b/core/modules/commands/server.js @@ -198,7 +198,7 @@ var Command = function(params,commander,callback) { ]; if(tiddler) { $tw.utils.each(tiddler.fields,function(field,name) { - var value = tiddler.getFieldString(name) + var value = tiddler.getFieldString(name); if(knownFields.indexOf(name) !== -1) { tiddlerFields[name] = value; } else { diff --git a/core/modules/filters/backlinks.js b/core/modules/filters/backlinks.js index 81f4ef925..eed7aa6bd 100644 --- a/core/modules/filters/backlinks.js +++ b/core/modules/filters/backlinks.js @@ -20,7 +20,7 @@ exports.backlinks = function(source,operator,options) { // Function to check an individual title function checkTiddler(title) { $tw.utils.pushTop(results,options.wiki.getTiddlerBacklinks(title)); - }; + } // Iterate through the source tiddlers if($tw.utils.isArray(source)) { $tw.utils.each(source,function(title) { diff --git a/core/modules/filters/field.js b/core/modules/filters/field.js index 4efea58fb..8fff9114b 100644 --- a/core/modules/filters/field.js +++ b/core/modules/filters/field.js @@ -29,7 +29,7 @@ exports.field = function(source,operator,options) { results.push(title); } } - }; + } // Iterate through the source tiddlers if($tw.utils.isArray(source)) { $tw.utils.each(source,function(title) { diff --git a/core/modules/filters/has.js b/core/modules/filters/has.js index aa14e3c3e..3e291c29b 100644 --- a/core/modules/filters/has.js +++ b/core/modules/filters/has.js @@ -29,7 +29,7 @@ exports.has = function(source,operator,options) { results.push(title); } } - }; + } // Iterate through the source tiddlers if($tw.utils.isArray(source)) { $tw.utils.each(source,function(title) { diff --git a/core/modules/filters/links.js b/core/modules/filters/links.js index 81ac7eea6..1ce3f1408 100644 --- a/core/modules/filters/links.js +++ b/core/modules/filters/links.js @@ -20,7 +20,7 @@ exports.links = function(source,operator,options) { // Function to check an individual title function checkTiddler(title) { $tw.utils.pushTop(results,options.wiki.getTiddlerLinks(title)); - }; + } // Iterate through the source tiddlers if($tw.utils.isArray(source)) { $tw.utils.each(source,function(title) { diff --git a/core/modules/filters/list.js b/core/modules/filters/list.js index 36c553bd8..a73019708 100644 --- a/core/modules/filters/list.js +++ b/core/modules/filters/list.js @@ -26,7 +26,7 @@ exports.list = function(source,operator,options) { if(match) { results.push(title); } - }; + } // Iterate through the source tiddlers if($tw.utils.isArray(source)) { $tw.utils.each(source,function(title) { diff --git a/core/modules/filters/prefix.js b/core/modules/filters/prefix.js index 9ef27bd4b..13c5055c6 100644 --- a/core/modules/filters/prefix.js +++ b/core/modules/filters/prefix.js @@ -26,7 +26,7 @@ exports.prefix = function(source,operator,options) { if(match) { results.push(title); } - }; + } // Iterate through the source tiddlers if($tw.utils.isArray(source)) { $tw.utils.each(source,function(title) { diff --git a/core/modules/filters/sameday.js b/core/modules/filters/sameday.js index 6fdb2d30c..a613a338c 100644 --- a/core/modules/filters/sameday.js +++ b/core/modules/filters/sameday.js @@ -29,7 +29,7 @@ exports.sameday = function(source,operator,options) { results.push(title); } } - }; + } // Iterate through the source tiddlers if($tw.utils.isArray(source)) { $tw.utils.each(source,function(title) { diff --git a/core/modules/filters/tag.js b/core/modules/filters/tag.js index 291052986..7c5fdb794 100644 --- a/core/modules/filters/tag.js +++ b/core/modules/filters/tag.js @@ -29,7 +29,7 @@ exports.tag = function(source,operator,options) { results.push(title); } } - }; + } // Iterate through the source tiddlers if($tw.utils.isArray(source)) { $tw.utils.each(source,function(title) { diff --git a/core/modules/filters/tagging.js b/core/modules/filters/tagging.js index c999c45fd..237b05eb7 100644 --- a/core/modules/filters/tagging.js +++ b/core/modules/filters/tagging.js @@ -20,7 +20,7 @@ exports.tagging = function(source,operator,options) { // Function to check an individual title function checkTiddler(title) { $tw.utils.pushTop(results,options.wiki.getTiddlersWithTag(title)); - }; + } // Iterate through the source tiddlers if($tw.utils.isArray(source)) { $tw.utils.each(source,function(title) { diff --git a/core/modules/filters/tags.js b/core/modules/filters/tags.js index 97e6f0d28..b2ac5bbad 100644 --- a/core/modules/filters/tags.js +++ b/core/modules/filters/tags.js @@ -23,7 +23,7 @@ exports.tags = function(source,operator,options) { if(tiddler && tiddler.fields.tags) { $tw.utils.pushTop(results,tiddler.fields.tags); } - }; + } // Iterate through the source tiddlers if($tw.utils.isArray(source)) { $tw.utils.each(source,function(title) { diff --git a/core/modules/filters/title.js b/core/modules/filters/title.js index 1df939083..234859992 100644 --- a/core/modules/filters/title.js +++ b/core/modules/filters/title.js @@ -29,7 +29,7 @@ exports.title = function(source,operator,options) { results.push(title); } } - }; + } // Iterate through the source tiddlers if($tw.utils.isArray(source)) { $tw.utils.each(source,function(title) { diff --git a/core/modules/parsers/wikiparser/rules/html.js b/core/modules/parsers/wikiparser/rules/html.js index de130ec1f..cd147124e 100644 --- a/core/modules/parsers/wikiparser/rules/html.js +++ b/core/modules/parsers/wikiparser/rules/html.js @@ -160,7 +160,7 @@ exports.parseMacroParameter = function(source,pos) { var node = { type: "macro-parameter", start: pos - } + }; // Define our regexp var reMacroParameter = /(?:([A-Za-z0-9\-_]+)\s*:)?(?:\s*(?:"([^"]*)"|'([^']*)'|\[\[([^\]]*)\]\]|([^\s>"'=]+)))/g; // Skip whitespace @@ -197,7 +197,7 @@ exports.parseMacroInvocation = function(source,pos) { type: "macrocall", start: pos, params: [] - } + }; // Define our regexps var reMacroName = /([^\s>"'=]+)/g; // Skip whitespace diff --git a/core/modules/parsers/wikiparser/rules/list.js b/core/modules/parsers/wikiparser/rules/list.js index d00f7ef9c..2b0a70300 100644 --- a/core/modules/parsers/wikiparser/rules/list.js +++ b/core/modules/parsers/wikiparser/rules/list.js @@ -122,7 +122,7 @@ exports.parse = function() { } // Consume any whitespace following the list item this.parser.skipWhitespace(); - }; + } // Return the root element of the list return [listStack[0]]; }; diff --git a/core/modules/rendertree/wikirendertree.js b/core/modules/rendertree/wikirendertree.js index fea421f3c..59e234843 100644 --- a/core/modules/rendertree/wikirendertree.js +++ b/core/modules/rendertree/wikirendertree.js @@ -130,14 +130,15 @@ WikiRenderTree.prototype.checkContextRecursion = function(renderer,newContext) { WikiRenderTree.prototype.getContextScopeId = function(renderer) { var guidBits = [], - scopeComponents = ["tiddlerTitle","templateTitle"]; - while(renderer) { - if(renderer.context) { - $tw.utils.each(renderer.context,function(field,name) { + scopeComponents = ["tiddlerTitle","templateTitle"], + processContext = function(field,name) { if(scopeComponents.indexOf(name) !== -1) { guidBits.push(name + ":" + field + ";"); } - }); + }; + while(renderer) { + if(renderer.context) { + $tw.utils.each(renderer.context,processContext); guidBits.push("-"); } renderer = renderer.parentRenderer;