<p dir="auto">The code:</p>
<div class="highlight highlight-source-ts notranslate position-relative overflow-auto" dir="auto" data-snippet-clipboard-copy-content="const a = (
  it: [
    string,
    string,
    string,
    string,
    string,
    string,
    string,
    string,
    string,
    string,
    string,
    string,
    string,
    string,
    string,
    string,
    string,
    string
  ]
) =&gt; it;

throw new Error(&quot;abc&quot;);"><pre class="notranslate"><span class="pl-k">const</span> <span class="pl-en">a</span> <span class="pl-c1">=</span> <span class="pl-kos">(</span>
  <span class="pl-s1">it</span>: <span class="pl-kos">[</span>
    <span class="pl-smi">string</span><span class="pl-kos">,</span>
    <span class="pl-smi">string</span><span class="pl-kos">,</span>
    <span class="pl-smi">string</span><span class="pl-kos">,</span>
    <span class="pl-smi">string</span><span class="pl-kos">,</span>
    <span class="pl-smi">string</span><span class="pl-kos">,</span>
    <span class="pl-smi">string</span><span class="pl-kos">,</span>
    <span class="pl-smi">string</span><span class="pl-kos">,</span>
    <span class="pl-smi">string</span><span class="pl-kos">,</span>
    <span class="pl-smi">string</span><span class="pl-kos">,</span>
    <span class="pl-smi">string</span><span class="pl-kos">,</span>
    <span class="pl-smi">string</span><span class="pl-kos">,</span>
    <span class="pl-smi">string</span><span class="pl-kos">,</span>
    <span class="pl-smi">string</span><span class="pl-kos">,</span>
    <span class="pl-smi">string</span><span class="pl-kos">,</span>
    <span class="pl-smi">string</span><span class="pl-kos">,</span>
    <span class="pl-smi">string</span><span class="pl-kos">,</span>
    <span class="pl-smi">string</span><span class="pl-kos">,</span>
    <span class="pl-smi">string</span>
  <span class="pl-kos">]</span>
<span class="pl-kos">)</span> <span class="pl-c1">=&gt;</span> <span class="pl-s1">it</span><span class="pl-kos">;</span>

<span class="pl-k">throw</span> <span class="pl-k">new</span> <span class="pl-smi">Error</span><span class="pl-kos">(</span><span class="pl-s">"abc"</span><span class="pl-kos">)</span><span class="pl-kos">;</span></pre></div>
<p dir="auto">Is compiled with <code class="notranslate">tsc --inlineSourceMap main2.ts</code> to:</p>
<div class="highlight highlight-source-js notranslate position-relative overflow-auto" dir="auto" data-snippet-clipboard-copy-content="var a = function (it) { return it; };
throw new Error(&quot;abc&quot;);
//# sourceMappingURL=data:application/json;base64,eyJ2ZXJzaW9uIjozLCJmaWxlIjoibWFpbjIuanMiLCJzb3VyY2VSb290IjoiIiwic291cmNlcyI6WyJtYWluMi50cyJdLCJuYW1lcyI6W10sIm1hcHBpbmdzIjoiQUFBQSxJQUFNLENBQUMsR0FBRyxVQUNSLEVBbUJDLElBQ0UsT0FBQSxFQUFFLEVBQUYsQ0FBRSxDQUFDO0FBRVIsTUFBTSxJQUFJLEtBQUssQ0FBQyxLQUFLLENBQUMsQ0FBQyJ9"><pre class="notranslate"><span class="pl-k">var</span> <span class="pl-en">a</span> <span class="pl-c1">=</span> <span class="pl-k">function</span> <span class="pl-kos">(</span><span class="pl-s1">it</span><span class="pl-kos">)</span> <span class="pl-kos">{</span> <span class="pl-k">return</span> <span class="pl-s1">it</span><span class="pl-kos">;</span> <span class="pl-kos">}</span><span class="pl-kos">;</span>
<span class="pl-k">throw</span> <span class="pl-k">new</span> <span class="pl-v">Error</span><span class="pl-kos">(</span><span class="pl-s">"abc"</span><span class="pl-kos">)</span><span class="pl-kos">;</span>
<span class="pl-c">//# sourceMappingURL=data:application/json;base64,eyJ2ZXJzaW9uIjozLCJmaWxlIjoibWFpbjIuanMiLCJzb3VyY2VSb290IjoiIiwic291cmNlcyI6WyJtYWluMi50cyJdLCJuYW1lcyI6W10sIm1hcHBpbmdzIjoiQUFBQSxJQUFNLENBQUMsR0FBRyxVQUNSLEVBbUJDLElBQ0UsT0FBQSxFQUFFLEVBQUYsQ0FBRSxDQUFDO0FBRVIsTUFBTSxJQUFJLEtBQUssQ0FBQyxLQUFLLENBQUMsQ0FBQyJ9</span></pre></div>
<p dir="auto">It works on node:</p>
<div class="snippet-clipboard-content notranslate position-relative overflow-auto" data-snippet-clipboard-copy-content="$ node --enable-source-maps main2.js
/.../main2.ts:24
throw new Error(&quot;abc&quot;);
      ^

