1
0
Fork 0
mirror of https://github.com/denoland/deno.git synced 2024-12-24 08:09:08 -05:00

fix(node): make 'v8.setFlagsFromString' a noop (#19271)

Towards https://github.com/denoland/deno/issues/16460
This commit is contained in:
Bartek Iwańczuk 2023-05-26 15:41:03 +02:00 committed by GitHub
parent d5a8a3d69f
commit 160fe9787e
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
2 changed files with 11 additions and 7 deletions

View file

@ -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");
},
});

View file

@ -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");