Skip to content

Commit

Permalink
Remove Object.prototype.mixin and Function.prototype.curry
Browse files Browse the repository at this point in the history
They are not used that much and I really want to keep
proto minimal.
  • Loading branch information
creationix committed Aug 13, 2010
1 parent 02a2f46 commit 48fb138
Showing 1 changed file with 0 additions and 28 deletions.
28 changes: 0 additions & 28 deletions lib/proto.js
Expand Up @@ -21,8 +21,6 @@ SOFTWARE.
*/

var proto = Object.prototype;
var func_proto = Function.prototype;
var arr_proto = Array.prototype;

// Implements a forEach much like the one for Array.prototype.forEach, but for
// any object.
Expand Down Expand Up @@ -51,29 +49,3 @@ if (typeof proto.map !== 'function') {
return accum;
}});
}

// Implements a shallow copy onto the current object.
if (typeof proto.mixin !== 'function') {
Object.defineProperty(proto, "mixin", {value: function (obj) {
var keys = Object.keys(obj);
var length = keys.length;
for (var i = 0; i < length; i++) {
var key = keys[i];
this[key] = obj[key];
}
return this;
}});
}

// Implements a function curry function. This allows you to call part of a
// function later.
if (typeof func_proto.curry !== 'function') {
Object.defineProperty(func_proto, "curry", {value: function () {
var fn = this;
var first = arr_proto.slice.call(arguments);
return function () {
return fn.apply(this, first.concat(arr_proto.slice.call(arguments)));
};
}});
}

0 comments on commit 48fb138

Please sign in to comment.