1
0
Fork 0
mirror of https://github.com/denoland/deno.git synced 2024-12-13 19:12:20 -05:00
denoland-deno/cli/tests/integration
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
..
bench_tests.rs chore: update copyright to 2024 (#21753) 2024-01-04 20:34:51 +01:00
bundle_tests.rs chore: update copyright to 2024 (#21753) 2024-01-04 20:34:51 +01:00
cache_tests.rs chore: update copyright to 2024 (#21753) 2024-01-04 20:34:51 +01:00
cert_tests.rs chore: update copyright to 2024 (#21753) 2024-01-04 20:34:51 +01:00
check_tests.rs fix(cli): respect exclude option for deno check command (#21779) 2024-01-04 20:34:55 +01:00
compile_tests.rs chore: update copyright to 2024 (#21753) 2024-01-04 20:34:51 +01:00
coverage_tests.rs chore: update copyright to 2024 (#21753) 2024-01-04 20:34:51 +01:00
doc_tests.rs chore: update copyright to 2024 (#21753) 2024-01-04 20:34:51 +01:00
eval_tests.rs chore: update copyright to 2024 (#21753) 2024-01-04 20:34:51 +01:00
flags_tests.rs chore: update copyright to 2024 (#21753) 2024-01-04 20:34:51 +01:00
fmt_tests.rs chore: update copyright to 2024 (#21753) 2024-01-04 20:34:51 +01:00
info_tests.rs chore: update copyright to 2024 (#21753) 2024-01-04 20:34:51 +01:00
init_tests.rs chore: update copyright to 2024 (#21753) 2024-01-04 20:34:51 +01:00
inspector_tests.rs chore: update copyright to 2024 (#21753) 2024-01-04 20:34:51 +01:00
install_tests.rs chore: update copyright to 2024 (#21753) 2024-01-04 20:34:51 +01:00
js_unit_tests.rs chore: increase unit test timeout to 3m (#21760) 2024-01-04 20:34:53 +01:00
jsr_tests.rs chore: update copyright to 2024 (#21753) 2024-01-04 20:34:51 +01:00
jupyter_tests.rs fix(jupyter): error message when install fails due to jupyter command not being on PATH (#21767) 2024-01-04 20:34:54 +01:00
lint_tests.rs chore: update copyright to 2024 (#21753) 2024-01-04 20:34:51 +01:00
lsp_tests.rs chore: ignore hanging lsp jsx test (#21771) 2024-01-04 20:34:53 +01:00
mod.rs fix(jupyter): error message when install fails due to jupyter command not being on PATH (#21767) 2024-01-04 20:34:54 +01:00
node_compat_tests.rs chore: update copyright to 2024 (#21753) 2024-01-04 20:34:51 +01:00
node_unit_tests.rs fix: strict type check for cross realms (#21669) 2024-01-04 20:34:55 +01:00
npm_tests.rs fix(unstable/byonm): support using an import map with byonm (#21786) 2024-01-04 20:34:55 +01:00
publish_tests.rs chore: update copyright to 2024 (#21753) 2024-01-04 20:34:51 +01:00
repl_tests.rs chore: update copyright to 2024 (#21753) 2024-01-04 20:34:51 +01:00
run_tests.rs fix(cli): harden permission stdio check (#21778) 2024-01-04 20:34:54 +01:00
shared_library_tests.rs chore: update copyright to 2024 (#21753) 2024-01-04 20:34:51 +01:00
task_tests.rs chore: update copyright to 2024 (#21753) 2024-01-04 20:34:51 +01:00
test_tests.rs chore: update copyright to 2024 (#21753) 2024-01-04 20:34:51 +01:00
upgrade_tests.rs chore: update copyright to 2024 (#21753) 2024-01-04 20:34:51 +01:00
vendor_tests.rs chore: update copyright to 2024 (#21753) 2024-01-04 20:34:51 +01:00
watcher_tests.rs chore: update copyright to 2024 (#21753) 2024-01-04 20:34:51 +01:00
worker_tests.rs chore: update copyright to 2024 (#21753) 2024-01-04 20:34:51 +01:00