babel/test/fixtures/traceur/Classes/InheritanceFromMemberExpression.js
2015-01-04 19:40:09 +11:00

32 lines
675 B
JavaScript

var baseContainer = {
base: function() {
this.yyy = 'base constructor';
}
};
baseContainer.base.prototype = {
x: 'proto x',
constructor: function() {
this.y = 'base y';
}
}
class MemberExprBase extends baseContainer.base {
constructor(w) {
super();
this.z = 'var z';
this.w = w;
}
}
// ----------------------------------------------------------------------------
var a = new MemberExprBase('w value');
var pa = Object.getPrototypeOf(a);
var ppa = Object.getPrototypeOf(pa);
assertHasOwnProperty(a, 'yyy', 'w', 'z');
assertLacksOwnProperty(a, 'x');
assertHasOwnProperty(pa, 'constructor');
assertHasOwnProperty(ppa, 'x', 'constructor');