@@ -3228,6 +3228,15 @@ void Genesis::InitializeGlobal(Handle<JSGlobalObject> global_object,
32283228 InstallFunctionWithBuiltinId (isolate_, promise_fun, " reject" ,
32293229 Builtin::kPromiseReject , 1 , true );
32303230
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+
32313240 SetConstructorInstanceType (isolate_, promise_fun,
32323241 JS_PROMISE_CONSTRUCTOR_TYPE);
32333242
@@ -5504,24 +5513,6 @@ void Genesis::InitializeGlobal_js_promise_try() {
55045513 Builtin::kPromiseTry , 1 , false );
55055514}
55065515
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-
55255516void Genesis::InitializeGlobal_harmony_set_methods () {
55265517 if (!v8_flags.harmony_set_methods ) return ;
55275518
0 commit comments