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

Unified Diff: src/bootstrapper.cc

Issue 2596553002: [promises] Move Promise.prototype.catch to TF (Closed)
Patch Set: fix nits 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
« no previous file with comments | « no previous file | src/builtins/builtins.h » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: src/bootstrapper.cc
diff --git a/src/bootstrapper.cc b/src/bootstrapper.cc
index bd91af898873f8baa91857a5007e622635b7003c..fe4721617cd8a2ffa3be6f6448fdd28f5d876907 100644
--- a/src/bootstrapper.cc
+++ b/src/bootstrapper.cc
@@ -1872,16 +1872,15 @@ void Genesis::InitializeGlobal(Handle<JSGlobalObject> global_object,
static_cast<PropertyAttributes>(DONT_ENUM | READ_ONLY));
Handle<JSFunction> promise_then =
- SimpleCreateFunction(isolate, isolate->factory()->then_string(),
- Builtins::kPromiseThen, 2, true);
- JSObject::AddProperty(prototype, isolate->factory()->then_string(),
- promise_then, DONT_ENUM);
+ SimpleInstallFunction(prototype, isolate->factory()->then_string(),
+ Builtins::kPromiseThen, 2, true);
InstallWithIntrinsicDefaultProto(isolate, promise_then,
Context::PROMISE_THEN_INDEX);
- // TODO(gsathya): Move to TF
- SimpleInstallFunction(prototype, "catch", Builtins::kIllegal, 1, true,
- DONT_ENUM);
+ Handle<JSFunction> promise_catch = SimpleInstallFunction(
+ prototype, "catch", Builtins::kPromiseCatch, 1, true, DONT_ENUM);
+ InstallWithIntrinsicDefaultProto(isolate, promise_catch,
+ Context::PROMISE_CATCH_INDEX);
SimpleInstallGetter(promise_fun, factory->symbol_species_string(),
factory->species_symbol(), Builtins::kReturnReceiver,
« no previous file with comments | « no previous file | src/builtins/builtins.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698