fix(napi): buffer finalizer is nullable (#30514)
Some checks are pending
ci / build libs (push) Blocked by required conditions
ci / publish canary (push) Blocked by required conditions
ci / test release windows-x86_64 (push) Blocked by required conditions
ci / test release macos-aarch64 (push) Blocked by required conditions
ci / bench release linux-x86_64 (push) Blocked by required conditions
ci / lint debug linux-x86_64 (push) Blocked by required conditions
ci / lint debug macos-x86_64 (push) Blocked by required conditions
ci / lint debug windows-x86_64 (push) Blocked by required conditions
ci / test debug linux-x86_64 (push) Blocked by required conditions
ci / test release linux-x86_64 (push) Blocked by required conditions
ci / test debug macos-x86_64 (push) Blocked by required conditions
ci / pre-build (push) Waiting to run
ci / test debug linux-aarch64 (push) Blocked by required conditions
ci / test release linux-aarch64 (push) Blocked by required conditions
ci / test debug macos-aarch64 (push) Blocked by required conditions
ci / test release macos-x86_64 (push) Blocked by required conditions
ci / test debug windows-x86_64 (push) Blocked by required conditions

Fixes: https://github.com/denoland/deno/issues/30512
This commit is contained in:
snek 2025-08-25 12:57:01 +02:00 committed by GitHub
parent 55f43d0373
commit 9450d0798f
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
5 changed files with 37 additions and 6 deletions

View file

@ -1,6 +1,7 @@
// Copyright 2018-2025 the Deno authors. MIT license.
import { assert, assertEquals, loadTestLibrary } from "./common.js";
import { Buffer } from "node:buffer";
const typedarray = loadTestLibrary();
@ -22,3 +23,8 @@ Deno.test("napi arraybuffer is detached", function () {
assert(!typedarray.is_detached(value));
});
});
Deno.test("napi buffer finalizer may be null", () => {
const buf = typedarray.test_static_external_buffer();
assertEquals(buf, Buffer.from([1, 2, 3]));
});