blob: 8edc527127641363775815f1e74bdf6e98616559 [file] [log] [blame]
function C() {
this.foo = 'bar';
}
C.prototype.bar = function() {
return 41;
};
function D() {
C.call(this);
this.baz = 'bat';
}
D.prototype = Object.create(C.prototype);
D.prototype.bar = function() {
return C.prototype.bar.call(this) + 1;
};
function fn() {
var d = new D();
return d.bar();
}
assertEqual(fn(), 42);
test(fn);