From b21d7884e809fbfe292f1eb2cf2aa0f2ac71a810 Mon Sep 17 00:00:00 2001 From: "trop[bot]" <37223003+trop[bot]@users.noreply.github.com> Date: Tue, 11 Jun 2024 12:53:15 -0500 Subject: [PATCH] fix: bad js-flags shouldn't crash the app (#42440) * fix: bad js-flags shouldn't crash the app Co-authored-by: Shelley Vohr * Update shell/browser/javascript_environment.cc Co-authored-by: Robo Co-authored-by: Shelley Vohr --------- Co-authored-by: trop[bot] <37223003+trop[bot]@users.noreply.github.com> Co-authored-by: Shelley Vohr --- shell/browser/javascript_environment.cc | 9 +++------ 1 file changed, 3 insertions(+), 6 deletions(-) diff --git a/shell/browser/javascript_environment.cc b/shell/browser/javascript_environment.cc index f91ac8a38984..459984463753 100644 --- a/shell/browser/javascript_environment.cc +++ b/shell/browser/javascript_environment.cc @@ -281,13 +281,10 @@ class TracingControllerImpl : public node::tracing::TracingController { v8::Isolate* JavascriptEnvironment::Initialize(uv_loop_t* event_loop, bool setup_wasm_streaming) { auto* cmd = base::CommandLine::ForCurrentProcess(); - // --js-flags. - std::string js_flags = - cmd->GetSwitchValueASCII(blink::switches::kJavaScriptFlags); - js_flags.append(" --no-freeze-flags-after-init"); - if (!js_flags.empty()) - v8::V8::SetFlagsFromString(js_flags.c_str(), js_flags.size()); + std::string js_flags = "--no-freeze-flags-after-init "; + js_flags.append(cmd->GetSwitchValueASCII(blink::switches::kJavaScriptFlags)); + v8::V8::SetFlagsFromString(js_flags.c_str(), js_flags.size()); // The V8Platform of gin relies on Chromium's task schedule, which has not // been started at this point, so we have to rely on Node's V8Platform.