Repository: deno
Issue: Repl panic importing dependency that patches `globalThis`
Labels: bug,repl

Reproduce
- Version: Deno 2.0.3 (also on `1.46.3`)
- MacOS
- deno repl (normal run is different)
- no permissions should be needed

`deno`

```js
> import "https://raw.githubusercontent.com/jeff-hykin/xcc_deno/afced534b1004fe42a8f4153c7cb2d20e5f3891d/main/js_box/null_env.js"
```

```
============================================================
Deno has panicked. This is a bug in Deno. Please report this
at https://github.com/denoland/deno/issues/new.
If you can reliably reproduce this panic, include the
reproduction steps and re-run with the RUST_BACKTRACE=1 env
var set and include the backtrace in your report.

Platform: macos aarch64
Version: 2.0.3
Args: ["deno"]

thread 'main' panicked at cli/tools/repl/session.rs:596:39:
called `Option::unwrap()` on a `None` value
stack backtrace:
   0:        0x105d18190 - <std::sys::backtrace::BacktraceLock::print::DisplayBacktrace as core::fmt::Display>::fmt::h243268f17d714c7f
   1:        0x104dc6cec - core::fmt::write::hb3cfb8a30e72d7ff
   2:        0x105ce7554 - std::io::Write::write_fmt::hfb2314975de9ecf1
   3:        0x105d1a4f8 - std::panicking::default_hook::{{closure}}::h14c7718ccf39d316
   4:        0x105d1a04c - std::panicking::default_hook::hc62e60da3be2f352
   5:        0x104ce9550 - deno::setup_panic_hook::{{closure}}::h774b9d294b778323
   6:        0x105d1b424 - std::panicking::rust_panic_with_hook::h09e8a656f11e82b2
   7:        0x105d1ae64 - std::panicking::begin_panic_handler::{{closure}}::h1230eb3cc91b241c
   8:        0x105d1ae00 - std::sys::backtrace::__rust_end_short_backtrace::hc3491307aceda2c2
   9:        0x105d1adf4 - _rust_begin_unwind
  10:        0x104dc5214 - core::panicking::panic_fmt::ha4b80a05b9fff47a
  11:        0x104dc6a1c - core::panicking::panic::h298549a7412a7069
  12:        0x104dcd490 - core::option::unwrap_failed::hb7af631ec4f78cd6
  13:        0x104c9ce58 - deno::tools::repl::session::ReplSession::evaluate_line_and_get_output::{{closure}}::h6c711b3a662d08cd
  14:        0x104ca1820 - deno::tools::repl::run::{{closure}}::h2e1b282d66d40ba0
  15:        0x104ce32a8 - deno::spawn_subcommand::{{closure}}::h911ec47cd534adea
  16:        0x104900d6c - <deno_unsync::tokio::task::MaskFutureAsSend<F> as core::future::future::Future>::poll::hd1f6dc566a2d25e6
  17:        0x104a7c604 - tokio::runtime::task::raw::poll::h59ac22a2edfabe51
  18:        0x104cea7cc - deno::main::h253786e6e24501e6
  19:        0x1049a23fc - std::sys::backtrace::__rust_begin_short_backtrace::hbe6aa37289ae6a3a
  20:        0x104d401d8 - _main
```

## Major Notes:

1. Other import styles don't cause the issue. E.g. `import * as _ from "https://raw.githubusercontent.com/jeff-hykin/xcc_deno/afced534b1004fe42a8f4153c7cb2d20e5f3891d/main/js_box/null_env.js"` (no error, no problem)
2. `deno run <that import>` causes: `error: Uncaught ReferenceError: Event is not defined
    at dispatchLoadEvent (ext:runtime_main/js/99_main.js:425:33)`
3. ### The reason for this crash is *very very much in part because of the absolute cursed code that is being loaded*

`null_env.js` is sandboxing-code. It deletes almost everything from `globalThis`, including stuff like `Event`.

TLDR modifications/non-modifications:
globalThis prototype stays as-is (at least on this commit)
The following are what is left on globalThis after `enforceNullEnv()` is run:
```js
[
    "Object",
    "Function",
    "Array",
    "Number",
    "parseFloat",
    "parseInt",
    "Infinity",
    "NaN",
    "undefined",
    "Boolean",
    "String",
    "Symbol",
    "Promise",
    "RegExp",
    "Error",
    "globalThis",
    "JSON",
    "Math",
    "Map",
    "Set",
    "Reflect",
    "escape",
    "unescape",
    "eval",
    "isFinite",
    "isNaN",
    "atob",
    "btoa",
    "structuredClone",
    "__DENO_REPL_INTERNALS_1730117269__",
    "setTimeout",      // NOTE: shimmed (should be unnoticeable)
    "setInterval",     // NOTE: shimmed (should be unnoticeable)
    "clearInterval",   // NOTE: shimmed (should be unnoticeable) 
    "clearTimeout",    // NOTE: shimmed (should be unnoticeable)
    "Date",            // NOTE: shimmed BUT VERY NOTICEABLE (only .getTime() is a method)
    "performance",     // NOTE: shimmed VERY NOTICEABLE (has all methods but only .now() matches expected behavior)
    "Performance",     // NOTE: shimmed probably very noticeable
    "PerformanceMark", // NOTE: shimmed probably very noticeable
    "postMessage",
    Symbol("[[webidl.brand]]"),
    Symbol()
]
```