test262/test/built-ins/Promise/try/ctx-ctor-throws.js
2024-05-01 15:27:31 -07:00

17 lines
416 B
JavaScript

// Copyright (C) 2024 Jordan Harband. All rights reserved.
// This code is governed by the BSD license found in the LICENSE file.
/*---
description: >
`Promise.try` invoked on a constructor value that throws an error
features: [promise-try]
---*/
var CustomPromise = function () {
throw new Test262Error();
};
assert.throws(Test262Error, function () {
Promise.try.call(CustomPromise, function () {});
});