2014-10-23 19:58:31 +02:00
|
|
|
// Copyright 2014 Cubane Canada, Inc. All rights reserved.
|
|
|
|
// See LICENSE for details.
|
|
|
|
|
|
|
|
/*---
|
2015-02-10 22:01:39 +01:00
|
|
|
es6id: S25.4.4.5_A2.3_T1
|
2014-10-23 19:58:31 +02:00
|
|
|
author: Sam Mikes
|
|
|
|
description: Promise.resolve passes through an unsettled promise w/ same Constructor
|
2016-02-12 18:59:51 +01:00
|
|
|
flags: [async]
|
2014-10-23 19:58:31 +02:00
|
|
|
---*/
|
|
|
|
|
|
|
|
var rejectP1,
|
2018-02-15 21:11:21 +01:00
|
|
|
p1 = new Promise(function(resolve, reject) {
|
|
|
|
rejectP1 = reject;
|
|
|
|
}),
|
|
|
|
p2 = Promise.resolve(p1),
|
2021-08-18 17:44:54 +02:00
|
|
|
arg = {};
|
2014-10-23 19:58:31 +02:00
|
|
|
|
2021-08-18 17:44:54 +02:00
|
|
|
assert.sameValue(p1, p2, 'The value of p1 is expected to equal the value of p2');
|
2014-10-23 19:58:31 +02:00
|
|
|
|
2018-02-15 21:11:21 +01:00
|
|
|
p2.then(function() {
|
2021-07-21 21:48:13 +02:00
|
|
|
throw new Test262Error("Expected p2 to be rejected, not fulfilled.");
|
2021-08-18 17:44:54 +02:00
|
|
|
}, function(result) {
|
|
|
|
assert.sameValue(result, arg, 'The value of result is expected to equal the value of arg');
|
2014-10-23 19:58:31 +02:00
|
|
|
}).then($DONE, $DONE);
|
|
|
|
|
2021-08-18 17:44:54 +02:00
|
|
|
rejectP1(arg);
|