Error: abc
    at Object.&lt;anonymous&gt; (/.../main2.ts:24:7)
    at Module._compile (internal/modules/cjs/loader.js:1085:14)
    at Object.Module._extensions..js (internal/modules/cjs/loader.js:1114:10)
    at Module.load (internal/modules/cjs/loader.js:950:32)
    at Function.Module._load (internal/modules/cjs/loader.js:790:12)
    at Function.executeUserEntryPoint [as runMain] (internal/modules/run_main.js:75:12)
    at internal/main/run_main_module.js:17:47"><pre class="notranslate"><code class="notranslate">$ node --enable-source-maps main2.js
/.../main2.ts:24
throw new Error("abc");
      ^

Error: abc
    at Object.&lt;anonymous&gt; (/.../main2.ts:24:7)
    at Module._compile (internal/modules/cjs/loader.js:1085:14)
    at Object.Module._extensions..js (internal/modules/cjs/loader.js:1114:10)
    at Module.load (internal/modules/cjs/loader.js:950:32)
    at Function.Module._load (internal/modules/cjs/loader.js:790:12)
    at Function.executeUserEntryPoint [as runMain] (internal/modules/run_main.js:75:12)
    at internal/main/run_main_module.js:17:47
</code></pre></div>
<p dir="auto">But not on Deno:</p>
<div class="snippet-clipboard-content notranslate position-relative overflow-auto" data-snippet-clipboard-copy-content="$ deno --version
deno 1.25.3 (release, x86_64-unknown-linux-gnu)
v8 10.6.194.5
typescript 4.7.4

$deno run main2.js
error: Uncaught Error: abc
Warning Couldn't format source line: Line 24 is out of bounds (source may have changed at runtime)
    at file:///.../main2.js:24:7"><pre class="notranslate"><code class="notranslate">$ deno --version
deno 1.25.3 (release, x86_64-unknown-linux-gnu)
v8 10.6.194.5
typescript 4.7.4

$deno run main2.js
error: Uncaught Error: abc
Warning Couldn't format source line: Line 24 is out of bounds (source may have changed at runtime)
    at file:///.../main2.js:24:7
</code></pre></div>
<p dir="auto">I also tested <code class="notranslate">tsc --inlineSourceMap --inlineSources main2.ts</code>, to the same effect.</p>
<p dir="auto">Would it possible for Deno to handle arbitrary JS source maps? For example, from CoffeeScript?</p>
<p dir="auto">Using Deno <code class="notranslate">1.23.0</code>, when I have <code class="notranslate">deno.test</code> cases and <code class="notranslate">deno.bench</code> benches in the same file, in this case it's called <code class="notranslate">strip-comments_test.ts</code></p>
<div class="snippet-clipboard-content notranslate position-relative overflow-auto" data-snippet-clipboard-copy-content="deno bench --no-check --unstable strip-comments_test.ts"><pre class="notranslate"><code class="notranslate">deno bench --no-check --unstable strip-comments_test.ts
</code></pre></div>
<p dir="auto">works as expected</p>
<p dir="auto">whereas</p>
<div class="snippet-clipboard-content notranslate position-relative overflow-auto" data-snippet-clipboard-copy-content="deno test --no-check --unstable strip-comments_test.ts"><pre class="notranslate"><code class="notranslate">deno test --no-check --unstable strip-comments_test.ts
</code></pre></div>
<p dir="auto">throws</p>
<div class="snippet-clipboard-content notranslate position-relative overflow-auto" data-snippet-clipboard-copy-content="Uncaught error from ./strip-comments_test.ts FAILED

 ERRORS 

