ctx-ctor.js (526B)
1 // Copyright (C) 2023 Peter Klecha. All rights reserved. 2 // This code is governed by the BSD license found in the LICENSE file. 3 4 /*--- 5 description: Promise.withResolvers produces instances of the receiver 6 esid: sec-promise.withresolvers 7 features: [promise-with-resolvers, class] 8 ---*/ 9 10 class SubPromise extends Promise {} 11 12 var instance = Promise.withResolvers.call(SubPromise); 13 14 assert.sameValue(instance.promise.constructor, SubPromise); 15 assert.sameValue(instance.promise instanceof SubPromise, true); 16 17 18 reportCompare(0, 0);