Comment #6 on issue 3241 by [email protected]: Object.prototype.toString.call(Promise.resolve()) should be "[object Promise]"
http://code.google.com/p/v8/issues/detail?id=3241

I dunno, I think to use IsPromise() has a couple of problems. 1) it is not behaviour defined in the spec, which might be a problem later on, and 2) IsPromise() is not necessarily registered as a native function, so it's not really ideal to depend on something which may or may not be there. (This is speaking of implementing this in v8natives.js, because I don't think this logic needs to live in native code).

As far as I can tell, the code I've suggested is more or less in line with the current harmony draft, at least WRT the toString algorithm. This could be improved in the backends by creating special optimized slots for well-known symbols (which is probably going to happen down the line anyways), but this probably works well enough as a short term solution.

I'm not set in my ways about that, so I'm happy to be convinced otherwise. Particularly, if there is some way that I'm not aware of to test whether an object is a promise or not, without depending on a native function which is only registered when some/all of the harmony flags are specified.

--
You received this message because this project is configured to send all issue notifications to this address.
You may adjust your notification preferences at:
https://code.google.com/hosting/settings

--
--
v8-dev mailing list
[email protected]
http://groups.google.com/group/v8-dev
--- You received this message because you are subscribed to the Google Groups "v8-dev" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to [email protected].
For more options, visit https://groups.google.com/d/optout.

Reply via email to