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

Unified Diff: src/bootstrapper.cc

Issue 2596553002: [promises] Move Promise.prototype.catch to TF (Closed)
Patch Set: revert changes to test 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') | src/builtins/builtins-promise.cc » ('J')
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 e20baf0ec8e6975961807fb487cc88df78825f90..cf95f01e39e9d62565b3c50047adc2b0e906078b 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);
Handle<Map> prototype_map(prototype->map());
Map::SetShouldBeFastPrototypeMap(prototype_map, true, isolate);
« no previous file with comments | « no previous file | src/builtins/builtins.h » ('j') | src/builtins/builtins-promise.cc » ('J')

Powered by Google App Engine
This is Rietveld 408576698