Skip to content

Commit

Permalink
Workaround for IE11 issue
Browse files Browse the repository at this point in the history
  • Loading branch information
medikoo committed Oct 22, 2015
1 parent 46fac5d commit 54d1436
Showing 1 changed file with 8 additions and 1 deletion.
9 changes: 8 additions & 1 deletion polyfill.js
Original file line number Diff line number Diff line change
Expand Up @@ -12,13 +12,20 @@ if (typeof Symbol === 'function') NativeSymbol = Symbol;
var generateName = (function () {
var created = create(null);
return function (desc) {
var postfix = 0, name;
var postfix = 0, name, ie11BugWorkaround;
while (created[desc + (postfix || '')]) ++postfix;
desc += (postfix || '');
created[desc] = true;
name = '@@' + desc;
defineProperty(objPrototype, name, d.gs(null, function (value) {
// For IE11 issue see:
// https://connect.microsoft.com/IE/feedbackdetail/view/1928508/
// ie11-broken-getters-on-dom-objects
// https://github.com/medikoo/es6-symbol/issues/12
if (ie11BugWorkaround) return;
ie11BugWorkaround = true;
defineProperty(this, name, d(value));
ie11BugWorkaround = false;
}));
return name;
};
Expand Down

0 comments on commit 54d1436

Please sign in to comment.