Skip to content

Commit

Permalink
Browse files Browse the repository at this point in the history
Fix a typo in the proto from when I removed a bunch of code. Thanks i…
…saacs
  • Loading branch information
creationix committed Apr 7, 2010
1 parent 2e819ff commit afd66a2
Showing 1 changed file with 4 additions and 3 deletions.
7 changes: 4 additions & 3 deletions lib/proto.js
Expand Up @@ -22,14 +22,15 @@ 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.
if (typeof proto.forEach !== 'function') {
Object.defineProperty(proto, "forEach", {value: function (callback, thisObject) {
var keys = Object.keys(this);
var length = keys.length;
for (var i = 0; i < length; i++){
for (var i = 0; i < length; i++) {
var key = keys[i];
callback.call(thisObject, this[key], key, this);
}
Expand All @@ -43,7 +44,7 @@ if (typeof proto.map !== 'function') {
var accum = [];
var keys = Object.keys(this);
var length = keys.length;
for (var i = 0; i < length; i++){
for (var i = 0; i < length; i++) {
var key = keys[i];
accum[i] = callback.call(thisObject, this[key], key, this);
}
Expand All @@ -56,7 +57,7 @@ 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++){
for (var i = 0; i < length; i++) {
var key = keys[i];
this[key] = obj[key];
}
Expand Down

0 comments on commit afd66a2

Please sign in to comment.