Debian Codegraph @

js/src/tests/test262/built-ins/Promise/try/ctx-ctor-throws.js

raw
1 // |reftest| shell-option(--enable-promise-try) skip-if(!Promise.try||!xulRuntime.shell) -- promise-try is not enabled unconditionally, requires shell-options
2 // Copyright (C) 2024 Jordan Harband. All rights reserved.
3 // This code is governed by the BSD license found in the LICENSE file.
4
5 /*---
6 description: >
7 `Promise.try` invoked on a constructor value that throws an error
8 features: [promise-try]
9 ---*/
10
11 var CustomPromise = function () {
12 throw new Test262Error();
13 };
14
15 assert.throws(Test262Error, function () {
16 Promise.try.call(CustomPromise, function () {});
17 });
18
19 reportCompare(0, 0);