Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(666)

Unified Diff: src/promise.js

Issue 1343113003: Implement V8 extras utils object (Closed) Base URL: https://chromium.googlesource.com/v8/v8.git@master
Patch Set: Remove call/apply helpers Created 5 years, 3 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « src/prologue.js ('k') | test/cctest/test-api.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: src/promise.js
diff --git a/src/promise.js b/src/promise.js
index 97fc69cd266573b956399c129ad5c25dc95ed462..b509e76e4a9d16c9a7ba1db080b1708236d38777 100644
--- a/src/promise.js
+++ b/src/promise.js
@@ -2,7 +2,7 @@
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.
-(function(global, utils) {
+(function(global, utils, extrasUtils) {
"use strict";
@@ -388,4 +388,13 @@ utils.InstallFunctions(GlobalPromise.prototype, DONT_ENUM, [
"promise_then", PromiseThen,
]);
+// This allows extras to create promises quickly without building extra
+// resolve/reject closures, and allows them to later resolve and reject any
+// promise without having to hold on to those closures forever.
+utils.InstallFunctions(extrasUtils, 0, [
+ "createPromise", PromiseCreate,
+ "resolvePromise", PromiseResolve,
+ "rejectPromise", PromiseReject
+]);
+
})
« no previous file with comments | « src/prologue.js ('k') | test/cctest/test-api.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698