2014-10-23 19:58:31 +02:00
|
|
|
// Copyright 2014 Cubane Canada, Inc. All rights reserved.
|
|
|
|
// See LICENSE for details.
|
|
|
|
|
|
|
|
/*---
|
|
|
|
info: >
|
|
|
|
Promise executor has predictable environment
|
|
|
|
'this' should be global object in sloppy mode,
|
|
|
|
undefined in strict mode
|
2015-02-10 22:01:39 +01:00
|
|
|
es6id: S25.4.3.1_A5.1_T1
|
2014-10-23 19:58:31 +02:00
|
|
|
author: Sam Mikes
|
|
|
|
description: Promise executor gets default handling for 'this'
|
2016-02-12 18:59:51 +01:00
|
|
|
flags: [async, noStrict]
|
2014-10-23 19:58:31 +02:00
|
|
|
---*/
|
|
|
|
|
2016-04-22 19:07:00 +02:00
|
|
|
var expectedThis = this;
|
2014-10-23 19:58:31 +02:00
|
|
|
|
|
|
|
var p = new Promise(function (resolve) {
|
|
|
|
if (this !== expectedThis) {
|
2014-11-11 03:21:54 +01:00
|
|
|
$ERROR("'this' must be global object, got " + this);
|
2014-10-23 19:58:31 +02:00
|
|
|
}
|
|
|
|
|
|
|
|
resolve();
|
|
|
|
}).then($DONE, $DONE);
|