Skip to content

Commit 7fe6bfc

Browse files
committed
Fix use of deprecated APIs
1 parent 5e9ce77 commit 7fe6bfc

File tree

7 files changed

+10
-10
lines changed

7 files changed

+10
-10
lines changed

libs/amcharts3/amcharts3.ml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -365,7 +365,7 @@ class type amCharts =
365365

366366
let amCharts() =
367367
let amCharts : amCharts Js.t =
368-
Js.Unsafe.variable "AmCharts"
368+
Js.Unsafe.global ##. _AmCharts
369369
in
370370
amCharts
371371

libs/amcharts3/amcharts3_bis.ml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -594,7 +594,7 @@ class type amCharts =
594594
end
595595

596596
let amCharts () =
597-
let amCharts : amCharts Js.t = Js.Unsafe.variable "AmCharts" in
597+
let amCharts : amCharts Js.t = Js.Unsafe.global ##. _AmCharts in
598598
amCharts
599599

600600
let export ?divId () =

libs/amcharts3/ammap3.ml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -122,7 +122,7 @@ class type amCharts =
122122

123123
let amCharts() =
124124
let amCharts : amCharts Js.t =
125-
Js.Unsafe.variable "AmCharts"
125+
Js.Unsafe.global ##. _AmCharts
126126
in
127127
amCharts
128128

libs/disqus/ezjs_disqus.ml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -23,7 +23,7 @@ let build_config ?(lang="en") ?title url identifier () =
2323
let title = match title with
2424
| None -> Printf.sprintf "Thread for %s" identifier
2525
| Some title -> title in
26-
let disqus : disqus Js.t = Js.Unsafe.variable "DISQUS" in
26+
let disqus : disqus Js.t = Js.Unsafe.global ##. _DISQUS in
2727
let page_config : page Js.t = Js.Unsafe.obj [||] in
2828
page_config##.identifier := Js.string identifier;
2929
page_config##.url := Js.string url;
@@ -42,7 +42,7 @@ let init ?lang ?title url identifier name =
4242
Dom.appendChild doc##.body s
4343

4444
let reset ?lang ?title url identifier =
45-
let disqus : disqus Js.t = Js.Unsafe.variable "DISQUS" in
45+
let disqus : disqus Js.t = Js.Unsafe.global ##. _DISQUS in
4646
let disqus_obj : disqus_reset Js.t = Js.Unsafe.obj [||] in
4747
disqus_obj##.reload := Js._true;
4848
disqus_obj##.config := build_config ?lang ?title url identifier;

libs/google_auth/ezjs_gauth.ml

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -212,13 +212,13 @@ type auth_response = {
212212
let verbose = ref false
213213
let set_verbose v = verbose := v
214214

215-
let gapi : gapi t optdef = Unsafe.variable "gapi"
215+
let gapi : gapi t optdef = Unsafe.global ##. gapi
216216

217217
let ready ?(none=fun () -> if !verbose then log_str "cannot find gapi")
218218
?(timeout=500.) (f : gapi t -> unit) =
219-
match Optdef.to_option (Unsafe.variable "gapi") with
219+
match Optdef.to_option (Unsafe.global ##. gapi) with
220220
| None ->
221-
let cb () = Optdef.case (Unsafe.variable "gapi") none f in
221+
let cb () = Optdef.case (Unsafe.global ##. gapi) none f in
222222
ignore @@ Dom_html.window##setTimeout (wrap_callback cb) timeout
223223
| Some gapi -> f gapi
224224

libs/utils/ezjs_tyxml.ml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -34,7 +34,7 @@ type 'a elt = 'a Html.elt
3434

3535
open Js
3636

37-
exception JsError = Error
37+
exception JsError = Js_error.Exn
3838
type ('a, 'b) result = ('a, 'b) Stdlib.result = Ok of 'a | Error of 'b
3939

4040
let doc = Dom_html.document

libs/utils/ezjs_tyxml.mli

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -34,7 +34,7 @@ type 'a elt = 'a Html.elt
3434

3535
open Js
3636

37-
exception JsError of error t
37+
exception JsError of Js_error.t
3838
type ('a, 'b) result = ('a, 'b) Stdlib.result = Ok of 'a | Error of 'b
3939

4040
val alert: string -> unit

0 commit comments

Comments
 (0)