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

CoffeeScript lints cleanly again.

This commit is contained in:
Jeremy Ashkenas 2010-11-20 17:46:44 -05:00
parent 31f4214b5d
commit 83c41c69be
4 changed files with 10 additions and 6 deletions

View file

@ -4,7 +4,7 @@
function ctor() { this.constructor = child; }
ctor.prototype = parent.prototype;
child.prototype = new ctor;
for (var key in parent) if (__hasProp.call(parent, key)) child[key] = parent[key];
for (var key in parent) { if (__hasProp.call(parent, key)) child[key] = parent[key]; }
child.__super__ = parent.prototype;
return child;
}, __bind = function(fn, me){ return function(){ return fn.apply(me, arguments); }; };
@ -360,6 +360,7 @@
if (tag) {
this[tag] = true;
}
return this;
}
__extends(Value, Base);
Value.prototype.children = ['base', 'properties'];
@ -1476,6 +1477,7 @@
this.first = first;
this.second = second;
this.flip = !!flip;
return this;
}
__extends(Op, Base);
CONVERSIONS = {
@ -2060,7 +2062,7 @@
return ifn;
};
UTILITIES = {
"extends": 'function(child, parent) {\n function ctor() { this.constructor = child; }\n ctor.prototype = parent.prototype;\n child.prototype = new ctor;\n for (var key in parent) if (__hasProp.call(parent, key)) child[key] = parent[key];\n child.__super__ = parent.prototype;\n return child;\n}',
"extends": 'function(child, parent) {\n function ctor() { this.constructor = child; }\n ctor.prototype = parent.prototype;\n child.prototype = new ctor;\n for (var key in parent) { if (__hasProp.call(parent, key)) child[key] = parent[key]; }\n child.__super__ = parent.prototype;\n return child;\n}',
bind: 'function(fn, me){ return function(){ return fn.apply(me, arguments); }; }',
indexOf: 'Array.prototype.indexOf || function(item) {\n for (var i = 0, l = this.length; i < l; i++) {\n if (this[i] === item) return i;\n }\n return -1;\n}',
hasProp: 'Object.prototype.hasOwnProperty',

View file

@ -317,6 +317,7 @@ exports.Value = class Value extends Base
@base = base
@properties = props or []
@[tag] = true if tag
return this
children: ['base', 'properties']
@ -1173,6 +1174,7 @@ exports.Op = class Op extends Base
@first = first
@second = second
@flip = !!flip
return this
# The map of conversions from CoffeeScript to JavaScript symbols.
CONVERSIONS =
@ -1660,7 +1662,7 @@ UTILITIES =
function ctor() { this.constructor = child; }
ctor.prototype = parent.prototype;
child.prototype = new ctor;
for (var key in parent) if (__hasProp.call(parent, key)) child[key] = parent[key];
for (var key in parent) { if (__hasProp.call(parent, key)) child[key] = parent[key]; }
child.__super__ = parent.prototype;
return child;
}

View file

@ -15,8 +15,8 @@ ok odds.join(' ') is "one! three!"
# Basic range comprehensions.
nums = (i * 3 for i from 1 to 3)
negs = (x for x from -20 to -5*2)
nums = (i * 3 for i in [1..3])
negs = (x for x in [-20..-5*2])
eq nums.concat(negs.slice 0, 3).join(' '), '3 6 9 -20 -19 -18'

View file

@ -117,7 +117,7 @@ mult = (x, mids..., y) ->
ok mult(1, 2,) is 2
ok mult(1, 2, 3,) is 6
ok mult(10, (i for i from 1 to 6)...) is 7200
ok mult(10, (i for i in [1..6])...) is 7200
# Test for inline functions with parentheses and implicit calls.