Debian Codegraph @

js/src/tests/test262/built-ins/Promise/try/ctx-non-ctor.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: Promise.try errors when the receiver is not a constructor
7 esid: sec-promise.try
8 features: [promise-try]
9 ---*/
10
11 assert.throws(TypeError, function () {
12 Promise.try.call(eval);
13 });
14
15 reportCompare(0, 0);