On Mon, Jul 29, 2013 at 9:41 AM, Sven Panne <[email protected]> wrote:
> Hmmm, this doesn't look right. There seems to be some API nonsense/bug,
> investigating...
>
Actually things are correct, but very perplexing. Consider the following
session in d8:
-----------------------------------------------------
d8> var primitive = Boolean(false)
undefined
d8> primitive
false
d8> if (primitive) print("I am true")
undefined
d8> var wrapped = new Boolean(false)
undefined
d8> if (wrapped) print("I am true")
I am true
undefined
-----------------------------------------------------
This is confusing, but this is how JavaScript is defined. To make things
even more confusing, we have *2* BooleanValue() functions in v8.h, one in
Value and the other one in BooleanObject (which is a subclass of Value via
Object, making things even worse). We can't do anything about the
JavaScript semantics, but we should perhaps rename a few API entries. I've
added a few unit tests to make things a bit more explicit:
https://codereview.chromium.org/21013003/
--
--
v8-users mailing list
[email protected]
http://groups.google.com/group/v8-users
---
You received this message because you are subscribed to the Google Groups
"v8-users" 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/groups/opt_out.