Skip to content

Commit 0d5d6e7

Browse files
anonrigaduh95
authored andcommitted
Remove --js-promise-withresolvers runtime flag
Co-authored-by: Antoine du Hamel <[email protected]> Bug: 42204122 Change-Id: I017a0d1ae0f8225513206ffb7806a4250be75d4c Reviewed-on: https://chromium-review.googlesource.com/c/v8/v8/+/5843972 Reviewed-by: Igor Sheludko <[email protected]> Commit-Queue: Erik Corry <[email protected]> Reviewed-by: Shu-yu Guo <[email protected]> Cr-Commit-Position: refs/heads/main@{#96215}
1 parent 0112b52 commit 0d5d6e7

4 files changed

Lines changed: 10 additions & 21 deletions

File tree

src/flags/flag-definitions.h

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -316,7 +316,6 @@ DEFINE_BOOL(js_shipping, true, "enable all shipped JavaScript features")
316316
V(harmony_import_attributes, "harmony import attributes")
317317

318318
#define JAVASCRIPT_SHIPPING_FEATURES_BASE(V) \
319-
V(js_promise_withresolvers, "Promise.withResolvers") \
320319
V(js_regexp_duplicate_named_groups, "RegExp duplicate named groups") \
321320
V(js_regexp_modifiers, "RegExp modifiers") \
322321
V(js_promise_try, "Promise.try")

src/init/bootstrapper.cc

Lines changed: 9 additions & 18 deletions
Original file line numberDiff line numberDiff line change
@@ -3258,6 +3258,15 @@ void Genesis::InitializeGlobal(Handle<JSGlobalObject> global_object,
32583258
InstallFunctionWithBuiltinId(isolate_, promise_fun, "reject",
32593259
Builtin::kPromiseReject, 1, kAdapt);
32603260

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+
32613270
SetConstructorInstanceType(isolate_, promise_fun,
32623271
JS_PROMISE_CONSTRUCTOR_TYPE);
32633272

@@ -5581,24 +5590,6 @@ void Genesis::InitializeGlobal_js_promise_try() {
55815590
Builtin::kPromiseTry, 1, kDontAdapt);
55825591
}
55835592

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-
56025593
void Genesis::InitializeGlobal_harmony_set_methods() {
56035594
if (!v8_flags.harmony_set_methods) return;
56045595

test/mjsunit/harmony/promise-withresolvers.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22
// Use of this source code is governed by a BSD-style license that can be
33
// found in the LICENSE file.
44

5-
// Flags: --js-promise-withresolvers --allow-natives-syntax
5+
// Flags: --allow-natives-syntax
66

77
const desc = Object.getOwnPropertyDescriptor(Promise, 'withResolvers');
88
assertTrue(desc.configurable);

test/test262/testcfg.py

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -58,7 +58,6 @@
5858
'json-parse-with-source': '--harmony-json-parse-with-source',
5959
'iterator-helpers': '--harmony-iterator-helpers',
6060
'set-methods': '--harmony-set-methods',
61-
'promise-with-resolvers': '--js-promise-withresolvers',
6261
'import-attributes': '--harmony-import-attributes',
6362
'regexp-duplicate-named-groups': '--js-regexp-duplicate-named-groups',
6463
'regexp-modifiers': '--js-regexp-modifiers',

0 commit comments

Comments
 (0)