napi-rs / node-rs

Node.js bindings ❤️ Rust crates
https://node-rs.dev
MIT License
1.04k stars 32 forks source link

External returns {}; #853

Open Elysian10 opened 5 days ago

Elysian10 commented 5 days ago

[napi]

fn create_source_map(length: u32) -> External { External::new(vec![0; length as usize].into()) } import { createSourceMap } from './index.js' const bufferExternal = createSourceMap(10); //returns {}, expected ExternalObject.

Arch Linix, vs code with CodeLLDB.

Brooooooklyn commented 5 days ago

@Elysian10 yes, the ExternalObject don't have a name in the JavaScript side, it's just a type name in .d.ts