diff options
author | Divy Srivastava <dj.srivastava23@gmail.com> | 2024-04-13 17:02:07 +0530 |
---|---|---|
committer | GitHub <noreply@github.com> | 2024-04-13 17:02:07 +0530 |
commit | 402d59eea99481af30c2aa0aff19d90a4ce9ced3 (patch) | |
tree | f332fecf63f352c89a292ac1366f3a2c8897b37a /tests | |
parent | 720e45d25b5817094034acef4209dccbb1808d09 (diff) |
fix(ext/node): promise rejection in VM contexts (#23305)
Fixes https://github.com/denoland/deno/issues/23297
`docusaurus build` works!
```
$ deno run -A repro.js
fish: Job 1, 'deno run -A ../../littledivy/fs…' terminated by signal SIGSEGV (Address
boundary error)
$ denod run -A repro.js
error: Uncaught (in promise) Error: rejected
```
Depends on https://github.com/denoland/deno_core/pull/693
Diffstat (limited to 'tests')
-rw-r--r-- | tests/unit_node/vm_test.ts | 16 |
1 files changed, 16 insertions, 0 deletions
diff --git a/tests/unit_node/vm_test.ts b/tests/unit_node/vm_test.ts index b557350ad..21e56ee94 100644 --- a/tests/unit_node/vm_test.ts +++ b/tests/unit_node/vm_test.ts @@ -132,3 +132,19 @@ Deno.test({ assertEquals(isContext(sandbox), false); }, }); + +// https://github.com/denoland/deno/issues/23297 +Deno.test({ + name: "vm context promise rejection", + fn() { + const code = ` +function reject() { + return Promise.reject(new Error('rejected')); +} +reject().catch(() => {}) + `; + + const script = new Script(code); + script.runInNewContext(); + }, +}); |