./strip-comments_test.ts (uncaught error)
error: TypeError: ops[opName] is not a function
Deno.bench(&quot;strip-comments&quot;, () =&gt; {
     ^
    at Object.opSync (deno:core/01_core.js:170:38)
    at Object.bench (deno:runtime/js/40_testing.js:672:10)
    at file:///Users/Can/Projects/Konduktum/Konduktum-2022/konduktum-remix-deno/strip-comments_test.ts:134:6
This error was not caught from a test and caused the test runner to fail on the referenced module.
It most likely originated from a dangling promise, event/timeout handler or top-level code.

 FAILURES 

./strip-comments_test.ts (uncaught error)

FAILED | 0 passed | 1 failed (261ms)"><pre class="notranslate"><code class="notranslate">Uncaught error from ./strip-comments_test.ts FAILED

 ERRORS 

./strip-comments_test.ts (uncaught error)
error: TypeError: ops[opName] is not a function
Deno.bench("strip-comments", () =&gt; {
     ^
    at Object.opSync (deno:core/01_core.js:170:38)
    at Object.bench (deno:runtime/js/40_testing.js:672:10)
    at file:///Users/Can/Projects/Konduktum/Konduktum-2022/konduktum-remix-deno/strip-comments_test.ts:134:6
This error was not caught from a test and caused the test runner to fail on the referenced module.
It most likely originated from a dangling promise, event/timeout handler or top-level code.

 FAILURES 

./strip-comments_test.ts (uncaught error)

FAILED | 0 passed | 1 failed (261ms)
</code></pre></div>
<p dir="auto">example file for reproduction</p>
<div class="highlight highlight-source-ts notranslate position-relative overflow-auto" dir="auto" data-snippet-clipboard-copy-content="// mentioned in https://github.com/unocss/unocss/issues/1139#issuecomment-1163635346
import { assertEquals } from &quot;https://deno.land/std@0.144.0/testing/asserts.ts&quot;;
import { default as stripComments } from &quot;https://esm.sh/strip-comments@2.0.1?no-check&quot;;
import { stripLiteral } from &quot;https://esm.sh/strip-literal@0.4.0&quot;;

const code = `bla original`;

const expected = `the expected`;

Deno.test(&quot;strip-comments&quot;, () =&gt; {
  assertEquals(stripComments(code), expected);
});
Deno.test(&quot;strip-literal&quot;, () =&gt; {
  assertEquals(stripLiteral(code), expected);
});

Deno.bench(&quot;strip-comments&quot;, () =&gt; {
  stripComments(code.repeat(100));
});
Deno.bench(&quot;strip-literal&quot;, () =&gt; {
  stripLiteral(code.repeat(100));
});"><pre class="notranslate"><span class="pl-c">// mentioned in https://github.com/unocss/unocss/issues/1139#issuecomment-1163635346</span>
<span class="pl-k">import</span> <span class="pl-kos">{</span> <span class="pl-s1">assertEquals</span> <span class="pl-kos">}</span> <span class="pl-k">from</span> <span class="pl-s">"https://deno.land/std@0.144.0/testing/asserts.ts"</span><span class="pl-kos">;</span>
<span class="pl-k">import</span> <span class="pl-kos">{</span> <span class="pl-s1">default</span> <span class="pl-k">as</span> <span class="pl-s1">stripComments</span> <span class="pl-kos">}</span> <span class="pl-k">from</span> <span class="pl-s">"https://esm.sh/strip-comments@2.0.1?no-check"</span><span class="pl-kos">;</span>
<span class="pl-k">import</span> <span class="pl-kos">{</span> <span class="pl-s1">stripLiteral</span> <span class="pl-kos">}</span> <span class="pl-k">from</span> <span class="pl-s">"https://esm.sh/strip-literal@0.4.0"</span><span class="pl-kos">;</span>

<span class="pl-k">const</span> <span class="pl-s1">code</span> <span class="pl-c1">=</span> <span class="pl-s">`bla original`</span><span class="pl-kos">;</span>

<span class="pl-k">const</span> <span class="pl-s1">expected</span> <span class="pl-c1">=</span> <span class="pl-s">`the expected`</span><span class="pl-kos">;</span>

<span class="pl-smi">Deno</span><span class="pl-kos">.</span><span class="pl-en">test</span><span class="pl-kos">(</span><span class="pl-s">"strip-comments"</span><span class="pl-kos">,</span> <span class="pl-kos">(</span><span class="pl-kos">)</span> <span class="pl-c1">=&gt;</span> <span class="pl-kos">{</span>
  <span class="pl-en">assertEquals</span><span class="pl-kos">(</span><span class="pl-en">stripComments</span><span class="pl-kos">(</span><span class="pl-s1">code</span><span class="pl-kos">)</span><span class="pl-kos">,</span> <span class="pl-s1">expected</span><span class="pl-kos">)</span><span class="pl-kos">;</span>
<span class="pl-kos">}</span><span class="pl-kos">)</span><span class="pl-kos">;</span>
<span class="pl-smi">Deno</span><span class="pl-kos">.</span><span class="pl-en">test</span><span class="pl-kos">(</span><span class="pl-s">"strip-literal"</span><span class="pl-kos">,</span> <span class="pl-kos">(</span><span class="pl-kos">)</span> <span class="pl-c1">=&gt;</span> <span class="pl-kos">{</span>
  <span class="pl-en">assertEquals</span><span class="pl-kos">(</span><span class="pl-en">stripLiteral</span><span class="pl-kos">(</span><span class="pl-s1">code</span><span class="pl-kos">)</span><span class="pl-kos">,</span> <span class="pl-s1">expected</span><span class="pl-kos">)</span><span class="pl-kos">;</span>
<span class="pl-kos">}</span><span class="pl-kos">)</span><span class="pl-kos">;</span>

<span class="pl-smi">Deno</span><span class="pl-kos">.</span><span class="pl-en">bench</span><span class="pl-kos">(</span><span class="pl-s">"strip-comments"</span><span class="pl-kos">,</span> <span class="pl-kos">(</span><span class="pl-kos">)</span> <span class="pl-c1">=&gt;</span> <span class="pl-kos">{</span>
  <span class="pl-en">stripComments</span><span class="pl-kos">(</span><span class="pl-s1">code</span><span class="pl-kos">.</span><span class="pl-en">repeat</span><span class="pl-kos">(</span><span class="pl-c1">100</span><span class="pl-kos">)</span><span class="pl-kos">)</span><span class="pl-kos">;</span>
<span class="pl-kos">}</span><span class="pl-kos">)</span><span class="pl-kos">;</span>
<span class="pl-smi">Deno</span><span class="pl-kos">.</span><span class="pl-en">bench</span><span class="pl-kos">(</span><span class="pl-s">"strip-literal"</span><span class="pl-kos">,</span> <span class="pl-kos">(</span><span class="pl-kos">)</span> <span class="pl-c1">=&gt;</span> <span class="pl-kos">{</span>
  <span class="pl-en">stripLiteral</span><span class="pl-kos">(</span><span class="pl-s1">code</span><span class="pl-kos">.</span><span class="pl-en">repeat</span><span class="pl-kos">(</span><span class="pl-c1">100</span><span class="pl-kos">)</span><span class="pl-kos">)</span><span class="pl-kos">;</span>
<span class="pl-kos">}</span><span class="pl-kos">)</span><span class="pl-kos">;</span></pre></div>
<p dir="auto">Also, no matter if I'm in a <code class="notranslate">_test.ts</code> or <code class="notranslate">_bench.ts</code> file I get</p>
<div class="snippet-clipboard-content notranslate position-relative overflow-auto" data-snippet-clipboard-copy-content="Property 'bench' does not exist on type 'typeof Deno'.deno-ts(2339)"><pre class="notranslate"><code class="notranslate">Property 'bench' does not exist on type 'typeof Deno'.deno-ts(2339)
</code></pre></div>
<p dir="auto">in VSCode even though the status bar at the bottom correctly show <code class="notranslate">Deno 1.23.0</code> and I've got <code class="notranslate">"deno.enable": true</code> in <code class="notranslate">.vscode/settings.json</code></p>
<p dir="auto">For reference I asked on <a href="https://discord.com/channels/684898665143206084/769285344809451572/989354182991556671" rel="nofollow">Discord</a> first if this should be supported</p>