Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with
or
.
Download ZIP
Browse files

Skip constructor properties.

  • Loading branch information...
commit 93dd364b9555de54d205117d3898b8aa22fa4b36 1 parent 0ed1660
@ljharb ljharb authored
Showing with 4 additions and 2 deletions.
  1. +4 −2 es5-shim.js
View
6 es5-shim.js
@@ -688,9 +688,11 @@ if (!Object.keys) {
}
if (hasDontEnumBug) {
- for (var i = 0, ii = dontEnumsLength; i < ii; i++) {
+ var ctor = object.constructor,
+ skipConstructor = ctor && ctor.prototype === object;
+ for (var i = 0; i < dontEnumsLength; i++) {
var dontEnum = dontEnums[i];
- if (owns(object, dontEnum)) {
+ if (!(skipConstructor && dontEnum === 'constructor') && owns(object, dontEnum)) {
keys.push(dontEnum);
}
}
Please sign in to comment.
Something went wrong with that request. Please try again.