| 1 |
// Copyright (C) 2016 the V8 project authors. All rights reserved. |
| 2 |
// This code is governed by the BSD license found in the LICENSE file. |
| 3 |
|
| 4 |
/*--- |
| 5 |
description: > |
| 6 |
`Promise.resolve` invoked on a constructor value that throws an error |
| 7 |
es6id: 25.4.4.5 |
| 8 |
info: | |
| 9 |
1. Let C be the this value. |
| 10 |
[...] |
| 11 |
4. Let promiseCapability be NewPromiseCapability(C). |
| 12 |
5. ReturnIfAbrupt(promiseCapability). |
| 13 |
|
| 14 |
25.4.1.5 NewPromiseCapability |
| 15 |
[...] |
| 16 |
6. Let promise be Construct(C, «executor»). |
| 17 |
7. ReturnIfAbrupt(promise). |
| 18 |
---*/ |
| 19 |
|
| 20 |
var CustomPromise = function() { |
| 21 |
throw new Test262Error(); |
| 22 |
}; |
| 23 |
|
| 24 |
assert.throws(Test262Error, function() { |
| 25 |
Promise.resolve.call(CustomPromise); |
| 26 |
}); |