diff --git a/common.gypi b/common.gypi index a83523286a91..a982da03f78b 100644 --- a/common.gypi +++ b/common.gypi @@ -42,7 +42,7 @@ # Reset this number to 0 on major V8 upgrades. # Increment by one for each non-official patch applied to deps/v8. - 'v8_embedder_string': '-node.28', + 'v8_embedder_string': '-node.29', ##### V8 defaults for Node.js ##### diff --git a/deps/v8/src/builtins/builtins.cc b/deps/v8/src/builtins/builtins.cc index 34424db08dc0..0faa675d4dc3 100644 --- a/deps/v8/src/builtins/builtins.cc +++ b/deps/v8/src/builtins/builtins.cc @@ -838,10 +838,6 @@ Builtins::JSBuiltinStateFlags Builtins::GetJSBuiltinState(Builtin builtin) { case Builtin::kErrorIsError: RETURN_FLAG_DEPENDENT_BUILTIN_STATE(v8_flags.js_error_iserror); - // --js-regexp-escape - case Builtin::kRegExpEscape: - RETURN_FLAG_DEPENDENT_BUILTIN_STATE(v8_flags.js_regexp_escape); - // --js-explicit-resource-management case Builtin::kSuppressedErrorConstructor: case Builtin::kDisposableStackConstructor: diff --git a/deps/v8/src/flags/flag-definitions.h b/deps/v8/src/flags/flag-definitions.h index aab9435dbb53..fb1bae236111 100644 --- a/deps/v8/src/flags/flag-definitions.h +++ b/deps/v8/src/flags/flag-definitions.h @@ -342,7 +342,6 @@ DEFINE_BOOL(js_shipping, true, "enable all shipped JavaScript features") V(js_promise_try, "Promise.try") \ V(js_atomics_pause, "Atomics.pause") \ V(js_error_iserror, "Error.isError") \ - V(js_regexp_escape, "RegExp.escape") \ V(js_explicit_resource_management, "explicit resource management") \ V(js_float16array, \ "Float16Array, Math.f16round, DataView.getFloat16, DataView.setFloat16") \ diff --git a/deps/v8/src/init/bootstrapper.cc b/deps/v8/src/init/bootstrapper.cc index ba75a3a17df2..cab17a763ab8 100644 --- a/deps/v8/src/init/bootstrapper.cc +++ b/deps/v8/src/init/bootstrapper.cc @@ -3320,6 +3320,9 @@ void Genesis::InitializeGlobal(DirectHandle global_object, INSTALL_CAPTURE_GETTER(8); INSTALL_CAPTURE_GETTER(9); #undef INSTALL_CAPTURE_GETTER + + SimpleInstallFunction(isolate_, regexp_fun, "escape", + Builtin::kRegExpEscape, 1, kAdapt); } SetConstructorInstanceType(isolate_, regexp_fun, JS_REG_EXP_CONSTRUCTOR_TYPE); @@ -5897,14 +5900,7 @@ void Genesis::InitializeGlobal_js_float16array() { Context::FLOAT16_ARRAY_FUN_INDEX); } -void Genesis::InitializeGlobal_js_regexp_escape() { - if (!v8_flags.js_regexp_escape) return; - DirectHandle regexp_fun(native_context()->regexp_function(), - isolate()); - SimpleInstallFunction(isolate(), regexp_fun, "escape", Builtin::kRegExpEscape, - 1, kAdapt); -} void Genesis::InitializeGlobal_js_defer_import_eval() {} diff --git a/deps/v8/test/test262/testcfg.py b/deps/v8/test/test262/testcfg.py index aa93daaef0cd..e04ab5fd0311 100644 --- a/deps/v8/test/test262/testcfg.py +++ b/deps/v8/test/test262/testcfg.py @@ -67,7 +67,6 @@ 'source-phase-imports': '--js-source-phase-imports --allow-natives-syntax', 'Error.isError': '--js-error-iserror', 'uint8array-base64': '--js-base-64', - 'RegExp.escape': '--js-regexp-escape', 'upsert': '--js-upsert', 'Intl.Locale': '--js-intl-locale-variants', 'nonextensible-applies-to-private': '--js-nonextensible-applies-to-private', diff --git a/lib/internal/util/debuglog.js b/lib/internal/util/debuglog.js index 1cb3ba4df520..f7b50f1956e2 100644 --- a/lib/internal/util/debuglog.js +++ b/lib/internal/util/debuglog.js @@ -6,6 +6,7 @@ const { NumberPrototypeToFixed, ObjectDefineProperty, RegExp, + RegExpEscape, RegExpPrototypeExec, SafeArrayIterator, SafeMap, @@ -34,11 +35,7 @@ let testEnabled; function initializeDebugEnv(debugEnv) { debugImpls = { __proto__: null }; if (debugEnv) { - // This is run before any user code, it's OK not to use primordials. - debugEnv = debugEnv.replace(/[|\\{}()[\]^$+?.]/g, '\\$&') - .replaceAll('*', '.*') - .replaceAll(',', '$|^'); - const debugEnvRegex = new RegExp(`^${debugEnv}$`, 'i'); + const debugEnvRegex = new RegExp(`^${RegExpEscape(debugEnv)}$`, 'i'); testEnabled = (str) => RegExpPrototypeExec(debugEnvRegex, str) !== null; } else { testEnabled = () => false;