Skip to content

Commit 9d25750

Browse files
committed
console
1 parent 3ab3b05 commit 9d25750

File tree

18 files changed

+56
-54
lines changed

18 files changed

+56
-54
lines changed

examples/graph_viewer/viewer_common.ml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -252,7 +252,7 @@ Format.eprintf "REDRAW %d %d %d %d@." x' y' w h;
252252
let dx = pm.valid_rect.x - x0 in
253253
let dy = pm.valid_rect.y - y0 in
254254
(*
255-
Firebug.console##log_6 (dx, pm.valid_rect.width, a.width,
255+
Console.console##log_6 (dx, pm.valid_rect.width, a.width,
256256
dy, pm.valid_rect.height, a.height);
257257
*)
258258
if

examples/graph_viewer/viewer_js.ml

Lines changed: 14 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -304,18 +304,18 @@ let start () =
304304
if not !started then p##.style##.display := Js.string "inline";
305305
Lwt.return ());
306306
(*
307-
Firebug.console##time(Js.string "loading");
307+
Console.console##time(Js.string "loading");
308308
*)
309309
getfile "scene.json"
310310
>>= fun s ->
311311
(*
312-
Firebug.console##timeEnd(Js.string "loading");
313-
Firebug.console##time(Js.string "parsing");
312+
Console.console##timeEnd(Js.string "loading");
313+
Console.console##time(Js.string "parsing");
314314
*)
315315
let (x1, y1, x2, y2), bboxes, scene = of_json ~typ:[%json: scene] s in
316316
(*
317-
Firebug.console##timeEnd(Js.string "parsing");
318-
Firebug.console##time(Js.string "init");
317+
Console.console##timeEnd(Js.string "parsing");
318+
Console.console##time(Js.string "init");
319319
*)
320320
started := true;
321321
Dom.removeChild doc##.body p;
@@ -350,7 +350,7 @@ let start () =
350350
let redraw_queued = ref false in
351351
let update_view _force =
352352
(*
353-
Firebug.console##log_2(Js.string "update", Js.date##now());
353+
Console.console##log_2(Js.string "update", Js.date##now());
354354
*)
355355
let a = allocation () in
356356
let scale = get_scale () in
@@ -389,7 +389,7 @@ Firebug.console##log_2(Js.string "update", Js.date##now());
389389
if not !redraw_queued then
390390
ignore (redraw_queued := true;
391391
(*
392-
Firebug.console##log(Js.string "sleep");
392+
Console.console##log(Js.string "sleep");
393393
*)
394394
Lwt_js.yield() >>= fun () ->
395395
redraw_queued := false;
@@ -502,15 +502,15 @@ Firebug.console##log(Js.string "sleep");
502502
(*
503503
Html.addEventListener Html.document Html.Event.keydown
504504
(Html.handler
505-
(fun e -> Firebug.console##log(e##keyCode);
505+
(fun e -> Console.console##log(e##keyCode);
506506
Js._true))
507507
Js._true;
508508
*)
509509
(*
510510
Html.addEventListener Html.document Html.Event.keypress
511511
(Html.handler
512512
(fun e ->
513-
Firebug.console##log(Js.string "press");
513+
Console.console##log(Js.string "press");
514514
match e##keyCode with
515515
| 37 -> (* left *)
516516
Js._false
@@ -521,7 +521,7 @@ Firebug.console##log(Js.string "sleep");
521521
| 40 -> (* down *)
522522
Js._false
523523
| _ ->
524-
Firebug.console##log(- 1- e##keyCode);
524+
Console.console##log(- 1- e##keyCode);
525525
Js._true))
526526
Js._true;
527527
*)
@@ -549,7 +549,7 @@ Firebug.console##log(Js.string "sleep");
549549
Js._false
550550
| _ ->
551551
(*
552-
Firebug.console##log_2(Js.string "keycode:", ev##keyCode);
552+
Console.console##log_2(Js.string "keycode:", ev##keyCode);
553553
*)
554554
Js._true
555555
in
@@ -564,12 +564,12 @@ Firebug.console##log(Js.string "sleep");
564564
ignored_keycode := -1;
565565
if e##.keyCode = k then Js._true else handle_key_event e);
566566
(*
567-
Firebug.console##time(Js.string "initial drawing");
567+
Console.console##time(Js.string "initial drawing");
568568
*)
569569
update_view true;
570570
(*
571-
Firebug.console##timeEnd(Js.string "initial drawing");
572-
Firebug.console##timeEnd(Js.string "init");
571+
Console.console##timeEnd(Js.string "initial drawing");
572+
Console.console##timeEnd(Js.string "init");
573573
*)
574574
Lwt.return ()
575575

examples/hyperbolic/hypertree.ml

Lines changed: 8 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -547,7 +547,7 @@ let language =
547547
(Html.window##.localStorage##getItem (Js.string "hyp_lang"))
548548
default_language)
549549

550-
let _ = Firebug.console##log !language
550+
let _ = Console.console##log !language
551551

552552
let set_language lang =
553553
Html.window##.localStorage##setItem (Js.string "hyp_lang") lang;
@@ -643,7 +643,7 @@ type boxes =
643643
let shadow = false
644644

645645
let draw canvas vertices edges nodes boxes =
646-
Firebug.console##time (Js.string "draw");
646+
Console.console##time (Js.string "draw");
647647
let c = canvas##getContext Html._2d_ in
648648
let ((rx, ry, dx, dy) as transf) = screen_transform canvas in
649649
c##clearRect
@@ -795,8 +795,8 @@ let draw canvas vertices edges nodes boxes =
795795
(Js.float (2. *. h))
796796
| `Txt (_, None, _) | `None -> ()
797797
done;
798-
Firebug.console##timeEnd (Js.string "draw");
799-
Firebug.console##log_2 !image_count !large_image_count
798+
Console.console##timeEnd (Js.string "draw");
799+
Console.console##log_2 !image_count !large_image_count
800800

801801
let tree_url = "tree.json"
802802

@@ -1239,7 +1239,7 @@ let show_image all_messages image_info name small_image =
12391239
if !i >= 0
12401240
then (
12411241
let info = image_info.(!i) in
1242-
Firebug.console##log_2 name !i;
1242+
Console.console##log_2 name !i;
12431243
let d = Html.document in
12441244
let container = Html.createDiv d in
12451245
container##.style##.margin := Js.string "10px";
@@ -1582,7 +1582,7 @@ let start _ =
15821582
(redraw_funct :=
15831583
fun () ->
15841584
need_redraw := false;
1585-
Firebug.console##time (Js.string "transform");
1585+
Console.console##time (Js.string "transform");
15861586
(*
15871587
let transf = hyp_transf !tr' in
15881588
for i = 0 to Array.length vertices - 1 do
@@ -1596,7 +1596,7 @@ let start _ =
15961596
canvas##.width := w;
15971597
canvas##.height := h);
15981598
hyp_transf_vect !tr' vertices vertices';
1599-
Firebug.console##timeEnd (Js.string "transform");
1599+
Console.console##timeEnd (Js.string "transform");
16001600
draw canvas vertices' edges nodes boxes);
16011601
perform_redraw ();
16021602
Html.window##.onresize :=
@@ -1692,7 +1692,7 @@ debug_msg (Format.sprintf "Resize %d %d" w h);
16921692
handle_touch_events
16931693
canvas
16941694
(fun x0 y0 x1 y1 ->
1695-
Firebug.console##time (Js.string "transform");
1695+
Console.console##time (Js.string "transform");
16961696
let z0 = from_screen canvas x0 y0 in
16971697
let z1 = from_screen canvas x1 y1 in
16981698
(*

examples/test_wheel/test_wheel.ml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,7 @@ let () =
1313
in
1414
html##.onwheel :=
1515
Dom.handler (fun (event : Dom_html.mousewheelEvent Js.t) ->
16-
Firebug.console##debug event;
16+
Console.console##debug event;
1717
let deltaX = event##.deltaX in
1818
let deltaY = event##.deltaY in
1919
let deltaZ = event##.deltaZ in

examples/webgl/webgldemo.ml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -24,11 +24,11 @@ open Js
2424
let error f =
2525
Printf.ksprintf
2626
(fun s ->
27-
Firebug.console##error (Js.string s);
27+
Console.console##error (Js.string s);
2828
failwith s)
2929
f
3030

31-
let debug f = Printf.ksprintf (fun s -> Firebug.console##log (Js.string s)) f
31+
let debug f = Printf.ksprintf (fun s -> Console.console##log (Js.string s)) f
3232

3333
let alert f =
3434
Printf.ksprintf
File renamed without changes.

lib/js_of_ocaml/firebug.mli renamed to lib/js_of_ocaml/console.mli

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -18,9 +18,9 @@
1818
* Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
1919
*)
2020

21-
(** Firebug API (debugging console).
21+
(** Console API (debugging console).
2222
23-
The Firebug console API
23+
The console API
2424
*)
2525

2626
open Js

lib/js_of_ocaml/geolocation.mli

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -28,12 +28,12 @@
2828
let f_success pos =
2929
let coords = pos##.coords in
3030
let latitude = coords##.latitude in
31-
Firebug.console##debug latitude ;
31+
Console.console##debug latitude ;
3232
in
3333
let f_error err =
3434
let code = err##.code in
3535
let msg = err##.message in
36-
if code = err##._TIMEOUT then Firebug.console##debug(msg)
36+
if code = err##._TIMEOUT then Console.console##debug(msg)
3737
in
3838
geo##getCurrentPosition (Js.wrap_callback f_success) (Js.wrap_callback f_error) options
3939
]}

lib/js_of_ocaml/intl.mli

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -24,7 +24,7 @@
2424
2525
open Js ;;
2626
27-
let fc v = Firebug.console##debug v in
27+
let fc v = Console.console##debug v in
2828
2929
let jas a = array(Array.map (fun v -> string v) a) in
3030
@@ -410,10 +410,10 @@ if (Intl.is_supported()) then (
410410
) ;
411411
412412
with
413-
| Error err -> Firebug.console##debug (
413+
| Error err -> Console.console##debug (
414414
string (string_of_error err)) ;
415415
) else (
416-
Firebug.console##debug (string "Intl is not supported!") ;
416+
Console.console##debug (string "Intl is not supported!") ;
417417
)
418418
419419
]}

lib/js_of_ocaml/js_of_ocaml.ml

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -18,14 +18,16 @@
1818
*)
1919

2020
module CSS = CSS
21+
module Console = Console
2122
module Dom = Dom
2223
module Dom_events = Dom_events
2324
module Dom_html = Dom_html
2425
module Dom_svg = Dom_svg
2526
module Effect_js = Effect_js
2627
module EventSource = EventSource
2728
module File = File
28-
module Firebug = Firebug
29+
module Firebug = Console
30+
[@@ocaml.deprecated "[since 6.0] Use Js_of_ocaml.Console instead."]
2931
module Form = Form
3032
module Geolocation = Geolocation
3133
module IntersectionObserver = IntersectionObserver

0 commit comments

Comments
 (0)