From f75d7eb11496d6c2cec2a5d3eca1feffebabc6f9 Mon Sep 17 00:00:00 2001 From: Delyan Angelov Date: Thu, 21 Jul 2022 23:08:18 +0300 Subject: [PATCH] ci: fix `v build-examples` (use voidptr(u64(0)) inside vlib/js/dom/dom.js.v) --- vlib/js/dom/dom.js.v | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/vlib/js/dom/dom.js.v b/vlib/js/dom/dom.js.v index 8eff70149..d361a9b15 100644 --- a/vlib/js/dom/dom.js.v +++ b/vlib/js/dom/dom.js.v @@ -343,7 +343,7 @@ pub const ( ) pub fn window() JS.Window { - mut x := JS.Any(unsafe { nil }) + mut x := JS.Any(unsafe { voidptr(u64(0)) }) #x = window; return x @@ -359,7 +359,7 @@ pub type EventCallback = fn (JS.Event) // that is EventTarget. When you need access only to Event itself you can just use `fn (JS.Event)` as listener. pub fn event_listener(callback fn (JS.EventTarget, JS.Event)) EventCallback { return fn [callback] (event JS.Event) { - mut target := JS.EventTarget(unsafe { nil }) + mut target := JS.EventTarget(unsafe { voidptr(u64(0)) }) #target = this; callback(target, event) } @@ -490,7 +490,7 @@ pub type OnDeviceOrientation = fn (ev JS.DeviceOrientationEvent) JS.Any pub fn on_device_motion(cb fn (win JS.Window, ev JS.DeviceMotionEvent) JS.Any) OnDeviceMotion { clos := fn [cb] (ev JS.DeviceMotionEvent) JS.Any { - mut win := JS.Any(unsafe { nil }) + mut win := JS.Any(unsafe { voidptr(u64(0)) }) #win = this; return cb(win, ev) @@ -500,7 +500,7 @@ pub fn on_device_motion(cb fn (win JS.Window, ev JS.DeviceMotionEvent) JS.Any) O pub fn on_device_orientation(cb fn (win JS.Window, ev JS.DeviceOrientationEvent) JS.Any) OnDeviceOrientation { clos := fn [cb] (ev JS.DeviceOrientationEvent) JS.Any { - mut win := JS.Any(unsafe { nil }) + mut win := JS.Any(unsafe { voidptr(u64(0)) }) #win = this; return cb(win, ev) @@ -837,7 +837,7 @@ pub fn event_type(ev JS.Event) string { } pub fn create_event(typ string, bubbles bool, cancelable bool, composed bool) JS.Event { - mut ev := JS.Event(unsafe { nil }) + mut ev := JS.Event(unsafe { voidptr(u64(0)) }) #ev = new Event(typ.str,bubbles.val,cancelable.val,composed.val); return ev -- 2.30.2