diff options
author | Matt Mastracci <matthew@mastracci.com> | 2023-12-18 08:48:52 -0700 |
---|---|---|
committer | GitHub <noreply@github.com> | 2023-12-18 08:48:52 -0700 |
commit | d51fda9e145e1481b5f0c27647c4b2d189074de6 (patch) | |
tree | 07ee5669bb9a4b4e53a9f2b2a975796aa906c816 /ext/node/polyfills/internal/console/constructor.mjs | |
parent | 6b482d73921c12ca3e75fc17c06c211d14e34ea6 (diff) |
fix(ext/napi): don't close handle scopes in NAPI as the pointers are invalid (#21629)
`napi_open_handle_scope` was returning a bogus handle_scope and we were
trying to close it in `napi_close_handle_scope`.
This is a bit of a challenge to test, but the following testcase comes
from #21601 and appears to be fixed by this.
```
import { decode } from "https://deno.land/std@0.209.0/encoding/base64.ts";
import sharp from "npm:sharp";
const img = 'iVBORw0KGgoAAAANSUhEUgAAAQAAAAEAAQMAAABmvDolAAAAA1BMVEWq09/P7Lz1AAAAH0lEQVRoge3BAQ0AAADCoPdPbQ43oAAAAAAAAAAAvg0hAAABmmDh1QAAAABJRU5ErkJggg==';
Deno.test("async", async () => {
const id = setTimeout(() => Deno.exit(1), 1000);
await sharp(decode(img)).toBuffer();
await sharp(decode(img)).toBuffer();
clearTimeout(id);
});
```
Diffstat (limited to 'ext/node/polyfills/internal/console/constructor.mjs')
0 files changed, 0 insertions, 0 deletions