Debian Codegraph @

tests/auto/qml/ecmascripttests/test262/test/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 es6id: 25.4.4.1.2
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, that is not
12 identified as an anonymous function has a name property whose value
13 is a String.
14 ---*/
15
16 var resolveElementFunction;
17 var thenable = {
18 then: function(fulfill) {
19 resolveElementFunction = fulfill;
20 }
21 };
22
23 function NotPromise(executor) {
24 executor(function() {}, function() {});
25 }
26 NotPromise.resolve = function(v) {
27 return v;
28 };
29 Promise.all.call(NotPromise, [thenable]);
30
31 assert.sameValue(Object.prototype.hasOwnProperty.call(resolveElementFunction, "name"), false);