Permalink
Browse files

Merge pull request #146

Requires verification on Internet Explorer.

Conflicts:
	es5-shim.min.js
	package.json
  • Loading branch information...
kriskowal committed Mar 22, 2013
2 parents c9091f9 + f5b6181 commit 507c6b8c5262169b87ab1713db8faca9819684b7
Showing with 26 additions and 8 deletions.
  1. +19 −1 es5-sham.js
  2. +7 −7 es5-sham.min.js
View
@@ -15,6 +15,24 @@
}
})(function () {
+
+var call = Function.prototype.call;
+var prototypeOfObject = Object.prototype;
+var owns = call.bind(prototypeOfObject.hasOwnProperty);
+
+// If JS engine supports accessors creating shortcuts.
+var defineGetter;
+var defineSetter;
+var lookupGetter;
+var lookupSetter;
+var supportsAccessors;
+if ((supportsAccessors = owns(prototypeOfObject, "__defineGetter__"))) {
+ defineGetter = call.bind(prototypeOfObject.__defineGetter__);
+ defineSetter = call.bind(prototypeOfObject.__defineSetter__);
+ lookupGetter = call.bind(prototypeOfObject.__lookupGetter__);
+ lookupSetter = call.bind(prototypeOfObject.__lookupSetter__);
+}
+
// ES5 15.2.3.2
// http://es5.github.com/#x15.2.3.2
if (!Object.getPrototypeOf) {
@@ -289,7 +307,7 @@ if (!Object.defineProperties || definePropertiesFallback) {
// try the shim if the real one doesn't work
}
}
-
+
for (var property in properties) {
if (owns(properties, property) && property != "__proto__") {
Object.defineProperty(object, property, properties[property]);
View

Some generated files are not rendered by default. Learn more.

Oops, something went wrong.

0 comments on commit 507c6b8

Please sign in to comment.