diff options
| author | Bartek IwaĆczuk <biwanczuk@gmail.com> | 2022-01-27 16:27:22 +0100 |
|---|---|---|
| committer | GitHub <noreply@github.com> | 2022-01-27 16:27:22 +0100 |
| commit | f248e6f1778dc26db91d3322de2ecca5d1aa9866 (patch) | |
| tree | 46b1ff59091cc8d31ff67427173d3a0148734007 /ext/ffi | |
| parent | 382a978859a7a7a4351542be818bb2e59523429c (diff) | |
Revert "refactor: update runtime code for primordial checks for "instanceof" (#13497)" (#13511)
This reverts commit 884143218fad0e18f7553aaf079d52de703f7601.
Diffstat (limited to 'ext/ffi')
| -rw-r--r-- | ext/ffi/00_ffi.js | 8 |
1 files changed, 3 insertions, 5 deletions
diff --git a/ext/ffi/00_ffi.js b/ext/ffi/00_ffi.js index b979c73d4..abe806cc0 100644 --- a/ext/ffi/00_ffi.js +++ b/ext/ffi/00_ffi.js @@ -5,11 +5,10 @@ const core = window.Deno.core; const __bootstrap = window.__bootstrap; const { - ArrayBufferPrototype, + ArrayBuffer, Uint8Array, BigInt, Number, - ObjectPrototypeIsPrototypeOf, TypeError, } = window.__bootstrap.primordials; @@ -142,7 +141,6 @@ return this.value; } } - const UnsafePointerPrototype = UnsafePointer.prototype; function prepareArgs(types, args) { const parameters = []; @@ -154,12 +152,12 @@ if (type === "pointer") { if ( - ObjectPrototypeIsPrototypeOf(ArrayBufferPrototype, arg?.buffer) && + arg?.buffer instanceof ArrayBuffer && arg.byteLength !== undefined ) { parameters.push(buffers.length); buffers.push(arg); - } else if (ObjectPrototypeIsPrototypeOf(UnsafePointerPrototype, arg)) { + } else if (arg instanceof UnsafePointer) { parameters.push(packU64(arg.value)); buffers.push(undefined); } else if (arg === null) { |
