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
How does Symbol.hasInstance + instanceof work (or does it even work?) in IE11 and below? #6210
Comments
Hey @trusktr! We really appreciate you taking the time to report an issue. The collaborators If you need any help, or just have general Babel or JavaScript questions, we have a vibrant Slack |
Does |
@jridgewell |
This is handled by the |
Hi, Can I take this up please? |
This is an interesting one. I wonder if it was left out on purpose? I could see this being a performance issue, but I honestly don't know. Seems like we'd need to dig into the git history? |
@loganfsmyth I did a search on git log and found following commit: commit a9ac3b0
direct link to issue #2745 |
Likely just an oversight then, I don't see it being any more of a penalty than |
So this is basically re-add the functionality to preset-env preset-es2015 as mentioned in #6210 (comment) |
Yup. |
Cool, so can I please take this up ? |
@ajaymathur Yes 👍 |
I'm looking at this output in the repl.
From what I can tell, it requires a
Symbol.hasInstance
polyfill.However, the
instanceof
check isn't being transpiled into anything.So, in an older browser like IE 10, how can this possibly work if the native
instanceof
operator will not know to look forSymbol.hasInstance
on a constructor?In otherwords, doesn't
need to be transpiled to something like
where
__instanceOf
is a helper that can useSymbol.hasInstance
(polyfilled or not)?The text was updated successfully, but these errors were encountered: