blob: dba1a549675fc888b0542997e9db90ee9198b51d [file] [log] [blame]
function shouldBe(actual, expected) {
if (actual !== expected)
throw new Error('bad value: ' + actual);
}
for (var i = 0; i < 1e5; ++i) {
var promise = new Promise(function() { });
shouldBe(promise.__proto__, Promise.prototype);
}
class DerivedPromise extends Promise {
};
for (var i = 0; i < 1e5; ++i) {
var promise = new DerivedPromise(function() { });
shouldBe(promise.__proto__, DerivedPromise.prototype);
}
for (var i = 0; i < 1e5; ++i) {
var promise = new Promise(function() { });
shouldBe(promise.__proto__, Promise.prototype);
}
for (var i = 0; i < 1e5; ++i) {
var promise = new DerivedPromise(function() { });
shouldBe(promise.__proto__, DerivedPromise.prototype);
}