diff options
Diffstat (limited to 'ext/ffi/00_ffi.js')
-rw-r--r-- | ext/ffi/00_ffi.js | 14 |
1 files changed, 10 insertions, 4 deletions
diff --git a/ext/ffi/00_ffi.js b/ext/ffi/00_ffi.js index 1b340a766..2dc6bb5e0 100644 --- a/ext/ffi/00_ffi.js +++ b/ext/ffi/00_ffi.js @@ -6,18 +6,20 @@ const ops = core.ops; const __bootstrap = window.__bootstrap; const { - ObjectDefineProperty, ArrayPrototypeMap, - Number, - NumberIsSafeInteger, ArrayPrototypeJoin, + ObjectDefineProperty, + ObjectPrototypeHasOwnProperty, ObjectPrototypeIsPrototypeOf, + Number, + NumberIsSafeInteger, TypeError, Int32Array, Uint32Array, BigInt64Array, BigUint64Array, Function, + ReflectHas, } = window.__bootstrap.primordials; const U32_BUFFER = new Uint32Array(2); @@ -273,7 +275,11 @@ constructor(path, symbols) { [this.#rid, this.symbols] = ops.op_ffi_load({ path, symbols }); for (const symbol in symbols) { - if ("type" in symbols[symbol]) { + if (!ObjectPrototypeHasOwnProperty(symbols, symbol)) { + continue; + } + + if (ReflectHas(symbols[symbol], "type")) { const type = symbols[symbol].type; if (type === "void") { throw new TypeError( |