1
0
Fork 0
mirror of https://github.com/jashkenas/coffeescript.git synced 2022-11-09 12:23:24 -05:00

getting the whole codebase passing jslint again.

This commit is contained in:
Jeremy Ashkenas 2010-07-28 20:38:16 -04:00
parent c67e7fbcea
commit 8522a11bcb
4 changed files with 5 additions and 5 deletions

View file

@ -360,7 +360,7 @@
}; };
Lexer.prototype.sanitizeHeredoc = function(doc, options) { Lexer.prototype.sanitizeHeredoc = function(doc, options) {
var _d, attempt, indent, match; var _d, attempt, indent, match;
while (match = HEREDOC_INDENT.exec(doc)) { while ((match = HEREDOC_INDENT.exec(doc))) {
attempt = (typeof (_d = match[2]) !== "undefined" && _d !== null) ? match[2] : match[3]; attempt = (typeof (_d = match[2]) !== "undefined" && _d !== null) ? match[2] : match[3];
if (!indent || attempt.length < indent.length) { if (!indent || attempt.length < indent.length) {
indent = attempt; indent = attempt;

View file

@ -628,7 +628,7 @@
if (this.fromNum && this.toNum && Math.abs(+this.fromNum - +this.toNum) <= 20) { if (this.fromNum && this.toNum && Math.abs(+this.fromNum - +this.toNum) <= 20) {
range = (function() { range = (function() {
_c = []; _c = [];
for (var _b = +this.fromNum; +this.fromNum <= +this.toNum ? _b <= +this.toNum : _b >= +this.toNum; +this.fromNum <= +this.toNum ? _b += 1 : _b -= 1){ _c.push(_b) }; for (var _b = +this.fromNum; +this.fromNum <= +this.toNum ? _b <= +this.toNum : _b >= +this.toNum; +this.fromNum <= +this.toNum ? _b += 1 : _b -= 1){ _c.push(_b); }
return _c; return _c;
}).call(this); }).call(this);
if (this.exclusive) { if (this.exclusive) {
@ -646,7 +646,7 @@
clause = ("" + this.fromVar + " <= " + this.toVar + " ?"); clause = ("" + this.fromVar + " <= " + this.toVar + " ?");
body = ("var " + i + " = " + this.fromVar + "; " + clause + " " + i + " <" + this.equals + " " + this.toVar + " : " + i + " >" + this.equals + " " + this.toVar + "; " + clause + " " + i + " += 1 : " + i + " -= 1"); body = ("var " + i + " = " + this.fromVar + "; " + clause + " " + i + " <" + this.equals + " " + this.toVar + " : " + i + " >" + this.equals + " " + this.toVar + "; " + clause + " " + i + " += 1 : " + i + " -= 1");
} }
post = ("{ " + (result) + ".push(" + i + ") };\n" + (idt) + "return " + result + ";\n" + o.indent); post = ("{ " + (result) + ".push(" + i + "); }\n" + (idt) + "return " + result + ";\n" + o.indent);
return "(function() {" + (pre) + "\n" + (idt) + "for (" + body + ")" + post + "}).call(this)"; return "(function() {" + (pre) + "\n" + (idt) + "for (" + body + ")" + post + "}).call(this)";
}; };
return RangeNode; return RangeNode;

View file

@ -304,7 +304,7 @@ exports.Lexer = class Lexer
# Sanitize a heredoc or herecomment by escaping internal double quotes and # Sanitize a heredoc or herecomment by escaping internal double quotes and
# erasing all external indentation on the left-hand side. # erasing all external indentation on the left-hand side.
sanitizeHeredoc: (doc, options) -> sanitizeHeredoc: (doc, options) ->
while match = HEREDOC_INDENT.exec doc while (match = HEREDOC_INDENT.exec(doc))
attempt = if match[2]? then match[2] else match[3] attempt = if match[2]? then match[2] else match[3]
indent = attempt if not indent or attempt.length < indent.length indent = attempt if not indent or attempt.length < indent.length
doc = doc.replace(new RegExp("^" +indent, 'gm'), '') doc = doc.replace(new RegExp("^" +indent, 'gm'), '')

View file

@ -577,7 +577,7 @@ exports.RangeNode = class RangeNode extends BaseNode
else else
clause = "#@fromVar <= #@toVar ?" clause = "#@fromVar <= #@toVar ?"
body = "var #i = #@fromVar; #clause #i <#@equals #@toVar : #i >#@equals #@toVar; #clause #i += 1 : #i -= 1" body = "var #i = #@fromVar; #clause #i <#@equals #@toVar : #i >#@equals #@toVar; #clause #i += 1 : #i -= 1"
post = "{ #{result}.push(#i) };\n#{idt}return #result;\n#o.indent" post = "{ #{result}.push(#i); }\n#{idt}return #result;\n#o.indent"
"(function() {#{pre}\n#{idt}for (#body)#post}).call(this)" "(function() {#{pre}\n#{idt}for (#body)#post}).call(this)"
#### SliceNode #### SliceNode