-
-
Notifications
You must be signed in to change notification settings - Fork 5.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
Work with symbol polyfill #16743
base: main
Are you sure you want to change the base?
Work with symbol polyfill #16743
Conversation
Build successful! You can test your changes in the REPL here: https://babeljs.io/repl/build/57690 |
I'm confused by why this is needed.
|
Thanks for your reply. // packages/babel-helpers/src/helpers/toPrimitive.ts
import typeOf from "./typeof.ts";
...
if (typeOf(res) !== "object") return res;
... or do you have any other suggestions? |
But it is, both in |
Interestingly, I saw another scene in So, is it an issue with the |
Please confirm whether need to use |
I investigated this a bit. The reason seems (seems because I cannot find Mobx's Babel config) that Mobx is not transpiled to support IE11, and thus the injected There are two solutions:
|
Make the
toPrimitive
work with Symbol polyfill.For example, there is a symbol
x
, normallytypeof x === "symbol"
is true. Buttypeof x === "object"
is true when theSymbol
is polyfilled.Related links: