From 207dd8d111303f02b92d632ca00c165a657bc9c2 Mon Sep 17 00:00:00 2001 From: Marcos Casagrande Date: Sun, 30 Oct 2022 18:13:46 +0100 Subject: fix(napi): fix is_detached_arraybuffer (#16478) --- test_napi/arraybuffer_test.js | 12 ++++++++++++ 1 file changed, 12 insertions(+) create mode 100644 test_napi/arraybuffer_test.js (limited to 'test_napi/arraybuffer_test.js') diff --git a/test_napi/arraybuffer_test.js b/test_napi/arraybuffer_test.js new file mode 100644 index 000000000..577443e8b --- /dev/null +++ b/test_napi/arraybuffer_test.js @@ -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); +}); -- cgit v1.2.3