Permalink
Browse files

Name the map and forEach functions.

  • Loading branch information...
1 parent 48fb138 commit 586e0d1fe1f2c2303f942a4fc2eb27b1c8aff1b8 @creationix committed Aug 13, 2010
Showing with 2 additions and 2 deletions.
  1. +2 −2 lib/proto.js
View
@@ -25,7 +25,7 @@ var proto = Object.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) {
+ Object.defineProperty(proto, "forEach", {value: function forEach(callback, thisObject) {
var keys = Object.keys(this);
var length = keys.length;
for (var i = 0; i < length; i++) {
@@ -38,7 +38,7 @@ if (typeof proto.forEach !== 'function') {
// Implements a map much like the one for Array.prototype.map, but for any
// object. Returns an array, not a generic object.
if (typeof proto.map !== 'function') {
- Object.defineProperty(proto, "map", {value: function (callback, thisObject) {
+ Object.defineProperty(proto, "map", {value: function map(callback, thisObject) {
var accum = [];
var keys = Object.keys(this);
var length = keys.length;

0 comments on commit 586e0d1

Please sign in to comment.