Debian Codegraph @

js/src/tests/test262/built-ins/Promise/all/resolve-element-function-name.js

raw
1 // Copyright (C) 2015 André Bargull. All rights reserved.
2 // This code is governed by the BSD license found in the LICENSE file.
3
4 /*---
5 esid: sec-promise.all-resolve-element-functions
6 description: The `name` property of Promise.all Resolve Element functions
7 info: |
8 A promise resolve function is an anonymous built-in function.
9
10 17 ECMAScript Standard Built-in Objects:
11 Every built-in function object, including constructors, has a `name`
12 property whose value is a String. Functions that are identified as
13 anonymous functions use the empty string as the value of the `name`
14 property.
15 Unless otherwise specified, the `name` property of a built-in function
16 object has the attributes { [[Writable]]: *false*, [[Enumerable]]: *false*,
17 [[Configurable]]: *true* }.
18 includes: [propertyHelper.js]
19 ---*/
20
21 var resolveElementFunction;
22 var thenable = {
23 then: function(fulfill) {
24 resolveElementFunction = fulfill;
25 }
26 };
27
28 function NotPromise(executor) {
29 executor(function() {}, function() {});
30 }
31 NotPromise.resolve = function(v) {
32 return v;
33 };
34 Promise.all.call(NotPromise, [thenable]);
35
36 verifyProperty(resolveElementFunction, "name", {
37 value: "", writable: false, enumerable: false, configurable: true
38 });
39
40 reportCompare(0, 0);