test262/test/built-ins/Promise/reject-function-nonconstructor.js
André Bargull f95b56ab28 Revert "js-beautify: make all indentation consistent (depth & character) (#1409)" (#1412)
This reverts commit a01de4a722d088055a7d84d8c691ddd7109edb34.
2018-02-09 12:09:47 -05:00

21 lines
721 B
JavaScript

// Copyright (C) 2015 André Bargull. All rights reserved.
// This code is governed by the BSD license found in the LICENSE file.
/*---
es6id: 25.4.1.3.1
description: Promise Reject functions are not constructors
info: |
17 ECMAScript Standard Built-in Objects:
Built-in function objects that are not identified as constructors do not
implement the [[Construct]] internal method unless otherwise specified
in the description of a particular function.
---*/
var rejectFunction;
new Promise(function(resolve, reject) {
rejectFunction = reject;
});
assert.sameValue(Object.prototype.hasOwnProperty.call(rejectFunction, "prototype"), false);
assert.throws(TypeError, function() { new rejectFunction(); });