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());

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