Skip to content
This repository has been archived by the owner on Dec 14, 2021. It is now read-only.

Commit

Permalink
IE8: Don't infinite-loop in HasProperty check
Browse files Browse the repository at this point in the history
  • Loading branch information
inexorabletash committed Mar 2, 2018
1 parent 1b5c327 commit beafb24
Show file tree
Hide file tree
Showing 4 changed files with 10 additions and 6 deletions.
4 changes: 3 additions & 1 deletion es6.js
Original file line number Diff line number Diff line change
Expand Up @@ -502,7 +502,9 @@
while (o) {
if (Object.prototype.hasOwnProperty.call(o, p)) return true;
if (Type(o) !== 'object') return false;
o = Object.getPrototypeOf(o);
var op = Object.getPrototypeOf(o);
if (op === o) return false; // IE8 has self-referential prototypes
o = op;
}
return false;
}
Expand Down
4 changes: 3 additions & 1 deletion experimental/es-proposed.js
Original file line number Diff line number Diff line change
Expand Up @@ -119,7 +119,9 @@
while (o) {
if (Object.prototype.hasOwnProperty.call(o, p)) return true;
if (Type(o) !== 'object') return false;
o = Object.getPrototypeOf(o);
var op = Object.getPrototypeOf(o);
if (op === o) return false; // IE8 has self-referential prototypes
o = op;
}
return false;
}
Expand Down
6 changes: 3 additions & 3 deletions polyfill.js
Original file line number Diff line number Diff line change
Expand Up @@ -990,7 +990,9 @@ if (!Date.prototype.toISOString) {
while (o) {
if (Object.prototype.hasOwnProperty.call(o, p)) return true;
if (Type(o) !== 'object') return false;
o = Object.getPrototypeOf(o);
var op = Object.getPrototypeOf(o);
if (op === o) return false; // IE8 has self-referential prototypes
o = op;
}
return false;
}
Expand Down Expand Up @@ -1069,8 +1071,6 @@ if (!Date.prototype.toISOString) {

// 7.4.8 CreateListIterator (list)
// 7.4.8.1 ListIterator next( )
// 7.4.9 CreateCompoundIterator ( iterator1, iterator2 )
// 7.4.9.1 CompoundIterator next( )

//----------------------------------------
// 8 Executable Code and Execution Contexts
Expand Down
2 changes: 1 addition & 1 deletion polyfill.min.js

Large diffs are not rendered by default.

0 comments on commit beafb24

Please sign in to comment.