| Index: src/js/promise-extra.js
|
| diff --git a/src/js/promise-extra.js b/src/js/promise-extra.js
|
| new file mode 100644
|
| index 0000000000000000000000000000000000000000..2613a500ded843aeb54d134846c0c1618d177beb
|
| --- /dev/null
|
| +++ b/src/js/promise-extra.js
|
| @@ -0,0 +1,30 @@
|
| +// Copyright 2015 the V8 project authors. All rights reserved.
|
| +// Use of this source code is governed by a BSD-style license that can be
|
| +// found in the LICENSE file.
|
| +
|
| +(function(global, utils) {
|
| +
|
| +"use strict";
|
| +
|
| +%CheckIsBootstrapping();
|
| +
|
| +var GlobalPromise = global.Promise;
|
| +
|
| +var PromiseChain = utils.ImportNow("PromiseChain");
|
| +var PromiseDeferred = utils.ImportNow("PromiseDeferred");
|
| +var PromiseResolved = utils.ImportNow("PromiseResolved");
|
| +
|
| +utils.InstallFunctions(GlobalPromise.prototype, DONT_ENUM, [
|
| + "chain", PromiseChain,
|
| +]);
|
| +
|
| +%InstallToContext([
|
| + "promise_chain", PromiseChain,
|
| +]);
|
| +
|
| +utils.InstallFunctions(GlobalPromise, DONT_ENUM, [
|
| + "defer", PromiseDeferred,
|
| + "accept", PromiseResolved,
|
| +]);
|
| +
|
| +})
|
|
|