| 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 |
description: Resolving with a non-object value |
| 5 |
es6id: 25.4.4.5 |
| 6 |
info: | |
| 7 |
[...] |
| 8 |
6. Let resolveResult be Call(promiseCapability.[[Resolve]], undefined, |
| 9 |
«x»). |
| 10 |
[...] |
| 11 |
|
| 12 |
25.4.1.3.2 Promise Resolve Functions |
| 13 |
[...] |
| 14 |
7. If Type(resolution) is not Object, then |
| 15 |
a. Return FulfillPromise(promise, resolution). |
| 16 |
flags: [async] |
| 17 |
---*/ |
| 18 |
|
| 19 |
Promise.resolve(23).then(function(value) { |
| 20 |
if (value !== 23) { |
| 21 |
$DONE('The promise should be fulfilled with the provided value.'); |
| 22 |
return; |
| 23 |
} |
| 24 |
|
| 25 |
$DONE(); |
| 26 |
}, function() { |
| 27 |
$DONE('The promise should not be rejected.'); |
| 28 |
}); |