On 2014/08/20 22:33:25, Dmitry Lomov (chromium) wrote:
On 2014/08/20 22:16:36, arv wrote:
> Is this correctly handling getters?
>
> function Base() {}
> Derived.prototype = {
>   constructor: Base,
>   get x() {
>     return this._x;
>   },
>   _x: 'base'
> };
>
> function Derived() {}
> Derived.__proto__ = Base;
> Derived.prototype = {
>   __proto__: Base.prototype,
>   constructor: Derived,
>   testGetter: function() {
>     return super.x;
>   }.toMethod(Derived.prototype),
>   _x: 'derived'
> };
>
> assertEquals('derived', new Derived().testGetter());

No, you are right.

Oh my, looks like to really optimize this. we would need new ICs (smth like
LoadSuperIC, with 3 arguments: lookup start, object and name; same for
StoreSuperIC; repeat 2x Keyed). Also of course in super.x() x might be a getter
as well, oh my. Let me know if you see a simpler solution.

As a first approximation, I can just generate runtime calls.

https://codereview.chromium.org/495773002/

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