-
-
Notifications
You must be signed in to change notification settings - Fork 26
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Stack Overflow on IE 11 #12
Comments
@luke-j thanks for reporting, it is a problem, still it's a definite IE bug. Can you provide a code snippet that exactly reproduces that issue (?) I use es6-symbol on IE11 and all works fine on my side |
Either of these two lines cause the overflow, which I'm doing to iterate of NodeLists: NodeList.prototype[Symbol.iterator] = Array.prototype[Symbol.iterator];
HTMLCollection.prototype[Symbol.iterator] = Array.prototype[Symbol.iterator]; |
As reported at #12 Send to Microsoft: https://connect.microsoft.com/IE/feedbackdetail/view/1928508/ie11-broken-getters-on-dom-objects
I reported the IE bug to Microsoft team: https://connect.microsoft.com/IE/feedbackdetail/view/1928508/ie11-broken-getters-on-dom-objects I've also implemented workaround for that: 54d1436 Published as v3.0.1 |
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 In the end, the only thing that worked was defining a dynamic getter via 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. |
@mislav am i right in thinking that this: NodeList.prototype[Symbol.iterator] = Array.prototype[Symbol.iterator];
HTMLCollection.prototype[Symbol.iterator] = Array.prototype[Symbol.iterator]; is the same as?: if (!NodeList.prototype[Symbol.iterator]) {
Object.defineProperty(NodeList.prototype, Symbol.iterator, {
enumerable: false,
configurable: true,
get: function() { return iterator }
})
}
if (!HTMLCollection.prototype[Symbol.iterator]) {
Object.defineProperty(HTMLCollection.prototype, Symbol.iterator, {
enumerable: false,
configurable: true,
get: function() { return iterator }
})
} Thanks |
@matt3224 Functionally, it's the same. Practically, the first approach doesn't work in IE11 because IE11 refuses the accept the simple assignment to |
Im finding the second also throws an error which is incredibly frustrating |
@matt3224 This is working pretty well for us here on GitHub.com https://gist.github.com/mislav/45781f27300c82bd7905815d232862fb |
This line causes a stack overflow in IE 11.
Adding try, catch stops the problem (and at least allows javascript to continue executing), but obviously prevents the symbol from being named/defined:
I also tried copying the
defineProperty()
function, to essentially double the available stack size, like so: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.
The text was updated successfully, but these errors were encountered: