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

@ -1798,9 +1798,7 @@ fn napi_is_detached_arraybuffer(
) -> Result {
let value = transmute::<napi_value, v8::Local<v8::Value>>(value);
let _ab = v8::Local::<v8::ArrayBuffer>::try_from(value).unwrap();
// TODO: what is API for checking if ArrayBuffer is detached?
// there's only is_detachable I could find.
*result = false;
*result = _ab.was_detached();
Ok(())
}