@@ -3217,6 +3217,15 @@ void Genesis::InitializeGlobal(Handle<JSGlobalObject> global_object,
3217
3217
InstallFunctionWithBuiltinId (isolate_, promise_fun, " reject" ,
3218
3218
Builtin::kPromiseReject , 1 , true );
3219
3219
3220
+ std::array<Handle<Name>, 3 > fields{factory->promise_string (),
3221
+ factory->resolve_string (),
3222
+ factory->reject_string ()};
3223
+ DirectHandle<Map> result_map =
3224
+ CreateLiteralObjectMapFromCache (isolate_, fields);
3225
+ native_context ()->set_promise_withresolvers_result_map (*result_map);
3226
+ InstallFunctionWithBuiltinId (isolate_, promise_fun, " withResolvers" ,
3227
+ Builtin::kPromiseWithResolvers , 0 , true );
3228
+
3220
3229
SetConstructorInstanceType (isolate_, promise_fun,
3221
3230
JS_PROMISE_CONSTRUCTOR_TYPE);
3222
3231
@@ -5445,23 +5454,6 @@ void Genesis::InitializeGlobal_harmony_iterator_helpers() {
5445
5454
#undef ITERATOR_HELPERS
5446
5455
}
5447
5456
5448
- void Genesis::InitializeGlobal_js_promise_withresolvers () {
5449
- if (!v8_flags.js_promise_withresolvers ) return ;
5450
-
5451
- Factory* factory = isolate ()->factory ();
5452
-
5453
- std::array<Handle<Name>, 3 > fields{factory->promise_string (),
5454
- factory->resolve_string (),
5455
- factory->reject_string ()};
5456
- Handle<Map> result_map = CreateLiteralObjectMapFromCache (isolate (), fields);
5457
- native_context ()->set_promise_withresolvers_result_map (*result_map);
5458
-
5459
- Handle<JSFunction> promise_fun =
5460
- handle (native_context ()->promise_function (), isolate ());
5461
- InstallFunctionWithBuiltinId (isolate (), promise_fun, " withResolvers" ,
5462
- Builtin::kPromiseWithResolvers , 0 , true );
5463
- }
5464
-
5465
5457
void Genesis::InitializeGlobal_harmony_set_methods () {
5466
5458
if (!v8_flags.harmony_set_methods ) return ;
5467
5459
0 commit comments