inexorabletash / polyfill

JavaScript Polyfills, Shims and More
Other
1.36k stars 354 forks source link

Exception thrown and not caught when loading es6 in IE9 #137

Closed cyberwombat closed 7 years ago

cyberwombat commented 7 years ago

Using this in head:

<script src="https://cdn.rawgit.com/inexorabletash/polyfill/9119cb08/es5.js"></script>
<script src="https://cdn.rawgit.com/inexorabletash/polyfill/9119cb08/es6.js"></script>

In IE9 (9.0.8112) in Win7 dumps this error to console on load.

SCRIPT5022: Exception thrown and not caught 
es6.js, line 285 character 9
inexorabletash commented 7 years ago

Can you provide a stack trace? That's the polyfill for Symbol.prototype.valueOf() throwing.

It's unclear what would be triggering that, and I don't have IE9 handy.

cyberwombat commented 7 years ago

Hmm IE9 doesn't have proper stack trace. Under its Call Stack panel it mentions this line right before the valueOf one:

console.assert(typeof global.Symbol() === 'symbol' || symbolForKey(String(global.Symbol('x')))); // Line 302

Not sure if I am reading it correctly and if it's the one triggering the error

inexorabletash commented 7 years ago

Finally had a chance to try this out; I pushed a fix. Can you give it a try?