Skip to content

Commit

Permalink
Fixing variable name collisions
Browse files Browse the repository at this point in the history
  • Loading branch information
ljharb committed Mar 31, 2014
1 parent 58b97af commit a7fe7ad
Showing 1 changed file with 8 additions and 8 deletions.
16 changes: 8 additions & 8 deletions es5-shim.js
Original file line number Diff line number Diff line change
Expand Up @@ -680,29 +680,29 @@ if (!Object.keys) {
},
isArguments = function isArguments(value) {
var str = _toString(value);
var isArguments = str === '[object Arguments]';
if (!isArguments) {
isArguments = !Array.isArray(str)
var isArgs = str === '[object Arguments]';
if (!isArgs) {
isArgs = !Array.isArray(str)
&& value !== null
&& typeof value === 'object'
&& typeof value.length === 'number'
&& value.length >= 0
&& isFunction(value.callee);
}
return isArguments;
return isArgs;
};

Object.keys = function keys(object) {
var isFunction = isFunction(object),
isArguments = isArguments(object),
var isFn = isFunction(object),
isArgs = isArguments(object),
isObject = object !== null && typeof object === 'object';

if (!isObject && !isFunction) {
if (!isObject && !isFn) {
throw new TypeError("Object.keys called on a non-object");
}

var keys = [],
skipProto = hasProtoEnumBug && isFunction;
skipProto = hasProtoEnumBug && isFn;
for (var name in object) {
if (!(skipProto && name === 'prototype') && owns(object, name)) {
keys.push(name);
Expand Down

0 comments on commit a7fe7ad

Please sign in to comment.