1 |
|
2 |
|
3 |
|
4 |
|
5 |
|
6 |
|
7 |
|
8 |
|
9 |
|
10 |
|
11 | export var AsyncTestCompleter = (function () {
|
12 | function AsyncTestCompleter() {
|
13 | var _this = this;
|
14 | this._promise = new Promise(function (res, rej) {
|
15 | _this._resolve = res;
|
16 | _this._reject = rej;
|
17 | });
|
18 | }
|
19 | AsyncTestCompleter.prototype.done = function (value) { this._resolve(value); };
|
20 | AsyncTestCompleter.prototype.fail = function (error, stackTrace) { this._reject(error); };
|
21 | Object.defineProperty(AsyncTestCompleter.prototype, "promise", {
|
22 | get: function () { return this._promise; },
|
23 | enumerable: true,
|
24 | configurable: true
|
25 | });
|
26 | return AsyncTestCompleter;
|
27 | }());
|
28 |
|
\ | No newline at end of file |