// |reftest| shell-option(--enable-promise-try) skip-if(!Promise.try||!xulRuntime.shell) async -- promise-try is not enabled unconditionally, requires shell-options // Copyright (C) 2024 Jordan Harband. All rights reserved. // This code is governed by the BSD license found in the LICENSE file.
/*--- description: Promise.try returns a Promise that rejects when the function throws esid: sec-promise.try features: [promise-try] flags: [async] includes: [asyncHelpers.js]
---*/
asyncTest(function () { returnassert.throwsAsync(
Test262Error, function () { return Promise.try(function () { thrownew Test262Error(); })
}, "error thrown from callback must become a rejection"
);
});
Messung V0.5
¤ Dauer der Verarbeitung: 0.1 Sekunden
(vorverarbeitet)
¤
Die Informationen auf dieser Webseite wurden
nach bestem Wissen sorgfältig zusammengestellt. Es wird jedoch weder Vollständigkeit, noch Richtigkeit,
noch Qualität der bereit gestellten Informationen zugesichert.
Bemerkung:
Die farbliche Syntaxdarstellung und die Messung sind noch experimentell.