Skip to content

Commit f6f6274

Browse files
author
Aaron Huggins
authored
fix: bind function stopped working on Deno 1.31+ (#153)
1 parent 9c3bff6 commit f6f6274

File tree

2 files changed

+8
-3
lines changed

2 files changed

+8
-3
lines changed

deps.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1 +1 @@
1-
export { dlopen, download } from "https://deno.land/x/plug@1.0.0-rc.3/mod.ts";
1+
export { dlopen, download } from "https://deno.land/x/plug@1.0.2/mod.ts";

src/webview.ts

Lines changed: 7 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,4 @@
1+
/// <reference lib="deno.unstable" />
12
import { encodeCString, instances, lib } from "./ffi.ts";
23

34
/** Window size hints */
@@ -266,8 +267,12 @@ export class Webview {
266267
reqPtr: Deno.PointerValue,
267268
arg: Deno.PointerValue | null,
268269
) => {
269-
const seq = new Deno.UnsafePointerView(BigInt(seqPtr)).getCString();
270-
const req = new Deno.UnsafePointerView(BigInt(reqPtr)).getCString();
270+
const seq = seqPtr
271+
? new Deno.UnsafePointerView(seqPtr).getCString()
272+
: "";
273+
const req = reqPtr
274+
? new Deno.UnsafePointerView(reqPtr).getCString()
275+
: "";
271276
callback(seq, req, arg);
272277
},
273278
);

0 commit comments

Comments
 (0)