-
-
Notifications
You must be signed in to change notification settings - Fork 22
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
Compatibility with core-js
symbol sham: Symbol() instanceof Symbol
#17
Comments
core-js
core-js
symbol sham: Symbol() instanceof Symbol
fwiw, I just had a module break because the core-js I will remove this particular line, and I'll add a comment pointing here. I still think that both of these tests should pass in I'll update this after I finish adding a test (just like i have for |
are we talking about these two lines? if (typeof sym === 'string') { return false; }
if (sym instanceof Symbol) { return false; }
Actually ... my poly passes these two lines so what are we talking about? What shoudl I fix and how your defineProperty operation was affected? Please let me know, willing to find a solution if possible |
What do you mean here?
Partly agree - possible slowdown and memory leaking with wrong usage. It should be used cautiously. Mainly it's added as the namespace for well-known symbols. |
agreed ... so, what exactly should (we?) I do in my sham? I don't see anything different in this thread from what I've done/know already. AFAIK my sham passes already those two checks and my opinion about wrapping/swapping native constructors didn't change: it won't land in any of my code. I am curious to know in which case Regards |
ljharb/global-cache@ba20781 is the fix I had to make using @WebReflection The |
I'm not wrapping globals and I don't want my code to be order dependent with other shims or shams. Moreover, I've already tested the swapped global approach and it fails for my targets that AFAIK are many more and older than what core.js supports. |
Not exactly. If you interested, I can show problem cases. |
@WebReflection your sham is already dependent on ordering, because other shims/shams could set up or modify the methods you use. It's obv fine if you don't want to support it in your module. @zloirock of course, I'd love it if you could file issues on |
I am not replacing functionality so my module is already non order dependent. I am setting stuff configurable like native, my poly is transparent for any other and I would never include in any project of mine a polifyll that simply remove native behaviors instead of enriching them. In this sense, changing globals is not something I am doing, you are using native globals, not user defined one, and the method I am "overriding" are based on global behaviors too. So this is less obtrusive, replacing |
@ljharb ok, main problems with |
@WebReflection you have no guarantee that the @zloirock Thanks! |
Yes, I do always know what I include in my projects. The disaster is about devices failing in any possible way, devices I believe you cannot tests, devices that are targets of my sham ... I haven't said that just for fun, I've wasted time trying before, like months ago, and I am not willing to fix this but I don't mind if you'll drop support. This is the list: https://github.com/WebReflection/get-own-property-symbols#compatibility |
FWIW what I've done in order to not compromise native functionality but being easily able to distinguish between strings, objects, and Symbols, version Since |
IIRC it's in |
yeah, I need to better implement that part too but I don't see here any check against this behavior which is actually the best to recognize symbols in polyfilled/shammed engines. I might have a look at what you've done in toStringTag and borrow it :P |
Not fixed already near half year :)
The text was updated successfully, but these errors were encountered: