diff --git a/cli/tests/unit_node/v8_test.ts b/cli/tests/unit_node/v8_test.ts index ab19035962..724ac35044 100644 --- a/cli/tests/unit_node/v8_test.ts +++ b/cli/tests/unit_node/v8_test.ts @@ -4,10 +4,7 @@ import { getHeapStatistics, setFlagsFromString, } from "node:v8"; -import { - assertEquals, - assertThrows, -} from "../../../test_util/std/testing/asserts.ts"; +import { assertEquals } from "../../../test_util/std/testing/asserts.ts"; // https://github.com/nodejs/node/blob/a2bbe5ff216bc28f8dac1c36a8750025a93c3827/test/parallel/test-v8-version-tag.js#L6 Deno.test({ @@ -51,8 +48,8 @@ Deno.test({ }); Deno.test({ - name: "setFlagsFromString throws", + name: "setFlagsFromString", fn() { - assertThrows(() => setFlagsFromString("--allow_natives_syntax")); + setFlagsFromString("--allow_natives_syntax"); }, }); diff --git a/ext/node/polyfills/v8.ts b/ext/node/polyfills/v8.ts index 27feb1cecb..e411b541e0 100644 --- a/ext/node/polyfills/v8.ts +++ b/ext/node/polyfills/v8.ts @@ -42,7 +42,14 @@ export function getHeapStatistics() { } export function setFlagsFromString() { - notImplemented("v8.setFlagsFromString"); + // NOTE(bartlomieju): From Node.js docs: + // The v8.setFlagsFromString() method can be used to programmatically set V8 + // command-line flags. This method should be used with care. Changing settings + // after the VM has started may result in unpredictable behavior, including + // crashes and data loss; or it may simply do nothing. + // + // Notice: "or it may simply do nothing". This is what we're gonna do, + // this function will just be a no-op. } export function stopCoverage() { notImplemented("v8.stopCoverage");