test262/test/built-ins/Promise/executor-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

23 lines
804 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.5.1
description: GetCapabilitiesExecutor 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 executorFunction;
function NotPromise(executor) {
executorFunction = executor;
executor(function(){}, function(){});
}
Promise.resolve.call(NotPromise);
assert.sameValue(Object.prototype.hasOwnProperty.call(executorFunction, "prototype"), false);
assert.throws(TypeError, function() { new executorFunction(); });