diff --git a/lib/js_of_ocaml/js.ml b/lib/js_of_ocaml/js.ml index e9972add32..c51958422d 100644 --- a/lib/js_of_ocaml/js.ml +++ b/lib/js_of_ocaml/js.ml @@ -246,8 +246,6 @@ module Js = struct type string_array - type number_t = float - class type number = object method toString : js_string t meth @@ -271,7 +269,7 @@ module Js = struct method charAt : int -> js_string t meth - method charCodeAt : int -> number_t meth + method charCodeAt : int -> number t meth (* This may return NaN... *) method concat : js_string t -> js_string t meth @@ -291,7 +289,7 @@ module Js = struct method lastIndexOf_from : js_string t -> int -> int meth - method localeCompare : js_string t -> number_t meth + method localeCompare : js_string t -> number t meth method _match : regExp t -> match_result_handle t opt meth @@ -354,6 +352,8 @@ module Js = struct and normalization = js_string + type number_t = number t + (* string is used by ppx_js, it needs to come before any use of the new syntax in this file *) external string : string -> js_string t = "caml_jsstring_of_string" diff --git a/lib/js_of_ocaml/js.mli b/lib/js_of_ocaml/js.mli index 47013b7c95..cdaf7ad8f4 100644 --- a/lib/js_of_ocaml/js.mli +++ b/lib/js_of_ocaml/js.mli @@ -219,8 +219,6 @@ val nfkc : normalization t (** Specification of Javascript number objects. *) -type number_t = float - class type number = object method toString : js_string t meth @@ -245,7 +243,7 @@ and js_string = object method charAt : int -> js_string t meth - method charCodeAt : int -> number_t meth + method charCodeAt : int -> number t meth (* This may return NaN... *) method concat : js_string t -> js_string t meth @@ -265,7 +263,7 @@ and js_string = object method lastIndexOf_from : js_string t -> int -> int meth - method localeCompare : js_string t -> number_t meth + method localeCompare : js_string t -> number t meth method _match : regExp t -> match_result_handle t opt meth @@ -328,6 +326,8 @@ and regExp = object method lastIndex : int prop end +type number_t = number t + (** Specification of the string constructor, considered as an object. *) class type string_constr = object method fromCharCode : int -> js_string t meth