diff --git a/ext/node/polyfills/process.ts b/ext/node/polyfills/process.ts index 61a0075eab..54afab1bda 100644 --- a/ext/node/polyfills/process.ts +++ b/ext/node/polyfills/process.ts @@ -756,6 +756,15 @@ process.setSourceMapsEnabled = (_val: boolean) => { // TODO(@satyarohith): support disabling source maps if needed. }; +// Source maps are always enabled in Deno. +Object.defineProperty(process, "sourceMapsEnabled", { + get() { + return true; // Source maps are always enabled in Deno. + }, + enumerable: true, + configurable: true, +}); + /** * Returns the current high-resolution real time in a [seconds, nanoseconds] * tuple. diff --git a/tests/unit_node/process_test.ts b/tests/unit_node/process_test.ts index 9ac2b778ed..3dbdef7db0 100644 --- a/tests/unit_node/process_test.ts +++ b/tests/unit_node/process_test.ts @@ -1207,6 +1207,14 @@ Deno.test({ }, }); +Deno.test({ + name: "process.sourceMapsEnabled", + fn() { + // @ts-ignore: not available in the types yet. + assertEquals(process.sourceMapsEnabled, true); + }, +}); + // Regression test for https://github.com/denoland/deno/issues/23761 Deno.test({ name: "process.uptime without this",