Debian Codegraph @

js/src/tests/test262/built-ins/Promise/try/promise.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 return value is a Promise
7 features: [promise-try]
8 ---*/
9
10 var instance = Promise.try(function () {});
11
12 assert.sameValue(instance.constructor, Promise);
13 assert.sameValue(instance instanceof Promise, true);
14
15 reportCompare(0, 0);