1
0
Fork 0
mirror of https://github.com/denoland/deno.git synced 2024-11-29 16:30:56 -05:00
denoland-deno/cli/tests/integration
Kenta Moriuchi b2cd254c35
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 09:42:38 +05:30
..
bench_tests.rs chore: update copyright to 2024 (#21753) 2024-01-01 19:58:21 +00:00
bundle_tests.rs chore: update copyright to 2024 (#21753) 2024-01-01 19:58:21 +00:00
cache_tests.rs chore: update copyright to 2024 (#21753) 2024-01-01 19:58:21 +00:00
cert_tests.rs chore: update copyright to 2024 (#21753) 2024-01-01 19:58:21 +00:00
check_tests.rs fix(cli): respect exclude option for deno check command (#21779) 2024-01-03 20:43:17 -05:00
compile_tests.rs chore: update copyright to 2024 (#21753) 2024-01-01 19:58:21 +00:00
coverage_tests.rs chore: update copyright to 2024 (#21753) 2024-01-01 19:58:21 +00:00
doc_tests.rs chore: update copyright to 2024 (#21753) 2024-01-01 19:58:21 +00:00
eval_tests.rs chore: update copyright to 2024 (#21753) 2024-01-01 19:58:21 +00:00
flags_tests.rs chore: update copyright to 2024 (#21753) 2024-01-01 19:58:21 +00:00
fmt_tests.rs chore: update copyright to 2024 (#21753) 2024-01-01 19:58:21 +00:00
info_tests.rs chore: update copyright to 2024 (#21753) 2024-01-01 19:58:21 +00:00
init_tests.rs chore: update copyright to 2024 (#21753) 2024-01-01 19:58:21 +00:00
inspector_tests.rs chore: update copyright to 2024 (#21753) 2024-01-01 19:58:21 +00:00
install_tests.rs chore: update copyright to 2024 (#21753) 2024-01-01 19:58:21 +00:00
js_unit_tests.rs chore: increase unit test timeout to 3m (#21760) 2024-01-02 16:56:52 +01:00
jsr_tests.rs chore: update copyright to 2024 (#21753) 2024-01-01 19:58:21 +00:00
jupyter_tests.rs fix(jupyter): error message when install fails due to jupyter command not being on PATH (#21767) 2024-01-03 14:45:10 +00:00
lint_tests.rs chore: update copyright to 2024 (#21753) 2024-01-01 19:58:21 +00:00
lsp_tests.rs chore: ignore hanging lsp jsx test (#21771) 2024-01-03 04:47:59 +00:00
mod.rs fix(jupyter): error message when install fails due to jupyter command not being on PATH (#21767) 2024-01-03 14:45:10 +00:00
node_compat_tests.rs chore: update copyright to 2024 (#21753) 2024-01-01 19:58:21 +00:00
node_unit_tests.rs fix: strict type check for cross realms (#21669) 2024-01-04 09:42:38 +05:30
npm_tests.rs fix(unstable/byonm): support using an import map with byonm (#21786) 2024-01-04 09:20:58 +05:30
publish_tests.rs chore: update copyright to 2024 (#21753) 2024-01-01 19:58:21 +00:00
repl_tests.rs chore: update copyright to 2024 (#21753) 2024-01-01 19:58:21 +00:00
run_tests.rs fix(cli): harden permission stdio check (#21778) 2024-01-04 00:31:39 +01:00
shared_library_tests.rs chore: update copyright to 2024 (#21753) 2024-01-01 19:58:21 +00:00
task_tests.rs chore: update copyright to 2024 (#21753) 2024-01-01 19:58:21 +00:00
test_tests.rs chore: update copyright to 2024 (#21753) 2024-01-01 19:58:21 +00:00
upgrade_tests.rs chore: update copyright to 2024 (#21753) 2024-01-01 19:58:21 +00:00
vendor_tests.rs chore: update copyright to 2024 (#21753) 2024-01-01 19:58:21 +00:00
watcher_tests.rs chore: update copyright to 2024 (#21753) 2024-01-01 19:58:21 +00:00
worker_tests.rs chore: update copyright to 2024 (#21753) 2024-01-01 19:58:21 +00:00