Skip to content

Commit 1db1af0

Browse files
authored
Lib: Rename firebug to console (#1802)
1 parent 3ab3b05 commit 1db1af0

20 files changed

+68
-65
lines changed

CHANGES.md

+11-10
Original file line numberDiff line numberDiff line change
@@ -1,23 +1,24 @@
11
# dev
22

33
## Features/Changes
4-
* Lib: fix the type of some DOM properties and methods (#1747)
5-
* Test: use dune test stanzas (#1631)
6-
* Merged Wasm_of_ocaml (#1724)
7-
* Lib: removed no longer relevant Js.optdef type annotations (#1769)
8-
* Misc: drop support for IE
9-
* Effects: add an optional feature of "dynamic switching" between CPS
4+
* Compiler/Runtime: Make resuming a continuation more efficient in js (#1765)
5+
* Compiler/Runtime: Effects: add an optional feature of "dynamic switching" between CPS
106
and direct style, resulting in better performance when
117
no effect handler is installed
12-
* Compiler/Runtime: Make resuming a continuation more efficient in js (#1765)
8+
* Compiler: Merged Wasm_of_ocaml (#1724)
9+
* Lib: fix the type of some DOM properties and methods (#1747)
10+
* Lib: removed no longer relevant Js.optdef type annotations (#1769)
1311
* Lib: Add other textMetrics property (#1784)
14-
* Misc: move tests to OCaml 5.3
12+
* Lib: rename Firebug to Console (#1802)
13+
* Test: use dune test stanzas (#1631)
1514
* Test: run wasm tests on windows
15+
* Misc: drop support for IE
16+
* Misc: move tests to OCaml 5.3
1617

1718
## Bug fixes
18-
* Fix small bug in global data flow analysis (#1768)
19+
* Compiler: Fix small bug in global data flow analysis (#1768)
1920
* Runtime: no longer leak channels
20-
* Fix Marshal.to_buffer (#1798)
21+
* Runtime: Fix Marshal.to_buffer (#1798)
2122

2223
# 5.9.1 (02-12-2024) - Lille
2324

examples/graph_viewer/viewer_common.ml

+1-1
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

+14-14
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

+8-8
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

+1-1
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

+2-2
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 lib/js_of_ocaml/console.mli

+2-2
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

+2-2
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

+3-3
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

+3-1
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

lib/js_of_ocaml/mutationObserver.mli

+2-2
Original file line numberDiff line numberDiff line change
@@ -29,8 +29,8 @@
2929
in
3030
let node = (target :> Dom.node Js.t) in
3131
let f records observer =
32-
Firebug.console##debug records ;
33-
Firebug.console##debug observer
32+
Console.console##debug records ;
33+
Console.console##debug observer
3434
in
3535
MutationObserver.observe ~node ~f
3636
~attributes:true ~child_list:true ~character_data:true

lib/js_of_ocaml/performanceObserver.mli

+2-2
Original file line numberDiff line numberDiff line change
@@ -25,8 +25,8 @@
2525
let entry_types = [ "measure" ] in
2626
let f entries observer =
2727
let entries = entries##getEntries in
28-
Firebug.console##debug entries ;
29-
Firebug.console##debug observer
28+
Console.console##debug entries ;
29+
Console.console##debug observer
3030
in
3131
PerformanceObserver.observe ~entry_types ~f
3232
()

lib/js_of_ocaml/resizeObserver.mli

+2-2
Original file line numberDiff line numberDiff line change
@@ -29,8 +29,8 @@
2929
in
3030
let node = (target :> Dom.node Js.t) in
3131
let f entries observer =
32-
Firebug.console##debug entries;
33-
Firebug.console##debug observer
32+
Console.console##debug entries;
33+
Console.console##debug observer
3434
in
3535
ResizeObserver.observe ~node ~f
3636
~box:(Js.string "content-box")

lib/lwt/log/lwt_log_js.ml

+8-8
Original file line numberDiff line numberDiff line change
@@ -32,14 +32,14 @@ let console =
3232
(Printf.sprintf "[%s] %s" (Section.name section) (String.concat "\n" logs))
3333
in
3434
(match level, Lwt.get js_val with
35-
| Debug, None -> Firebug.console##debug str
36-
| Debug, Some v -> Firebug.console##debug_2 str v
37-
| Info, None | Notice, None -> Firebug.console##info str
38-
| Info, Some v | Notice, Some v -> Firebug.console##info_2 str v
39-
| Warning, None -> Firebug.console##warn str
40-
| Warning, Some v -> Firebug.console##warn_2 str v
41-
| Error, None | Fatal, None -> Firebug.console##error str
42-
| Error, Some v | Fatal, Some v -> Firebug.console##error_2 str v);
35+
| Debug, None -> Console.console##debug str
36+
| Debug, Some v -> Console.console##debug_2 str v
37+
| Info, None | Notice, None -> Console.console##info str
38+
| Info, Some v | Notice, Some v -> Console.console##info_2 str v
39+
| Warning, None -> Console.console##warn str
40+
| Warning, Some v -> Console.console##warn_2 str v
41+
| Error, None | Fatal, None -> Console.console##error str
42+
| Error, Some v | Fatal, Some v -> Console.console##error_2 str v);
4343
Lwt.return_unit)
4444

4545
let log ?inspect ?exn ?section ?location ?logger ~level message =

lib/lwt/lwt_js.ml

+1-1
Original file line numberDiff line numberDiff line change
@@ -37,7 +37,7 @@ let wakeup = function
3737

3838
let () = Lwt.register_pause_notifier wakeup
3939

40-
let prerr_string s = Firebug.console##log (Js.string s)
40+
let prerr_string s = Console.console##log (Js.string s)
4141

4242
let _ =
4343
Lwt.async_exception_hook :=

lib/lwt/lwt_js_events.ml

+2-2
Original file line numberDiff line numberDiff line change
@@ -61,7 +61,7 @@ let with_error_log f x =
6161
Lwt.catch
6262
(fun () -> f x)
6363
(fun e ->
64-
Firebug.console##log (Js.string (Printexc.to_string e));
64+
Console.console##log (Js.string (Printexc.to_string e));
6565
Lwt.return ())
6666

6767
let seq_loop evh ?(cancel_handler = false) ?use_capture ?passive target handler =
@@ -330,7 +330,7 @@ let mousewheel ?use_capture ?passive target =
330330
?passive:(opt_map Js.bool passive)
331331
target
332332
(fun (ev : #Dom_html.event Js.t) ~dx ~dy ->
333-
Firebug.console##log ev;
333+
Console.console##log ev;
334334
cancel ();
335335
Lwt.wakeup w (ev, (dx, dy));
336336
Js.bool true)

lib/lwt/lwt_jsonp.ml

+1-1
Original file line numberDiff line numberDiff line change
@@ -59,7 +59,7 @@ let raw_call name uri error_cb user_cb =
5959
if !executed
6060
then Lwt.return_unit
6161
else (
62-
Firebug.console##warn
62+
Console.console##warn
6363
(Js.string "Jsonp: script loaded but callback not executed");
6464
finalize ();
6565
error_cb x;

tools/ci_setup.ml

+1-1
Original file line numberDiff line numberDiff line change
@@ -56,7 +56,7 @@ let dune_workspace =
5656
(_
5757
(env-vars (TESTING_FRAMEWORK inline-test))
5858
(js_of_ocaml (enabled_if false))
59-
(flags :standard -warn-error -7-8-27-30-32-34-37-49-52-55 -w -7-27-30-32-34-37-49-52-55-58-67-69)))
59+
(flags :standard -alert -all -warn-error -7-8-27-30-32-34-37-49-52-55 -w -7-27-30-32-34-37-49-52-55-58-67-69)))
6060
|}
6161

6262
let node_wrapper =

0 commit comments

Comments
 (0)