keith_miller@apple.com | bcc77f2 | 2016-07-15 06:03:25 +0000 | [diff] [blame] | 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.5.1 |
| 6 | description: GetCapabilitiesExecutor 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 executorFunction; |
| 15 | function NotPromise(executor) { |
| 16 | executorFunction = executor; |
| 17 | executor(function(){}, function(){}); |
| 18 | } |
| 19 | Promise.resolve.call(NotPromise); |
| 20 | |
| 21 | assert.sameValue(Object.prototype.hasOwnProperty.call(executorFunction, "prototype"), false); |
| 22 | assert.throws(TypeError, function() { new executorFunction(); }); |