question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

Stack Overflow on IE 11

See original GitHub issue

This line causes a stack overflow in IE 11.

defineProperty(objPrototype, name, d.gs(null, function (value) {
    defineProperty(this, name, d(value));
}));

Adding try, catch stops the problem (and at least allows javascript to continue executing), but obviously prevents the symbol from being named/defined:

defineProperty(objPrototype, name, d.gs(null, function (value) {
    try {
        defineProperty(this, name, d(value));
    } catch (e) {}
}));

I also tried copying the defineProperty() function, to essentially double the available stack size, like so:

  , defineProperty = Object.defineProperty, objPrototype = Object.prototype
  , definePropertyClone = defineProperty

//snip...

defineProperty(objPrototype, name, d.gs(null, function (value) {
    try {
        defineProperty(this, name, d(value));
    } catch (e) {
        definePropertyClone(this, name d(value));
    }

This just crashed IE.

I don’t normally develop for IE, so I understand if this problem isn’t important. I just thought I’d hear your thoughts.

Issue Analytics

  • State:closed
  • Created 8 years ago
  • Comments:8 (2 by maintainers)

github_iconTop GitHub Comments

1reaction
mislavcommented, May 3, 2017

I’ve tried the exact same thing as @luke-j:

NodeList.prototype[Symbol.iterator] = Array.prototype[Symbol.iterator];
HTMLCollection.prototype[Symbol.iterator] = Array.prototype[Symbol.iterator];

However, IE11 refused to modify NodeList.prototype and HTMLCollection.prototype this way. After the assignment, NodeList.prototype[Symbol.iterator] would still be undefined.

In the end, the only thing that worked was defining a dynamic getter via defineProperty:

if (!NodeList.prototype[Symbol.iterator]) {
  Object.defineProperty(NodeList.prototype, Symbol.iterator, {
    enumerable: false,
    configurable: true,
    get: function() { return iterator }
  })
}

Just sharing for others that might potentially stumble upon this conversation, trying to make DOM interfaces in IE11 iterable after importing this polyfill.

0reactions
mislavcommented, Aug 31, 2017

@matt3224 This is working pretty well for us here on GitHub.com https://gist.github.com/mislav/45781f27300c82bd7905815d232862fb

Read more comments on GitHub >

github_iconTop Results From Across the Web

Newest 'internet-explorer' Questions - Stack Overflow
I want to Open browser in Edge with IE mode. My environment: IE7, windows 11, Python 3.10.4, Edge version 108.0.1462.46 And I follow...
Read more >
Stack overflow error whenever I open Internet Explorer
I understand that you receive Stack Overflow error whenever you open Internet Explorer. I would definitely help you in fixing this issue.
Read more >
Stack overflow error in IE11 with Angular 6 web application #315
In this setup we're facing an stack overflow error which only occurs in IE11. ... The klaro.js file is copied from the node_modules...
Read more >
[SOLVED] Stack overflow error on Line:1 in Internet Explorer ...
I am using Joomla 1.5 and have a custom template. 1. When I view the forum on Internet Explorer I get a "Stack...
Read more >
Internet Explorer moves web development support to Stack ...
A post on the Internet Explorer blog makes it official: IE is moving their web development support from MSDN Communities to the independent...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found