<p dir="auto">Per <a href="https://discord.com/channels/684898665143206084/684898665151594506/963157330764107776" rel="nofollow">this convo</a>.</p>
<p dir="auto">When I perform the following (on <code class="notranslate">macos x86_64 v1.20.4</code>),</p>
<ol dir="auto">
<li>run <code class="notranslate">RUST_BACKTRACE=1 deno</code> to open a REPL, then</li>
<li>enter <code class="notranslate">console.log(String.fromCharCode(55296))</code> and press enter</li>
</ol>
<p dir="auto">deno panics and outputs the following backtrace:</p>
<div class="snippet-clipboard-content notranslate position-relative overflow-auto" data-snippet-clipboard-copy-content="thread 'main' panicked at 'called `Result::unwrap()` on an `Err` value: Error(&quot;unexpected end of hex escape&quot;, line: 1, column: 101)', /private/tmp/deno-20220406-92106-p4p5kp/deno/core/inspector.rs:724:66
stack backtrace:
   0: _rust_begin_unwind
   1: core::panicking::panic_fmt
   2: core::result::unwrap_failed
   3: core::result::Result&lt;T,E&gt;::unwrap
   4: &lt;core::future::from_generator::GenFuture&lt;T&gt; as core::future::future::Future&gt;::poll
   5: &lt;futures_util::future::select::Select&lt;A,B&gt; as core::future::future::Future&gt;::poll
   6: &lt;core::future::from_generator::GenFuture&lt;T&gt; as core::future::future::Future&gt;::poll
   7: &lt;core::future::from_generator::GenFuture&lt;T&gt; as core::future::future::Future&gt;::poll
   8: &lt;core::future::from_generator::GenFuture&lt;T&gt; as core::future::future::Future&gt;::poll
   9: &lt;core::future::from_generator::GenFuture&lt;T&gt; as core::future::future::Future&gt;::poll
  10: &lt;core::future::from_generator::GenFuture&lt;T&gt; as core::future::future::Future&gt;::poll
  11: deno::tools::repl::run::{{closure}}
  12: &lt;core::future::from_generator::GenFuture&lt;T&gt; as core::future::future::Future&gt;::poll
  13: deno::main::{{closure}}
  14: &lt;core::future::from_generator::GenFuture&lt;T&gt; as core::future::future::Future&gt;::poll
  15: deno_runtime::tokio_util::run_basic
  16: deno::main
note: Some details are omitted, run with `RUST_BACKTRACE=full` for a verbose backtrace."><pre class="notranslate"><code class="notranslate">thread 'main' panicked at 'called `Result::unwrap()` on an `Err` value: Error("unexpected end of hex escape", line: 1, column: 101)', /private/tmp/deno-20220406-92106-p4p5kp/deno/core/inspector.rs:724:66
stack backtrace:
   0: _rust_begin_unwind
   1: core::panicking::panic_fmt
   2: core::result::unwrap_failed
   3: core::result::Result&lt;T,E&gt;::unwrap
   4: &lt;core::future::from_generator::GenFuture&lt;T&gt; as core::future::future::Future&gt;::poll
   5: &lt;futures_util::future::select::Select&lt;A,B&gt; as core::future::future::Future&gt;::poll
   6: &lt;core::future::from_generator::GenFuture&lt;T&gt; as core::future::future::Future&gt;::poll
   7: &lt;core::future::from_generator::GenFuture&lt;T&gt; as core::future::future::Future&gt;::poll
   8: &lt;core::future::from_generator::GenFuture&lt;T&gt; as core::future::future::Future&gt;::poll
   9: &lt;core::future::from_generator::GenFuture&lt;T&gt; as core::future::future::Future&gt;::poll
  10: &lt;core::future::from_generator::GenFuture&lt;T&gt; as core::future::future::Future&gt;::poll
  11: deno::tools::repl::run::{{closure}}
  12: &lt;core::future::from_generator::GenFuture&lt;T&gt; as core::future::future::Future&gt;::poll
  13: deno::main::{{closure}}
  14: &lt;core::future::from_generator::GenFuture&lt;T&gt; as core::future::future::Future&gt;::poll
  15: deno_runtime::tokio_util::run_basic
  16: deno::main
