On 13 December 2013 06:58, Ting-Yu Chou <[email protected]> wrote:
> Hello,
>
> I am not so sure why it needs to always search the setter in prototypes when
> setting a property, even there's a transition map:
>
>   Handle<Object> JSObject::SetPropertyForResult(Handle<JSObject> object,
>     ...
>     if (!lookup->IsProperty() && !object->IsJSContextExtensionObject()) {
>       bool done = false;
>       Handle<Object> result_object = SetPropertyViaPrototypes(
>           object, name, value, attributes, strict_mode, &done);
>       if (done) return result_object;
>     }

A transition is an absent property -- all it tells is where to find a
new map if this property ever gets added. So of course search has to
continue up the prototype chain first to look for setters.

> Is it possible that both a map and a setter in ancestor existed?

Yes, why shouldn't it? There are various ways to achieve this in JavaScript.

/Andreas

-- 
-- 
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.

Reply via email to