blob: d3f268f0a6dc014f87c22029bfe617235679bd8d (
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
26
27
28
29
|
// Copyright (C) 2015 the V8 project authors. All rights reserved.
// This code is governed by the BSD license found in the LICENSE file.
/*---
description: >
`Promise.resolve` invoked with a Promise with a unique constructor
es6id: 25.4.4.5
info: |
1. Let C be the this value.
[...]
3. If IsPromise(x) is true,
a. Let xConstructor be Get(x, "constructor").
b. ReturnIfAbrupt(xConstructor).
c. If SameValue(xConstructor, C) is true, return x.
4. Let promiseCapability be NewPromiseCapability(C).
[...]
8. Return promiseCapability.[[Promise]].
---*/
var promise1 = new Promise(function() {});
var promise2;
promise1.constructor = null;
promise2 = Promise.resolve(promise1);
assert.sameValue(promise1 === promise2, false);
reportCompare(0, 0);
|