Debian Codegraph @

tests/auto/qml/ecmascripttests/test262/test/built-ins/Promise/all/resolve-element-function-length.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 `length` property of Promise.all Resolve Element functions
7 info: |
8 The length property of a Promise.all resolve element function is 1.
9
10 17 ECMAScript Standard Built-in Objects:
11 Unless otherwise specified, the length property of a built-in Function
12 object has the attributes { [[Writable]]: false, [[Enumerable]]: false,
13 [[Configurable]]: true }.
14 includes: [propertyHelper.js]
15 ---*/
16
17 var resolveElementFunction;
18 var thenable = {
19 then: function(fulfill) {
20 resolveElementFunction = fulfill;
21 }
22 };
23
24 function NotPromise(executor) {
25 executor(function() {}, function() {});
26 }
27 NotPromise.resolve = function(v) {
28 return v;
29 };
30 Promise.all.call(NotPromise, [thenable]);
31
32 assert.sameValue(resolveElementFunction.length, 1);
33
34 verifyNotEnumerable(resolveElementFunction, "length");
35 verifyNotWritable(resolveElementFunction, "length");
36 verifyConfigurable(resolveElementFunction, "length");