Comment #5 on issue 547 by ernst.matthias: FunctionTemplate::SetClassName  
and JSON serialization
http://code.google.com/p/v8/issues/detail?id=547

I have a shared C++ array backing the JS object and I want changes  
reflected in both directions, so I don't
want to copy it. The object is supposed to behave as close to an array as  
possible.

V8's checks for the "arrayness" of an object seem stricter than the spec  
suggests:

For example; the ECMA 262 V5 JSON specification checks the  
internal '[[class]]' property of an object to check
whether it should be marshalled as an array. This property is also used to  
compute "toString". In V8, my object
prints as [object Array] but does not marshal as one. Surely you can argue  
that "setClassName" and "[[class]]"
are not the same.

Different example: In ECMA 262 V5, Function.prototype.apply uses  
only "length" and indexed access on the
argArray argument. V8 is stricter and only accepts objects that were  
created through the Array constructor.
This case can be written down as a pure JS testcase: f.apply(this,  
{length:1, "0":"first"})

I can work around this, just wanted to point it out.


--
You received this message because you are listed in the owner
or CC fields of this issue, or because you starred this issue.
You may adjust your issue notification preferences at:
http://code.google.com/hosting/settings

-- 
v8-dev mailing list
[email protected]
http://groups.google.com/group/v8-dev

Reply via email to