| 1 |
// Copyright 2014 Cubane Canada, Inc. All rights reserved. |
| 2 |
// See LICENSE for details. |
| 3 |
|
| 4 |
/*--- |
| 5 |
info: | |
| 6 |
Promise executor has predictable environment |
| 7 |
'this' should be global object in sloppy mode, |
| 8 |
undefined in strict mode |
| 9 |
es6id: S25.4.3.1_A5.1_T1 |
| 10 |
author: Sam Mikes |
| 11 |
description: Promise executor gets default handling for 'this' |
| 12 |
flags: [async, noStrict] |
| 13 |
---*/ |
| 14 |
|
| 15 |
var expectedThis = this; |
| 16 |
|
| 17 |
var p = new Promise(function(resolve) { |
| 18 |
if (this !== expectedThis) { |
| 19 |
$ERROR("'this' must be global object, got " + this); |
| 20 |
} |
| 21 |
|
| 22 |
resolve(); |
| 23 |
}).then($DONE, $DONE); |