Debian Codegraph @

js/src/jit-test/tests/promise/promise-cross-compartment-subclassing.js

raw
1 ignoreUnhandledRejections();
2
3 const global = newGlobal();
4 const OtherPromise = global.Promise;
5 class SubPromise extends OtherPromise {}
6
7 assertEq(true, new SubPromise(()=>{}) instanceof OtherPromise);
8 assertEq(true, SubPromise.resolve({}) instanceof OtherPromise);
9 assertEq(true, SubPromise.reject({}) instanceof OtherPromise);
10 assertEq(true, SubPromise.resolve({}).then(()=>{}, ()=>{}) instanceof OtherPromise);