fix(napi): fix is_detached_arraybuffer (#16478)

This commit is contained in:
Marcos Casagrande 2022-10-30 18:13:46 +01:00 committed by GitHub
parent 59ac110edd
commit 207dd8d111
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
5 changed files with 52 additions and 4 deletions

View file

@ -0,0 +1,12 @@
// Copyright 2018-2022 the Deno authors. All rights reserved. MIT license.
import { assertEquals, loadTestLibrary } from "./common.js";
const typedarray = loadTestLibrary();
Deno.test("napi arraybuffer detach", function () {
const buf = new ArrayBuffer(5);
assertEquals(buf.byteLength, 5);
typedarray.test_detached(buf);
assertEquals(buf.byteLength, 0);
});