-
-
Notifications
You must be signed in to change notification settings - Fork 1.7k
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
IE11 - Out of Stack Space - Setting Symbol property on global prototype objects #735
Comments
More about the issue: Apparently in IE11, if you define a property with a setter on a parent, that parent's setter is called when defineProperty(,,{value: ...}) is called on an object that inherits from that parent. No other modern browsers seem to do this:
So the issue with the Symbol polyfill is that this setter is added to Object.prototype:
Since |
Furthermore ie11 has a problem in that it essentially ignores a defineProperty(,,value: ) call on a child if the parent has a setter already defined on the parent:
However, if you define a setter on the child, it will overwrite the parent and not call the parent either:
So one potential fix is to change the
Of course there my be other implications of this to which I'm not aware, but I'll put in a pull request for this. |
It's a known and documented issue. We can't add workarounds for all possible exotic environment objects. Usage setters and getters here will break too many use cases. |
BTW why you need 3 copies of
|
Versions: v3.3.6 through latest(v3.6.0)
(Issue likely occurs before v3.3.6, but that's the earliest core-js I tested.)
Code to reproduce (transpiled using babel 7.6.0 with webpack 4.41.0):
All browsers with a native Symbol implementation (Edge, Firefox, Chrome, Safari, etc.) support setting a symbol on Node, Window, Element, etc. So this is limited to the polyfill.
Error seems to be caused by infinite recursion in core-js of:
The
setSymbolDescriptor
resolves to:function defineProperty() { [native code] }
, so it's not being overridden by anything else. It's the native method. CallingsetSymbolDescriptor
is callingsetter
again, causing the infinite recursion and filling the stack.Webpack config for babel:
.browserlistrc:
package.json
If you need any further info, I stand ready to provide.
The text was updated successfully, but these errors were encountered: