tests/auto/qml/ecmascripttests/test262/test/built-ins/Promise/resolve/S25.4.4.5_A2.1_T1.js
raw| 1 | // Copyright 2014 Cubane Canada, Inc. All rights reserved. |
| 2 | // See LICENSE for details. |
| 3 | |
| 4 | /*--- |
| 5 | es6id: S25.4.4.5_A2.1_T1 |
| 6 | author: Sam Mikes |
| 7 | description: Promise.resolve passes through a promise w/ same Constructor |
| 8 | ---*/ |
| 9 | |
| 10 | var p1 = Promise.resolve(1), |
| 11 | p2 = Promise.resolve(p1); |
| 12 | |
| 13 | if (p1 !== p2) { |
| 14 | $ERROR("Expected p1 === Promise.resolve(p1) because they have same constructor"); |
| 15 | } |