-
Notifications
You must be signed in to change notification settings - Fork 388
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
Map/Set iterator #387
Comments
You'd need to do |
Ok, but I didn't think that node 0.10 and 0.8 had native Map/Set. |
They don't :-) that comes in 0.12. |
The code in question seems a very strange way to detect the presence of |
Thanks, I haven't tested it yet. The code I posted was just to demonstrate what I was seeing. The actual code is more like
It's fairly expensive, I know, but accuracy is more important than performance for me and I couldn't figure out a better cross environment/realm way of doing it? |
This seems like it would be sufficient:
|
Does not work cross frame.
|
@Xotic750 there's simply not enough machinery on non-globally-exposed items, like GeneratorFunction, or IteratorPrototype, etc, for you to determine them cross-realm. They don't have methods that pivot on internal slots nor is |
Is there a situation where |
Until the following issue is resolved: paulmillr/es6-shim#387
I am detecting
MapIterator
andSetIterator
for my inpect-x module. On native ES6Map
andSet
, the following code will alerttrue
andTypeError: Method Map Iterator.prototype.next called on incompatible receiver
.http://jsfiddle.net/Xotic750/xw2Lpbwz/
But on
es6-shim
iterators it alertstrue
andtrue
.(I think it is the shim and not the native versions, but I have not tested thoroughly yet)
Safari8, FF26, IE10, node0.10 and 0.8 are examples.
I just did a
toString
of thenext
function and it is the shim version.The text was updated successfully, but these errors were encountered: