Comparing version 1.0.0-beta-08 to 1.0.0-beta-09
@@ -14,3 +14,3 @@ // Generated by CoffeeScript 1.9.2 | ||
}; | ||
bx = method.map != null ? method.map(ax) : ax; | ||
bx = method.map != null ? method.map.apply(method, ax) : ax; | ||
ref = method.entries; | ||
@@ -31,3 +31,3 @@ for (i = 0, len = ref.length; i < len; i++) { | ||
p += 2; | ||
} else if (term.constructor === Function && (term(arg)) === true) { | ||
} else if (term.constructor === Function && term !== Boolean && (term(arg)) === true) { | ||
p += 5; | ||
@@ -39,3 +39,3 @@ } else { | ||
} | ||
if (p >= best.p) { | ||
if (p > 0 && p >= best.p) { | ||
best = { | ||
@@ -163,13 +163,8 @@ p: p, | ||
}); | ||
return context.test("Variadic arguments", function() { | ||
context.test("Variadic arguments", function() { | ||
var bar; | ||
bar = Method.create(function() { | ||
var first, rest; | ||
first = arguments[0], rest = 2 <= arguments.length ? slice.call(arguments, 1) : []; | ||
return [first, rest]; | ||
bar = Method.create(function(x) { | ||
return [x]; | ||
}); | ||
Method.define(bar, String, Array, function(x, a) { | ||
return x; | ||
}); | ||
Method.define(bar, Number, Array, function() { | ||
Method.define(bar, String, function() { | ||
var a, x; | ||
@@ -179,6 +174,27 @@ x = arguments[0], a = 2 <= arguments.length ? slice.call(arguments, 1) : []; | ||
}); | ||
return assert((bar(1, 2, 3)) === 2); | ||
Method.define(bar, Number, function() { | ||
var a, x; | ||
x = arguments[0], a = 2 <= arguments.length ? slice.call(arguments, 1) : []; | ||
return x; | ||
}); | ||
return assert((bar("foo", 1, 2, 3)) === 1); | ||
}); | ||
return context.test("Predicate functions", function() { | ||
var baz; | ||
baz = Method.create(); | ||
Method.define(baz, Boolean, function() { | ||
return false; | ||
}); | ||
Method.define(baz, (function(x) { | ||
return x === 7; | ||
}), function(x) { | ||
return true; | ||
}); | ||
assert(baz(7)); | ||
return assert.throws(function() { | ||
return baz(6); | ||
}); | ||
}); | ||
}); | ||
}).call(this); |
{ | ||
"name": "fairmont", | ||
"version": "1.0.0-beta-08", | ||
"version": "1.0.0-beta-09", | ||
"description": "A collection of useful functions and utilities.", | ||
@@ -5,0 +5,0 @@ "files": [ |
Sorry, the diff of this file is not supported yet
124317
2304