@@ -3258,6 +3258,15 @@ void Genesis::InitializeGlobal(Handle<JSGlobalObject> global_object,
3258
3258
InstallFunctionWithBuiltinId (isolate_, promise_fun, " reject" ,
3259
3259
Builtin::kPromiseReject , 1 , kAdapt );
3260
3260
3261
+ std::array<Handle<Name>, 3 > fields{factory->promise_string (),
3262
+ factory->resolve_string (),
3263
+ factory->reject_string ()};
3264
+ DirectHandle<Map> result_map =
3265
+ CreateLiteralObjectMapFromCache (isolate_, fields);
3266
+ native_context ()->set_promise_withresolvers_result_map (*result_map);
3267
+ InstallFunctionWithBuiltinId (isolate_, promise_fun, " withResolvers" ,
3268
+ Builtin::kPromiseWithResolvers , 0 , kAdapt );
3269
+
3261
3270
SetConstructorInstanceType (isolate_, promise_fun,
3262
3271
JS_PROMISE_CONSTRUCTOR_TYPE);
3263
3272
@@ -5581,24 +5590,6 @@ void Genesis::InitializeGlobal_js_promise_try() {
5581
5590
Builtin::kPromiseTry , 1 , kDontAdapt );
5582
5591
}
5583
5592
5584
- void Genesis::InitializeGlobal_js_promise_withresolvers () {
5585
- if (!v8_flags.js_promise_withresolvers ) return ;
5586
-
5587
- Factory* factory = isolate ()->factory ();
5588
-
5589
- std::array<Handle<Name>, 3 > fields{factory->promise_string (),
5590
- factory->resolve_string (),
5591
- factory->reject_string ()};
5592
- DirectHandle<Map> result_map =
5593
- CreateLiteralObjectMapFromCache (isolate (), fields);
5594
- native_context ()->set_promise_withresolvers_result_map (*result_map);
5595
-
5596
- Handle<JSFunction> promise_fun =
5597
- handle (native_context ()->promise_function (), isolate ());
5598
- InstallFunctionWithBuiltinId (isolate (), promise_fun, " withResolvers" ,
5599
- Builtin::kPromiseWithResolvers , 0 , kAdapt );
5600
- }
5601
-
5602
5593
void Genesis::InitializeGlobal_harmony_set_methods () {
5603
5594
if (!v8_flags.harmony_set_methods ) return ;
5604
5595
0 commit comments