Skip to content

Commit

Permalink
[gin] Add flag for Array.fromAsync
Browse files Browse the repository at this point in the history
This CL adds a kill switch for Array.fromAsync flag in v8.

Bug: v8:13321
Change-Id: Ia9e57c90fdfc53ec1bf82884897a443e4526daf3
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/4990761
Reviewed-by: Shu-yu Guo <syg@chromium.org>
Reviewed-by: Adam Klein <adamk@chromium.org>
Commit-Queue: Rezvan Mahdavi Hezaveh <rezvan@chromium.org>
Cr-Commit-Position: refs/heads/main@{#1219130}
  • Loading branch information
rmahdav authored and Chromium LUCI CQ committed Nov 2, 2023
1 parent dd64775 commit ad79783
Show file tree
Hide file tree
Showing 3 changed files with 9 additions and 0 deletions.
5 changes: 5 additions & 0 deletions gin/gin_features.cc
Original file line number Diff line number Diff line change
Expand Up @@ -243,6 +243,11 @@ BASE_FEATURE(kJavaScriptPromiseWithResolvers,
"JavaScriptPromiseWithResolvers",
base::FEATURE_ENABLED_BY_DEFAULT);

// Enables the Array.fromAsync proposal.
BASE_FEATURE(kJavaScriptArrayFromAsync,
"JavaScriptArrayFromAsync",
base::FEATURE_ENABLED_BY_DEFAULT);

// WebAssembly features.

// Enable support for the WebAssembly tail-call proposal:
Expand Down
1 change: 1 addition & 0 deletions gin/gin_features.h
Original file line number Diff line number Diff line change
Expand Up @@ -67,6 +67,7 @@ GIN_EXPORT BASE_DECLARE_FEATURE(kJavaScriptArrayBufferTransfer);
GIN_EXPORT BASE_DECLARE_FEATURE(kJavaScriptCompileHintsMagic);
GIN_EXPORT BASE_DECLARE_FEATURE(kJavaScriptIteratorHelpers);
GIN_EXPORT BASE_DECLARE_FEATURE(kJavaScriptPromiseWithResolvers);
GIN_EXPORT BASE_DECLARE_FEATURE(kJavaScriptArrayFromAsync);
GIN_EXPORT BASE_DECLARE_FEATURE(kWebAssemblyTailCall);
GIN_EXPORT BASE_DECLARE_FEATURE(kWebAssemblyInlining);
GIN_EXPORT BASE_DECLARE_FEATURE(kWebAssemblyGenericWrapper);
Expand Down
3 changes: 3 additions & 0 deletions gin/v8_initializer.cc
Original file line number Diff line number Diff line change
Expand Up @@ -391,6 +391,9 @@ void SetFlags(IsolateHolder::ScriptMode mode,
SetV8FlagsIfOverridden(features::kJavaScriptPromiseWithResolvers,
"--js-promise-withresolvers",
"--no-js-promise-withresolvers");
SetV8FlagsIfOverridden(features::kJavaScriptArrayFromAsync,
"--harmony-array-from-async",
"--no-harmony-array-from-async");

if (IsolateHolder::kStrictMode == mode) {
SetV8Flags("--use_strict");
Expand Down

0 comments on commit ad79783

Please sign in to comment.