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

Unified Diff: src/js/promise.js

Issue 2616673003: [promises] Move various promise reject functions to TF (Closed)
Patch Set: fix build Created 3 years, 11 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/contexts.h ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: src/js/promise.js
diff --git a/src/js/promise.js b/src/js/promise.js
index fd02b17d180c86adfadcc886bf162f2199e06d2a..0013c37911425c02d1ae881cfb6d439ce15ac6b0 100644
--- a/src/js/promise.js
+++ b/src/js/promise.js
@@ -46,26 +46,6 @@ function DoRejectPromise(promise, reason) {
%PromiseReject(promise, reason, true);
}
-// ES#sec-promise.reject
-// Promise.reject ( x )
-function PromiseReject(r) {
- if (!IS_RECEIVER(this)) {
- throw %make_type_error(kCalledOnNonObject, PromiseReject);
- }
- if (this === GlobalPromise) {
- // Optimized case, avoid extra closure.
- var promise = %promise_create_and_set(kRejected, r);
- // Trigger debug events if the debugger is on, as Promise.reject is
- // equivalent to throwing an exception directly.
- %PromiseRejectEventFromStack(promise, r);
- return promise;
- } else {
- var promiseCapability = %new_promise_capability(this, true);
- %_Call(promiseCapability.reject, UNDEFINED, r);
- return promiseCapability.promise;
- }
-}
-
// Combinators.
// ES#sec-promise.all
@@ -174,7 +154,6 @@ function MarkPromiseAsHandled(promise) {
// Install exported functions.
utils.InstallFunctions(GlobalPromise, DONT_ENUM, [
- "reject", PromiseReject,
"all", PromiseAll,
"race", PromiseRace,
]);
@@ -182,8 +161,6 @@ utils.InstallFunctions(GlobalPromise, DONT_ENUM, [
%InstallToContext([
"promise_create", PromiseCreate,
"promise_reject", DoRejectPromise,
- // TODO(gsathya): Remove this once we update the promise builtin.
- "promise_internal_reject", RejectPromise,
"promise_id_resolve_handler", PromiseIdResolveHandler,
"promise_id_reject_handler", PromiseIdRejectHandler
]);
« no previous file with comments | « src/contexts.h ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698