diff options
-rw-r--r-- | ext/node/polyfills/process.ts | 6 | ||||
-rw-r--r-- | tests/unit_node/process_test.ts | 10 |
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 + }, +}); |