1
0
Fork 0
mirror of https://github.com/denoland/deno.git synced 2024-11-28 16:20:57 -05:00
denoland-deno/cli
Kenta Moriuchi ab60d9e6a3
fix: strict type check for cross realms (#21669)
Deno v1.39 introduces `vm.runInNewContext`. This may cause problems when
using `Object.prototype.isPrototypeOf` to check built-in types.

```js
import vm from "node:vm";

const err = new Error();
const crossErr = vm.runInNewContext(`new Error()`);

console.assert( !(crossErr instanceof Error) );
console.assert( Object.getPrototypeOf(err) !== Object.getPrototypeOf(crossErr) );
```

This PR changes to check using internal slots solves them.

---

current: 

```
> import vm from "node:vm";
undefined
> vm.runInNewContext(`new Error("message")`)
Error {}
> vm.runInNewContext(`new Date("2018-12-10T02:26:59.002Z")`)
Date {}
```

this PR:

```
> import vm from "node:vm";
undefined
> vm.runInNewContext(`new Error("message")`)
Error: message
    at <anonymous>:1:1
> vm.runInNewContext(`new Date("2018-12-10T02:26:59.002Z")`)
2018-12-10T02:26:59.002Z
```

---------

Co-authored-by: Bartek Iwańczuk <biwanczuk@gmail.com>
2024-01-04 20:34:55 +01:00
..
args fix(cli): respect exclude option for deno check command (#21779) 2024-01-04 20:34:55 +01:00
bench chore: update copyright to 2024 (#21753) 2024-01-04 20:34:51 +01:00
cache chore: update to Rust 1.75 (#21731) 2024-01-04 20:34:52 +01:00
js fix: strict type check for cross realms (#21669) 2024-01-04 20:34:55 +01:00
lsp fix(lsp): support test code lens for Deno.test.{ignore,only}() (#21775) 2024-01-04 20:34:54 +01:00
napi chore: update copyright to 2024 (#21753) 2024-01-04 20:34:51 +01:00
npm chore: update copyright to 2024 (#21753) 2024-01-04 20:34:51 +01:00
ops chore: update copyright to 2024 (#21753) 2024-01-04 20:34:51 +01:00
schemas feat: precompile JSX (#20962) 2023-11-01 20:30:23 +00:00
standalone chore: upgrade deno_core to 0.241.0 (#21765) 2024-01-04 20:34:53 +01:00
tests fix: strict type check for cross realms (#21669) 2024-01-04 20:34:55 +01:00
tools fix(jupyter): error message when install fails due to jupyter command not being on PATH (#21767) 2024-01-04 20:34:54 +01:00
tsc chore: update to Rust 1.75 (#21731) 2024-01-04 20:34:52 +01:00
util chore: update copyright to 2024 (#21753) 2024-01-04 20:34:51 +01:00
auth_tokens.rs chore: update copyright to 2024 (#21753) 2024-01-04 20:34:51 +01:00
build.rs chore: update copyright to 2024 (#21753) 2024-01-04 20:34:51 +01:00
Cargo.toml Revert "fix(runtime): Make native modal keyboard interaction consistent with browsers" (#21739) 2024-01-04 20:34:52 +01:00
cdp.rs chore: update copyright to 2024 (#21753) 2024-01-04 20:34:51 +01:00
deno.ico fix(cli): add icon and metadata to deno.exe on Windows (#6693) 2020-07-15 21:54:38 +02:00
deno_std.rs chore: update copyright to 2024 (#21753) 2024-01-04 20:34:51 +01:00
emit.rs chore: update copyright to 2024 (#21753) 2024-01-04 20:34:51 +01:00
entitlements.plist chore: start codesigning mac release builds (#21303) 2023-11-23 15:30:26 -07:00
errors.rs chore: update copyright to 2024 (#21753) 2024-01-04 20:34:51 +01:00
factory.rs chore: update copyright to 2024 (#21753) 2024-01-04 20:34:51 +01:00
file_fetcher.rs chore: update copyright to 2024 (#21753) 2024-01-04 20:34:51 +01:00
graph_util.rs chore: update copyright to 2024 (#21753) 2024-01-04 20:34:51 +01:00
http_util.rs chore: update copyright to 2024 (#21753) 2024-01-04 20:34:51 +01:00
js.rs chore: update copyright to 2024 (#21753) 2024-01-04 20:34:51 +01:00
main.rs chore: update copyright to 2024 (#21753) 2024-01-04 20:34:51 +01:00
module_loader.rs fix(cli): respect exclude option for deno check command (#21779) 2024-01-04 20:34:55 +01:00
node.rs chore: update copyright to 2024 (#21753) 2024-01-04 20:34:51 +01:00
README.md docs(cli): do not need gen doc for cli (#17260) 2023-01-04 13:19:58 +01:00
resolver.rs fix(unstable/byonm): support using an import map with byonm (#21786) 2024-01-04 20:34:55 +01:00
version.rs chore: update copyright to 2024 (#21753) 2024-01-04 20:34:51 +01:00
worker.rs chore: update copyright to 2024 (#21753) 2024-01-04 20:34:51 +01:00

Deno CLI Crate

crates

This provides the actual deno executable and the user-facing APIs.

The deno crate uses the deno_core to provide the executable.