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

Unified Diff: src/js/promise.js

Issue 2592933004: [promises] Move Promise.resolve to TF (Closed)
Patch Set: throw correct typerror Created 4 years 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
« src/builtins/builtins-promise.cc ('K') | « src/builtins/builtins-promise.cc ('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 eb63c280a181649e52877550c4e03bc43098ab67..33c067b37f4296cc19a94895607739d618362e82 100644
--- a/src/js/promise.js
+++ b/src/js/promise.js
@@ -144,27 +144,6 @@ function PromiseReject(r) {
// Combinators.
-// ES#sec-promise.resolve
-// Promise.resolve ( x )
-function PromiseResolve(x) {
- if (!IS_RECEIVER(this)) {
- throw %make_type_error(kCalledOnNonObject, PromiseResolve);
- }
- if (%is_promise(x) && x.constructor === this) return x;
-
- // Avoid creating resolving functions.
- if (this === GlobalPromise) {
- var promise = %promise_internal_constructor(UNDEFINED);
- %promise_resolve(promise, x);
- return promise;
- }
-
- // debugEvent is not so meaningful here as it will be resolved
- var promiseCapability = NewPromiseCapability(this, true);
- %_Call(promiseCapability.resolve, UNDEFINED, x);
- return promiseCapability.promise;
-}
-
// ES#sec-promise.all
// Promise.all ( iterable )
function PromiseAll(iterable) {
@@ -336,7 +315,6 @@ utils.InstallFunctions(GlobalPromise, DONT_ENUM, [
"reject", PromiseReject,
"all", PromiseAll,
"race", PromiseRace,
- "resolve", PromiseResolve
]);
%InstallToContext([
« src/builtins/builtins-promise.cc ('K') | « src/builtins/builtins-promise.cc ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698