summaryrefslogtreecommitdiffstats
path: root/js/src/tests/test262/built-ins/Promise/resolve/S25.4.4.5_A2.2_T1.js
blob: 1445d3a242aa8f1d39e8bb29e8b499c9b3ced074 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
// |reftest| async
// Copyright 2014 Cubane Canada, Inc.  All rights reserved.
// See LICENSE for details.

/*---
es6id: S25.4.4.5_A2.2_T1
author: Sam Mikes
description: Promise.resolve passes through an unsettled promise w/ same Constructor
flags: [async]
---*/

var resolveP1,
  p1 = new Promise(function(resolve) {
    resolveP1 = resolve;
  }),
  p2 = Promise.resolve(p1),
  arg = {};

assert.sameValue(p1, p2, 'The value of p1 is expected to equal the value of p2');

p2.then(function(result) {
  assert.sameValue(result, arg, 'The value of result is expected to equal the value of arg');
}).then($DONE, $DONE);

resolveP1(arg);