note: Some details are omitted, run with `RUST_BACKTRACE=full` for a verbose backtrace.
</code></pre></div>
<p dir="auto">According to other folks on Discord, the same behavior happens for other architectures.</p>
<p dir="auto">Logging a string with an unpaired surrogate unit (<code class="notranslate">console.log("\uDE00")</code>) causes Deno to crash. Similarly, when an object contains such a string, logging it also causes a crash (<code class="notranslate">console.log({x:"\uDE00"})</code>)</p>
<p dir="auto">Note that <code class="notranslate">alert</code> and <code class="notranslate">Deno.core.print</code> do not crash in this situation</p>
<div class="snippet-clipboard-content notranslate position-relative overflow-auto" data-snippet-clipboard-copy-content="RUST_BACKTRACE=1 deno 
Deno 1.14.1
exit using ctrl+d or close()
&gt; console.log(&quot;\uDE00&quot;)
�
thread 'main' panicked at 'called `Result::unwrap()` on an `Err` value: Error(&quot;lone leading surrogate in hex escape&quot;, line: 1, column: 100)', /Users/ry/src/deno/core/inspector.rs:718:52
stack backtrace:
   0: _rust_begin_unwind
   1: core::panicking::panic_fmt
   2: core::result::unwrap_failed
   3: core::result::Result&lt;T,E&gt;::unwrap
   4: &lt;core::future::from_generator::GenFuture&lt;T&gt; as core::future::future::Future&gt;::poll
   5: &lt;core::future::from_generator::GenFuture&lt;T&gt; as core::future::future::Future&gt;::poll
   6: &lt;core::future::from_generator::GenFuture&lt;T&gt; as core::future::future::Future&gt;::poll
   7: &lt;core::future::from_generator::GenFuture&lt;T&gt; as core::future::future::Future&gt;::poll
   8: &lt;core::future::from_generator::GenFuture&lt;T&gt; as core::future::future::Future&gt;::poll
   9: &lt;core::future::from_generator::GenFuture&lt;T&gt; as core::future::future::Future&gt;::poll
  10: &lt;core::future::from_generator::GenFuture&lt;T&gt; as core::future::future::Future&gt;::poll
  11: deno::tools::repl::run::{{closure}}
  12: &lt;core::future::from_generator::GenFuture&lt;T&gt; as core::future::future::Future&gt;::poll
  13: &lt;core::future::from_generator::GenFuture&lt;T&gt; as core::future::future::Future&gt;::poll
  14: deno::main
note: Some details are omitted, run with `RUST_BACKTRACE=full` for a verbose backtrace."><pre class="notranslate"><code class="notranslate">RUST_BACKTRACE=1 deno 
Deno 1.14.1
exit using ctrl+d or close()
&gt; console.log("\uDE00")
�
thread 'main' panicked at 'called `Result::unwrap()` on an `Err` value: Error("lone leading surrogate in hex escape", line: 1, column: 100)', /Users/ry/src/deno/core/inspector.rs:718:52
stack backtrace:
   0: _rust_begin_unwind
   1: core::panicking::panic_fmt
   2: core::result::unwrap_failed
   3: core::result::Result&lt;T,E&gt;::unwrap
   4: &lt;core::future::from_generator::GenFuture&lt;T&gt; as core::future::future::Future&gt;::poll
   5: &lt;core::future::from_generator::GenFuture&lt;T&gt; as core::future::future::Future&gt;::poll
   6: &lt;core::future::from_generator::GenFuture&lt;T&gt; as core::future::future::Future&gt;::poll
   7: &lt;core::future::from_generator::GenFuture&lt;T&gt; as core::future::future::Future&gt;::poll
   8: &lt;core::future::from_generator::GenFuture&lt;T&gt; as core::future::future::Future&gt;::poll
   9: &lt;core::future::from_generator::GenFuture&lt;T&gt; as core::future::future::Future&gt;::poll
  10: &lt;core::future::from_generator::GenFuture&lt;T&gt; as core::future::future::Future&gt;::poll
  11: deno::tools::repl::run::{{closure}}
  12: &lt;core::future::from_generator::GenFuture&lt;T&gt; as core::future::future::Future&gt;::poll
  13: &lt;core::future::from_generator::GenFuture&lt;T&gt; as core::future::future::Future&gt;::poll
  14: deno::main
note: Some details are omitted, run with `RUST_BACKTRACE=full` for a verbose backtrace.
</code></pre></div>