summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorSatya Rohith <me@satyarohith.com>2024-03-20 10:56:41 +0530
committerGitHub <noreply@github.com>2024-03-20 05:26:41 +0000
commit737adbe1b076cda299131704520e9fe2d41b7611 (patch)
tree9e0cba7697a52a01dc2525b5ecd5e3cb803c64bf
parent0d43a63636c97886c10c6b8ce05fdb67cd2d8b91 (diff)
fix(ext/node): add process.setSourceMapsEnabled noop (#22993)
Closes https://github.com/denoland/deno/issues/22992
-rw-r--r--ext/node/polyfills/process.ts6
-rw-r--r--tests/unit_node/process_test.ts10
2 files changed, 16 insertions, 0 deletions
diff --git a/ext/node/polyfills/process.ts b/ext/node/polyfills/process.ts
index c6dfe6c62..44207e2f4 100644
--- a/ext/node/polyfills/process.ts
+++ b/ext/node/polyfills/process.ts
@@ -564,6 +564,12 @@ class Process extends EventEmitter {
return platform;
}
+ // https://nodejs.org/api/process.html#processsetsourcemapsenabledval
+ setSourceMapsEnabled(_val: boolean) {
+ // This is a no-op in Deno. Source maps are always enabled.
+ // TODO(@satyarohith): support disabling source maps if needed.
+ }
+
override addListener(event: "exit", listener: (code: number) => void): this;
override addListener(
event: typeof notImplementedEvents[number],
diff --git a/tests/unit_node/process_test.ts b/tests/unit_node/process_test.ts
index f496290d9..f32303002 100644
--- a/tests/unit_node/process_test.ts
+++ b/tests/unit_node/process_test.ts
@@ -1058,3 +1058,13 @@ Deno.test({
});
},
});
+
+Deno.test({
+ name: "process.setSourceMapsEnabled",
+ fn() {
+ // @ts-ignore: setSourceMapsEnabled is not available in the types yet.
+ process.setSourceMapsEnabled(false); // noop
+ // @ts-ignore: setSourceMapsEnabled is not available in the types yet.
+ process.setSourceMapsEnabled(true); // noop
+ },
+});