-
-
Notifications
You must be signed in to change notification settings - Fork 362
Closed
Description
Test Case:
File: lib.rs
#![deny(clippy::all)]
#[macro_use]
extern crate napi_derive;
use napi::bindgen_prelude::*;
#[napi]
pub struct Test {}
#[napi]
impl Test {
#[napi(constructor)]
pub fn new() -> Result<Self> {
Ok(Self {})
}
#[napi]
pub async fn hello(&self) -> Result<()> {
Err(napi::Error::from_reason("world"))
}
}
impl Drop for Test {
fn drop(&mut self) {
println!("Test Dropped");
}
}File: test.js
const { Test } = require("./index.js");
const { setFlagsFromString } = require("v8");
const { runInNewContext } = require("vm");
let gc = global.gc;
if (!gc) {
setFlagsFromString("--expose_gc");
try {
gc = runInNewContext("gc");
} catch (_) {
gc = () => {};
}
}
async function test() {
gc();
let test = new Test();
try {
let result = await test.hello();
} catch (err) {
console.log(err.message);
}
}
setInterval(test, 1000);Result, Missing 'Test Dropped':
world
world
world
world
world
world
Chrome Inspector:
Is it possible that I'm not using it correctly?
Reactions are currently unavailable
Metadata
Metadata
Assignees
Labels
No labels
