diff --git a/examples/graph_viewer/viewer_common.ml b/examples/graph_viewer/viewer_common.ml index 74b9b55fae..5b347182d1 100644 --- a/examples/graph_viewer/viewer_common.ml +++ b/examples/graph_viewer/viewer_common.ml @@ -252,7 +252,7 @@ Format.eprintf "REDRAW %d %d %d %d@." x' y' w h; let dx = pm.valid_rect.x - x0 in let dy = pm.valid_rect.y - y0 in (* -Firebug.console##log_6 (dx, pm.valid_rect.width, a.width, +Console.console##log_6 (dx, pm.valid_rect.width, a.width, dy, pm.valid_rect.height, a.height); *) if diff --git a/examples/graph_viewer/viewer_js.ml b/examples/graph_viewer/viewer_js.ml index 2820bd543e..2fb6afed3d 100644 --- a/examples/graph_viewer/viewer_js.ml +++ b/examples/graph_viewer/viewer_js.ml @@ -304,18 +304,18 @@ let start () = if not !started then p##.style##.display := Js.string "inline"; Lwt.return ()); (* - Firebug.console##time(Js.string "loading"); + Console.console##time(Js.string "loading"); *) getfile "scene.json" >>= fun s -> (* - Firebug.console##timeEnd(Js.string "loading"); - Firebug.console##time(Js.string "parsing"); + Console.console##timeEnd(Js.string "loading"); + Console.console##time(Js.string "parsing"); *) let (x1, y1, x2, y2), bboxes, scene = of_json ~typ:[%json: scene] s in (* - Firebug.console##timeEnd(Js.string "parsing"); - Firebug.console##time(Js.string "init"); + Console.console##timeEnd(Js.string "parsing"); + Console.console##time(Js.string "init"); *) started := true; Dom.removeChild doc##.body p; @@ -350,7 +350,7 @@ let start () = let redraw_queued = ref false in let update_view _force = (* -Firebug.console##log_2(Js.string "update", Js.date##now()); +Console.console##log_2(Js.string "update", Js.date##now()); *) let a = allocation () in let scale = get_scale () in @@ -389,7 +389,7 @@ Firebug.console##log_2(Js.string "update", Js.date##now()); if not !redraw_queued then ignore (redraw_queued := true; (* -Firebug.console##log(Js.string "sleep"); +Console.console##log(Js.string "sleep"); *) Lwt_js.yield() >>= fun () -> redraw_queued := false; @@ -502,7 +502,7 @@ Firebug.console##log(Js.string "sleep"); (* Html.addEventListener Html.document Html.Event.keydown (Html.handler - (fun e -> Firebug.console##log(e##keyCode); + (fun e -> Console.console##log(e##keyCode); Js._true)) Js._true; *) @@ -510,7 +510,7 @@ Firebug.console##log(Js.string "sleep"); Html.addEventListener Html.document Html.Event.keypress (Html.handler (fun e -> - Firebug.console##log(Js.string "press"); + Console.console##log(Js.string "press"); match e##keyCode with | 37 -> (* left *) Js._false @@ -521,7 +521,7 @@ Firebug.console##log(Js.string "sleep"); | 40 -> (* down *) Js._false | _ -> - Firebug.console##log(- 1- e##keyCode); + Console.console##log(- 1- e##keyCode); Js._true)) Js._true; *) @@ -549,7 +549,7 @@ Firebug.console##log(Js.string "sleep"); Js._false | _ -> (* - Firebug.console##log_2(Js.string "keycode:", ev##keyCode); + Console.console##log_2(Js.string "keycode:", ev##keyCode); *) Js._true in @@ -564,12 +564,12 @@ Firebug.console##log(Js.string "sleep"); ignored_keycode := -1; if e##.keyCode = k then Js._true else handle_key_event e); (* -Firebug.console##time(Js.string "initial drawing"); +Console.console##time(Js.string "initial drawing"); *) update_view true; (* -Firebug.console##timeEnd(Js.string "initial drawing"); -Firebug.console##timeEnd(Js.string "init"); +Console.console##timeEnd(Js.string "initial drawing"); +Console.console##timeEnd(Js.string "init"); *) Lwt.return () diff --git a/examples/hyperbolic/hypertree.ml b/examples/hyperbolic/hypertree.ml index a4f2dda066..cbfc1a14e2 100644 --- a/examples/hyperbolic/hypertree.ml +++ b/examples/hyperbolic/hypertree.ml @@ -547,7 +547,7 @@ let language = (Html.window##.localStorage##getItem (Js.string "hyp_lang")) default_language) -let _ = Firebug.console##log !language +let _ = Console.console##log !language let set_language lang = Html.window##.localStorage##setItem (Js.string "hyp_lang") lang; @@ -643,7 +643,7 @@ type boxes = let shadow = false let draw canvas vertices edges nodes boxes = - Firebug.console##time (Js.string "draw"); + Console.console##time (Js.string "draw"); let c = canvas##getContext Html._2d_ in let ((rx, ry, dx, dy) as transf) = screen_transform canvas in c##clearRect @@ -795,8 +795,8 @@ let draw canvas vertices edges nodes boxes = (Js.float (2. *. h)) | `Txt (_, None, _) | `None -> () done; - Firebug.console##timeEnd (Js.string "draw"); - Firebug.console##log_2 !image_count !large_image_count + Console.console##timeEnd (Js.string "draw"); + Console.console##log_2 !image_count !large_image_count let tree_url = "tree.json" @@ -1239,7 +1239,7 @@ let show_image all_messages image_info name small_image = if !i >= 0 then ( let info = image_info.(!i) in - Firebug.console##log_2 name !i; + Console.console##log_2 name !i; let d = Html.document in let container = Html.createDiv d in container##.style##.margin := Js.string "10px"; @@ -1582,7 +1582,7 @@ let start _ = (redraw_funct := fun () -> need_redraw := false; - Firebug.console##time (Js.string "transform"); + Console.console##time (Js.string "transform"); (* let transf = hyp_transf !tr' in for i = 0 to Array.length vertices - 1 do @@ -1596,7 +1596,7 @@ let start _ = canvas##.width := w; canvas##.height := h); hyp_transf_vect !tr' vertices vertices'; - Firebug.console##timeEnd (Js.string "transform"); + Console.console##timeEnd (Js.string "transform"); draw canvas vertices' edges nodes boxes); perform_redraw (); Html.window##.onresize := @@ -1692,7 +1692,7 @@ debug_msg (Format.sprintf "Resize %d %d" w h); handle_touch_events canvas (fun x0 y0 x1 y1 -> - Firebug.console##time (Js.string "transform"); + Console.console##time (Js.string "transform"); let z0 = from_screen canvas x0 y0 in let z1 = from_screen canvas x1 y1 in (* diff --git a/examples/test_wheel/test_wheel.ml b/examples/test_wheel/test_wheel.ml index 209585bf22..2da2588c0b 100644 --- a/examples/test_wheel/test_wheel.ml +++ b/examples/test_wheel/test_wheel.ml @@ -13,7 +13,7 @@ let () = in html##.onwheel := Dom.handler (fun (event : Dom_html.mousewheelEvent Js.t) -> - Firebug.console##debug event; + Console.console##debug event; let deltaX = event##.deltaX in let deltaY = event##.deltaY in let deltaZ = event##.deltaZ in diff --git a/examples/webgl/webgldemo.ml b/examples/webgl/webgldemo.ml index 082b6be798..1dc7b4840d 100644 --- a/examples/webgl/webgldemo.ml +++ b/examples/webgl/webgldemo.ml @@ -24,11 +24,11 @@ open Js let error f = Printf.ksprintf (fun s -> - Firebug.console##error (Js.string s); + Console.console##error (Js.string s); failwith s) f -let debug f = Printf.ksprintf (fun s -> Firebug.console##log (Js.string s)) f +let debug f = Printf.ksprintf (fun s -> Console.console##log (Js.string s)) f let alert f = Printf.ksprintf diff --git a/lib/js_of_ocaml/firebug.ml b/lib/js_of_ocaml/console.ml similarity index 100% rename from lib/js_of_ocaml/firebug.ml rename to lib/js_of_ocaml/console.ml diff --git a/lib/js_of_ocaml/firebug.mli b/lib/js_of_ocaml/console.mli similarity index 98% rename from lib/js_of_ocaml/firebug.mli rename to lib/js_of_ocaml/console.mli index fdf94f9f9f..458e3ef601 100644 --- a/lib/js_of_ocaml/firebug.mli +++ b/lib/js_of_ocaml/console.mli @@ -18,9 +18,9 @@ * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. *) -(** Firebug API (debugging console). +(** Console API (debugging console). -The Firebug console API +The console API *) open Js diff --git a/lib/js_of_ocaml/geolocation.mli b/lib/js_of_ocaml/geolocation.mli index 3b562d3e25..d11ca9ef97 100644 --- a/lib/js_of_ocaml/geolocation.mli +++ b/lib/js_of_ocaml/geolocation.mli @@ -28,12 +28,12 @@ let f_success pos = let coords = pos##.coords in let latitude = coords##.latitude in - Firebug.console##debug latitude ; + Console.console##debug latitude ; in let f_error err = let code = err##.code in let msg = err##.message in - if code = err##._TIMEOUT then Firebug.console##debug(msg) + if code = err##._TIMEOUT then Console.console##debug(msg) in geo##getCurrentPosition (Js.wrap_callback f_success) (Js.wrap_callback f_error) options ]} diff --git a/lib/js_of_ocaml/intl.mli b/lib/js_of_ocaml/intl.mli index 3cbf2ad281..0ee7d28b46 100644 --- a/lib/js_of_ocaml/intl.mli +++ b/lib/js_of_ocaml/intl.mli @@ -24,7 +24,7 @@ open Js ;; -let fc v = Firebug.console##debug v in +let fc v = Console.console##debug v in let jas a = array(Array.map (fun v -> string v) a) in @@ -410,10 +410,10 @@ if (Intl.is_supported()) then ( ) ; with - | Error err -> Firebug.console##debug ( + | Error err -> Console.console##debug ( string (string_of_error err)) ; ) else ( - Firebug.console##debug (string "Intl is not supported!") ; + Console.console##debug (string "Intl is not supported!") ; ) ]} diff --git a/lib/js_of_ocaml/js_of_ocaml.ml b/lib/js_of_ocaml/js_of_ocaml.ml index a0cdd5f30e..6f1683ffd8 100644 --- a/lib/js_of_ocaml/js_of_ocaml.ml +++ b/lib/js_of_ocaml/js_of_ocaml.ml @@ -18,6 +18,7 @@ *) module CSS = CSS +module Console = Console module Dom = Dom module Dom_events = Dom_events module Dom_html = Dom_html @@ -25,7 +26,8 @@ module Dom_svg = Dom_svg module Effect_js = Effect_js module EventSource = EventSource module File = File -module Firebug = Firebug +module Firebug = Console +[@@ocaml.deprecated "[since 6.0] Use Js_of_ocaml.Console instead."] module Form = Form module Geolocation = Geolocation module IntersectionObserver = IntersectionObserver diff --git a/lib/js_of_ocaml/mutationObserver.mli b/lib/js_of_ocaml/mutationObserver.mli index edc9b4ac6e..1376326d03 100644 --- a/lib/js_of_ocaml/mutationObserver.mli +++ b/lib/js_of_ocaml/mutationObserver.mli @@ -29,8 +29,8 @@ in let node = (target :> Dom.node Js.t) in let f records observer = - Firebug.console##debug records ; - Firebug.console##debug observer + Console.console##debug records ; + Console.console##debug observer in MutationObserver.observe ~node ~f ~attributes:true ~child_list:true ~character_data:true diff --git a/lib/js_of_ocaml/performanceObserver.mli b/lib/js_of_ocaml/performanceObserver.mli index c0a073b8a2..12f25b3b05 100644 --- a/lib/js_of_ocaml/performanceObserver.mli +++ b/lib/js_of_ocaml/performanceObserver.mli @@ -25,8 +25,8 @@ let entry_types = [ "measure" ] in let f entries observer = let entries = entries##getEntries in - Firebug.console##debug entries ; - Firebug.console##debug observer + Console.console##debug entries ; + Console.console##debug observer in PerformanceObserver.observe ~entry_types ~f () diff --git a/lib/js_of_ocaml/resizeObserver.mli b/lib/js_of_ocaml/resizeObserver.mli index df6874437e..defe18ed07 100644 --- a/lib/js_of_ocaml/resizeObserver.mli +++ b/lib/js_of_ocaml/resizeObserver.mli @@ -29,8 +29,8 @@ in let node = (target :> Dom.node Js.t) in let f entries observer = - Firebug.console##debug entries; - Firebug.console##debug observer + Console.console##debug entries; + Console.console##debug observer in ResizeObserver.observe ~node ~f ~box:(Js.string "content-box") diff --git a/lib/lwt/log/lwt_log_js.ml b/lib/lwt/log/lwt_log_js.ml index 967ab14865..eafcdfa8cc 100644 --- a/lib/lwt/log/lwt_log_js.ml +++ b/lib/lwt/log/lwt_log_js.ml @@ -32,14 +32,14 @@ let console = (Printf.sprintf "[%s] %s" (Section.name section) (String.concat "\n" logs)) in (match level, Lwt.get js_val with - | Debug, None -> Firebug.console##debug str - | Debug, Some v -> Firebug.console##debug_2 str v - | Info, None | Notice, None -> Firebug.console##info str - | Info, Some v | Notice, Some v -> Firebug.console##info_2 str v - | Warning, None -> Firebug.console##warn str - | Warning, Some v -> Firebug.console##warn_2 str v - | Error, None | Fatal, None -> Firebug.console##error str - | Error, Some v | Fatal, Some v -> Firebug.console##error_2 str v); + | Debug, None -> Console.console##debug str + | Debug, Some v -> Console.console##debug_2 str v + | Info, None | Notice, None -> Console.console##info str + | Info, Some v | Notice, Some v -> Console.console##info_2 str v + | Warning, None -> Console.console##warn str + | Warning, Some v -> Console.console##warn_2 str v + | Error, None | Fatal, None -> Console.console##error str + | Error, Some v | Fatal, Some v -> Console.console##error_2 str v); Lwt.return_unit) let log ?inspect ?exn ?section ?location ?logger ~level message = diff --git a/lib/lwt/lwt_js.ml b/lib/lwt/lwt_js.ml index e76708bbd0..25eedf686c 100644 --- a/lib/lwt/lwt_js.ml +++ b/lib/lwt/lwt_js.ml @@ -37,7 +37,7 @@ let wakeup = function let () = Lwt.register_pause_notifier wakeup -let prerr_string s = Firebug.console##log (Js.string s) +let prerr_string s = Console.console##log (Js.string s) let _ = Lwt.async_exception_hook := diff --git a/lib/lwt/lwt_js_events.ml b/lib/lwt/lwt_js_events.ml index ae00986df2..6dc75e69c4 100644 --- a/lib/lwt/lwt_js_events.ml +++ b/lib/lwt/lwt_js_events.ml @@ -61,7 +61,7 @@ let with_error_log f x = Lwt.catch (fun () -> f x) (fun e -> - Firebug.console##log (Js.string (Printexc.to_string e)); + Console.console##log (Js.string (Printexc.to_string e)); Lwt.return ()) let seq_loop evh ?(cancel_handler = false) ?use_capture ?passive target handler = @@ -330,7 +330,7 @@ let mousewheel ?use_capture ?passive target = ?passive:(opt_map Js.bool passive) target (fun (ev : #Dom_html.event Js.t) ~dx ~dy -> - Firebug.console##log ev; + Console.console##log ev; cancel (); Lwt.wakeup w (ev, (dx, dy)); Js.bool true) diff --git a/lib/lwt/lwt_jsonp.ml b/lib/lwt/lwt_jsonp.ml index 6e621009e0..31d6a5c9be 100644 --- a/lib/lwt/lwt_jsonp.ml +++ b/lib/lwt/lwt_jsonp.ml @@ -59,7 +59,7 @@ let raw_call name uri error_cb user_cb = if !executed then Lwt.return_unit else ( - Firebug.console##warn + Console.console##warn (Js.string "Jsonp: script loaded but callback not executed"); finalize (); error_cb x; diff --git a/toplevel/examples/lwt_toplevel/toplevel.ml b/toplevel/examples/lwt_toplevel/toplevel.ml index 614a9b3071..fc201a8947 100644 --- a/toplevel/examples/lwt_toplevel/toplevel.ml +++ b/toplevel/examples/lwt_toplevel/toplevel.ml @@ -442,7 +442,7 @@ let run _ = match exc with | Js_error.Exn e -> let e = Js_error.to_error e in - Firebug.console##log e##.stack + Console.console##log e##.stack | _ -> ()); Lwt.async (fun () -> resize ~container ~textbox () @@ -477,7 +477,7 @@ let run _ = with | Not_found -> () | exc -> - Firebug.console##log_3 + Console.console##log_3 (Js.string "exception") (Js.string (Printexc.to_string exc)) exc