From 48fb1389bbd32c87b08c5023b30b22c5db8b3753 Mon Sep 17 00:00:00 2001 From: Tim Caswell Date: Fri, 13 Aug 2010 14:37:29 -0700 Subject: [PATCH] Remove Object.prototype.mixin and Function.prototype.curry They are not used that much and I really want to keep proto minimal. --- lib/proto.js | 28 ---------------------------- 1 file changed, 28 deletions(-) diff --git a/lib/proto.js b/lib/proto.js index 4b38cb5..bebdc4c 100644 --- a/lib/proto.js +++ b/lib/proto.js @@ -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. @@ -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))); - }; - }}); -} -