Debian Codegraph @

tests/auto/qml/ecmascripttests/test262/test/built-ins/Promise/reject-function-nonconstructor.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.1.3.1
6 description: Promise Reject functions are not constructors
7 info: |
8 17 ECMAScript Standard Built-in Objects:
9 Built-in function objects that are not identified as constructors do not
10 implement the [[Construct]] internal method unless otherwise specified
11 in the description of a particular function.
12 ---*/
13
14 var rejectFunction;
15 new Promise(function(resolve, reject) {
16 rejectFunction = reject;
17 });
18
19 assert.sameValue(Object.prototype.hasOwnProperty.call(rejectFunction, "prototype"), false);
20 assert.throws(TypeError, function() {
21 new rejectFunction();
22 });