summaryrefslogtreecommitdiffstats
path: root/js/src/jit-test/tests/promise/promise-cross-compartment-subclassing.js
blob: dc77b39566d5cbe12bd6929ce6f759fcc45c082e (plain)
1
2
3
4
5
6
7
8
const global = newGlobal();
const OtherPromise = global.Promise;
class SubPromise extends OtherPromise {}

assertEq(true, new SubPromise(()=>{}) instanceof OtherPromise);
assertEq(true, SubPromise.resolve({}) instanceof OtherPromise);
assertEq(true, SubPromise.reject({}) instanceof OtherPromise);
assertEq(true, SubPromise.resolve({}).then(()=>{}, ()=>{}) instanceof OtherPromise);