Skip to content

Commit

Permalink
Trying to return Object.prototype in IE when none is found
Browse files Browse the repository at this point in the history
  • Loading branch information
ljharb committed Jan 14, 2014
1 parent 35d22cf commit 233aca3
Showing 1 changed file with 4 additions and 3 deletions.
7 changes: 4 additions & 3 deletions index.js
Original file line number Diff line number Diff line change
@@ -1,7 +1,8 @@
"use strict";

var toString = Object.prototype.toString;
var has = Object.prototype.hasOwnProperty;
var ObjectPrototype = Object.prototype;
var toString = ObjectPrototype.toString;
var has = ObjectPrototype.hasOwnProperty;

var getPrototypeOf = Object.getPrototypeOf;
if (!getPrototypeOf) {
Expand All @@ -21,7 +22,7 @@ if (!getPrototypeOf) {
constructor = obj.constructor; // get real constructor
obj.constructor = oldConstructor; // restore constructor
}
return constructor ? constructor.prototype : null; // needed for IE
return constructor ? constructor.prototype : ObjectPrototype; // needed for IE
};
}
}
Expand Down

0 comments on commit 233aca3

Please sign in to comment.