@@ -3228,6 +3228,15 @@ void Genesis::InitializeGlobal(Handle<JSGlobalObject> global_object,
3228
3228
InstallFunctionWithBuiltinId (isolate_, promise_fun, " reject" ,
3229
3229
Builtin::kPromiseReject , 1 , true );
3230
3230
3231
+ std::array<Handle<Name>, 3 > fields{factory->promise_string (),
3232
+ factory->resolve_string (),
3233
+ factory->reject_string ()};
3234
+ DirectHandle<Map> result_map =
3235
+ CreateLiteralObjectMapFromCache (isolate_, fields);
3236
+ native_context ()->set_promise_withresolvers_result_map (*result_map);
3237
+ InstallFunctionWithBuiltinId (isolate_, promise_fun, " withResolvers" ,
3238
+ Builtin::kPromiseWithResolvers , 0 , true );
3239
+
3231
3240
SetConstructorInstanceType (isolate_, promise_fun,
3232
3241
JS_PROMISE_CONSTRUCTOR_TYPE);
3233
3242
@@ -5504,24 +5513,6 @@ void Genesis::InitializeGlobal_js_promise_try() {
5504
5513
Builtin::kPromiseTry , 1 , false );
5505
5514
}
5506
5515
5507
- void Genesis::InitializeGlobal_js_promise_withresolvers () {
5508
- if (!v8_flags.js_promise_withresolvers ) return ;
5509
-
5510
- Factory* factory = isolate ()->factory ();
5511
-
5512
- std::array<Handle<Name>, 3 > fields{factory->promise_string (),
5513
- factory->resolve_string (),
5514
- factory->reject_string ()};
5515
- DirectHandle<Map> result_map =
5516
- CreateLiteralObjectMapFromCache (isolate (), fields);
5517
- native_context ()->set_promise_withresolvers_result_map (*result_map);
5518
-
5519
- Handle<JSFunction> promise_fun =
5520
- handle (native_context ()->promise_function (), isolate ());
5521
- InstallFunctionWithBuiltinId (isolate (), promise_fun, " withResolvers" ,
5522
- Builtin::kPromiseWithResolvers , 0 , true );
5523
- }
5524
-
5525
5516
void Genesis::InitializeGlobal_harmony_set_methods () {
5526
5517
if (!v8_flags.harmony_set_methods ) return ;
5527
5518
0 commit comments