diff --git a/CHANGELOG.md b/CHANGELOG.md index ce537b34cd..8fdb2471e4 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -12,6 +12,10 @@ # 11.1.0-rc.5 (Unreleased) +#### :nail_care: Polish + +- Add `ArrayBuffer.t` and `SharedArrayBuffer.t` to be base types of the Core bindings. https://github.com/rescript-lang/rescript-compiler/pull/6683 + # 11.1.0-rc.4 #### :bug: Bug Fix diff --git a/jscomp/others/js.ml b/jscomp/others/js.ml index 7c41df8859..46a56c19fc 100644 --- a/jscomp/others/js.ml +++ b/jscomp/others/js.ml @@ -22,7 +22,7 @@ * along with this program; if not, write to the Free Software * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. *) -[@@@bs.config { flags = [| "-unboxed-types"; "-w"; "-49" |] }] +[@@@bs.config {flags = [|"-unboxed-types"; "-w"; "-49"|]}] (* DESIGN: - It does not have any code, all its code will be inlined so that there will never be @@ -82,29 +82,23 @@ module Internal = struct external opaqueFullApply : 'a -> 'a = "%uncurried_apply" (* Use opaque instead of [._n] to prevent some optimizations happening *) - external run : (unit -> 'a [@bs]) -> 'a = "#run" + external run : ((unit -> 'a)[@bs]) -> 'a = "#run" external opaque : 'a -> 'a = "%opaque" end (**/**) -type +'a null = - | Value of 'a - | Null [@as null] -[@@unboxed] (** Nullable value of this type can be either null or 'a. This type is equivalent to Js.Null.t. *) +type +'a null = Value of 'a | Null [@as null] [@@unboxed] type +'a undefined (** A value of this type can be either undefined or 'a. This type is equivalent to Js.Undefined.t. *) -type +'a nullable = - | Value of 'a - | Null [@as null] - | Undefined [@as undefined] +type +'a nullable = Value of 'a | Null [@as null] | Undefined [@as undefined] [@@unboxed] (** @@ -144,17 +138,17 @@ external typeof : 'a -> string = "#typeof" *) external log : 'a -> unit = "log" - [@@val] [@@scope "console"] +[@@val] [@@scope "console"] (** Equivalent to console.log any value. *) external log2 : 'a -> 'b -> unit = "log" [@@bs.val] [@@bs.scope "console"] external log3 : 'a -> 'b -> 'c -> unit = "log" [@@bs.val] [@@bs.scope "console"] external log4 : 'a -> 'b -> 'c -> 'd -> unit = "log" - [@@bs.val] [@@bs.scope "console"] +[@@bs.val] [@@bs.scope "console"] external logMany : 'a array -> unit = "log" - [@@bs.val] [@@bs.scope "console"] [@@bs.splice] +[@@bs.val] [@@bs.scope "console"] [@@bs.splice] (** A convenience function to console.log more than 4 arguments *) external eqNull : 'a -> 'a null -> bool = "%bs_equal_null" @@ -199,8 +193,9 @@ module Undefined = Js_undefined module Nullable = Js_null_undefined (** Provide utilities for `Js.null_undefined` *) -module Null_undefined = Js_null_undefined -[@deprecated "Please use `Js.Nullable`"] +module Null_undefined = + Js_null_undefined + [@deprecated "Please use `Js.Nullable`"] module Exn = Js_exn (** Provide utilities for dealing with Js exceptions *) diff --git a/jscomp/others/js_array_buffer.res b/jscomp/others/js_array_buffer.res new file mode 100644 index 0000000000..280833a44e --- /dev/null +++ b/jscomp/others/js_array_buffer.res @@ -0,0 +1,6 @@ +type t = { + byteLength: int, + maxByteLength: int, + detached: bool, + resizable: bool, +} diff --git a/jscomp/others/js_shared_array_buffer.res b/jscomp/others/js_shared_array_buffer.res new file mode 100644 index 0000000000..6768de396d --- /dev/null +++ b/jscomp/others/js_shared_array_buffer.res @@ -0,0 +1,5 @@ +type t = { + byteLength: int, + maxByteLength: int, + growable: bool, +} diff --git a/jscomp/others/js_typed_array.res b/jscomp/others/js_typed_array.res index 21b010b1a0..8bab4e68cf 100644 --- a/jscomp/others/js_typed_array.res +++ b/jscomp/others/js_typed_array.res @@ -59,11 +59,13 @@ module ArrayBuffer = { @bs.send.pipe(: t) external slice: (~start: int, ~end_: int) => array_buffer = "slice" /* FIXME */ @bs.send.pipe(: t) external sliceFrom: int => array_buffer = "slice" } + +type typed_array<'a> + module type S = { /*** Implements functionality common to all the typed arrays */ type elt - type typed_array<'a> type t = typed_array @get_index external unsafe_get: (t, int) => elt = "" @@ -173,7 +175,6 @@ module type S = { module Int8Array = { /** */ type elt = int - type typed_array<'a> = Js_typed_array2.Int8Array.typed_array<'a> type t = typed_array @get_index external unsafe_get: (t, int) => elt = "" @@ -296,7 +297,6 @@ module Int8Array = { module Uint8Array = { /** */ type elt = int - type typed_array<'a> = Js_typed_array2.Uint8Array.typed_array<'a> type t = typed_array @get_index external unsafe_get: (t, int) => elt = "" @@ -419,7 +419,6 @@ module Uint8Array = { module Uint8ClampedArray = { /** */ type elt = int - type typed_array<'a> = Js_typed_array2.Uint8ClampedArray.typed_array<'a> type t = typed_array @get_index external unsafe_get: (t, int) => elt = "" @@ -542,7 +541,6 @@ module Uint8ClampedArray = { module Int16Array = { /** */ type elt = int - type typed_array<'a> = Js_typed_array2.Int16Array.typed_array<'a> type t = typed_array @get_index external unsafe_get: (t, int) => elt = "" @@ -665,7 +663,6 @@ module Int16Array = { module Uint16Array = { /** */ type elt = int - type typed_array<'a> = Js_typed_array2.Uint16Array.typed_array<'a> type t = typed_array @get_index external unsafe_get: (t, int) => elt = "" @@ -788,7 +785,6 @@ module Uint16Array = { module Int32Array = { /** */ type elt = int - type typed_array<'a> = Js_typed_array2.Int32Array.typed_array<'a> type t = typed_array @get_index external unsafe_get: (t, int) => elt = "" @@ -914,7 +910,6 @@ module Int32_array = Int32Array module Uint32Array = { /** */ type elt = int - type typed_array<'a> = Js_typed_array2.Uint32Array.typed_array<'a> type t = typed_array @get_index external unsafe_get: (t, int) => elt = "" @@ -1040,7 +1035,6 @@ module Uint32Array = { module Float32Array = { /** */ type elt = float - type typed_array<'a> = Js_typed_array2.Float32Array.typed_array<'a> type t = typed_array @get_index external unsafe_get: (t, int) => elt = "" @@ -1167,7 +1161,6 @@ module Float32_array = Float32Array module Float64Array = { /** */ type elt = float - type typed_array<'a> = Js_typed_array2.Float64Array.typed_array<'a> type t = typed_array @get_index external unsafe_get: (t, int) => elt = "" diff --git a/jscomp/others/js_typed_array2.res b/jscomp/others/js_typed_array2.res index 93bae0e0bc..b1ccfc9c69 100644 --- a/jscomp/others/js_typed_array2.res +++ b/jscomp/others/js_typed_array2.res @@ -28,26 +28,22 @@ JavaScript Typed Array API **see** [MDN](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/TypedArray) */ -type array_buffer -type array_like<'a> /* should be shared with js_array */ +type array_buffer = Js_array_buffer.t +type array_like<'a> = Js_array2.array_like<'a> module ArrayBuffer = { /*** The underlying buffer that the typed arrays provide views of **see** [MDN](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/ArrayBuffer) - */ + */ - type t = array_buffer + type t = array_buffer @new /** takes length. initializes elements to 0 */ external make: int => t = "ArrayBuffer" /* ArrayBuffer.isView: seems pointless with a type system */ - /* experimental - external transfer : array_buffer -> t = "ArrayBuffer.transfer" [@@bs.val] - external transferWithLength : array_buffer -> int -> t = "ArrayBuffer.transfer" [@@bs.val] - */ @get external byteLength: t => int = "byteLength" @@ -55,6 +51,8 @@ module ArrayBuffer = { @send external sliceFrom: (t, int) => array_buffer = "slice" } +type typed_array<'a> + /* commented out until bs has a plan for iterators external values : t -> elt array_iter = "" [@@bs.send] */ @@ -62,7 +60,6 @@ module ArrayBuffer = { module Int8Array = { /** */ type elt = int - type typed_array<'a> type t = typed_array @get_index external unsafe_get: (t, int) => elt = "" @@ -184,7 +181,6 @@ module Int8Array = { module Uint8Array = { /** */ type elt = int - type typed_array<'a> type t = typed_array @get_index external unsafe_get: (t, int) => elt = "" @@ -306,7 +302,6 @@ module Uint8Array = { module Uint8ClampedArray = { /** */ type elt = int - type typed_array<'a> type t = typed_array @get_index external unsafe_get: (t, int) => elt = "" @@ -428,7 +423,6 @@ module Uint8ClampedArray = { module Int16Array = { /** */ type elt = int - type typed_array<'a> type t = typed_array @get_index external unsafe_get: (t, int) => elt = "" @@ -550,7 +544,6 @@ module Int16Array = { module Uint16Array = { /** */ type elt = int - type typed_array<'a> type t = typed_array @get_index external unsafe_get: (t, int) => elt = "" @@ -672,7 +665,6 @@ module Uint16Array = { module Int32Array = { /** */ type elt = int - type typed_array<'a> type t = typed_array @get_index external unsafe_get: (t, int) => elt = "" @@ -794,7 +786,6 @@ module Int32Array = { module Uint32Array = { /** */ type elt = int - type typed_array<'a> type t = typed_array @get_index external unsafe_get: (t, int) => elt = "" @@ -919,7 +910,6 @@ module Uint32Array = { module Float32Array = { /** */ type elt = float - type typed_array<'a> type t = typed_array @get_index external unsafe_get: (t, int) => elt = "" @@ -1041,7 +1031,6 @@ module Float32Array = { module Float64Array = { /** */ type elt = float - type typed_array<'a> type t = typed_array @get_index external unsafe_get: (t, int) => elt = "" @@ -1170,6 +1159,7 @@ module DataView = { type t @new external make: array_buffer => t = "DataView" + @new external fromBuffer: array_buffer => t = "DataView" @new external fromBufferOffset: (array_buffer, int) => t = "DataView" @new external fromBufferRange: (array_buffer, ~offset: int, ~length: int) => t = "DataView" diff --git a/jscomp/others/release.ninja b/jscomp/others/release.ninja index 116df80fef..f86fc884d0 100644 --- a/jscomp/others/release.ninja +++ b/jscomp/others/release.ninja @@ -18,6 +18,7 @@ o others/belt_internals.cmi : cc others/belt_internals.resi | $bsc o others/js_OO.cmi others/js_OO.cmj : cc others/js_OO.res | others/belt_internals.cmi others/js.cmi $bsc o others/js_array.cmi others/js_array.cmj : cc others/js_array.res | others/belt_internals.cmi others/js.cmi others/js_array2.cmj $bsc o others/js_array2.cmi others/js_array2.cmj : cc others/js_array2.res | others/belt_internals.cmi others/js.cmi $bsc +o others/js_array_buffer.cmi others/js_array_buffer.cmj : cc others/js_array_buffer.res | others/belt_internals.cmi others/js.cmi $bsc o others/js_bigint.cmi others/js_bigint.cmj : cc others/js_bigint.res | others/belt_internals.cmi others/js.cmi $bsc o others/js_blob.cmi others/js_blob.cmj : cc others/js_blob.res | others/belt_internals.cmi others/js.cmi $bsc o others/js_cast.cmj : cc_cmi others/js_cast.res | others/belt_internals.cmi others/js.cmi others/js_cast.cmi $bsc @@ -53,10 +54,11 @@ o others/js_re.cmi others/js_re.cmj : cc others/js_re.res | others/belt_internal o others/js_result.cmj : cc_cmi others/js_result.res | others/belt_internals.cmi others/js.cmi others/js_result.cmi $bsc o others/js_result.cmi : cc others/js_result.resi | others/belt_internals.cmi others/js.cmi $bsc o others/js_set.cmi others/js_set.cmj : cc others/js_set.res | others/belt_internals.cmi others/js.cmi $bsc +o others/js_shared_array_buffer.cmi others/js_shared_array_buffer.cmj : cc others/js_shared_array_buffer.res | others/belt_internals.cmi others/js.cmi $bsc o others/js_string.cmi others/js_string.cmj : cc others/js_string.res | others/belt_internals.cmi others/js.cmi others/js_array2.cmj others/js_re.cmj $bsc o others/js_string2.cmi others/js_string2.cmj : cc others/js_string2.res | others/belt_internals.cmi others/js.cmi others/js_array2.cmj others/js_re.cmj $bsc o others/js_typed_array.cmi others/js_typed_array.cmj : cc others/js_typed_array.res | others/belt_internals.cmi others/js.cmi others/js.cmj others/js_typed_array2.cmj $bsc -o others/js_typed_array2.cmi others/js_typed_array2.cmj : cc others/js_typed_array2.res | others/belt_internals.cmi others/js.cmi others/js.cmj $bsc +o others/js_typed_array2.cmi others/js_typed_array2.cmj : cc others/js_typed_array2.res | others/belt_internals.cmi others/js.cmi others/js.cmj others/js_array2.cmj others/js_array_buffer.cmj $bsc o others/js_types.cmj : cc_cmi others/js_types.res | others/belt_internals.cmi others/js.cmi others/js.cmj others/js_bigint.cmj others/js_null.cmj others/js_types.cmi $bsc o others/js_types.cmi : cc others/js_types.resi | others/belt_internals.cmi others/js.cmi $bsc o others/js_undefined.cmj : cc_cmi others/js_undefined.res | others/belt_internals.cmi others/js.cmi others/js.cmj others/js_exn.cmj others/js_undefined.cmi $bsc @@ -74,7 +76,7 @@ o others/jsxEventU.cmi others/jsxEventU.cmj : cc others/jsxEventU.res | others/b o others/jsxPPXReactSupportC.cmi others/jsxPPXReactSupportC.cmj : cc others/jsxPPXReactSupportC.res | others/belt_internals.cmi others/js.cmi others/jsxC.cmj $bsc o others/jsxPPXReactSupportU.cmi others/jsxPPXReactSupportU.cmj : cc others/jsxPPXReactSupportU.res | others/belt_internals.cmi others/js.cmi others/jsxU.cmj $bsc o others/jsxU.cmi others/jsxU.cmj : cc others/jsxU.res | others/belt_internals.cmi others/js.cmi $bsc -o js_pkg : phony others/js_OO.cmi others/js_OO.cmj others/js_array.cmi others/js_array.cmj others/js_array2.cmi others/js_array2.cmj others/js_bigint.cmi others/js_bigint.cmj others/js_blob.cmi others/js_blob.cmj others/js_cast.cmi others/js_cast.cmj others/js_console.cmi others/js_console.cmj others/js_date.cmi others/js_date.cmj others/js_dict.cmi others/js_dict.cmj others/js_exn.cmi others/js_exn.cmj others/js_file.cmi others/js_file.cmj others/js_float.cmi others/js_float.cmj others/js_global.cmi others/js_global.cmj others/js_int.cmi others/js_int.cmj others/js_json.cmi others/js_json.cmj others/js_list.cmi others/js_list.cmj others/js_map.cmi others/js_map.cmj others/js_mapperRt.cmi others/js_mapperRt.cmj others/js_math.cmi others/js_math.cmj others/js_null.cmi others/js_null.cmj others/js_null_undefined.cmi others/js_null_undefined.cmj others/js_obj.cmi others/js_obj.cmj others/js_option.cmi others/js_option.cmj others/js_promise.cmi others/js_promise.cmj others/js_promise2.cmi others/js_promise2.cmj others/js_re.cmi others/js_re.cmj others/js_result.cmi others/js_result.cmj others/js_set.cmi others/js_set.cmj others/js_string.cmi others/js_string.cmj others/js_string2.cmi others/js_string2.cmj others/js_typed_array.cmi others/js_typed_array.cmj others/js_typed_array2.cmi others/js_typed_array2.cmj others/js_types.cmi others/js_types.cmj others/js_undefined.cmi others/js_undefined.cmj others/js_vector.cmi others/js_vector.cmj others/js_weakmap.cmi others/js_weakmap.cmj others/js_weakset.cmi others/js_weakset.cmj others/jsxC.cmi others/jsxC.cmj others/jsxDOMC.cmi others/jsxDOMC.cmj others/jsxDOMStyle.cmi others/jsxDOMStyle.cmj others/jsxDOMU.cmi others/jsxDOMU.cmj others/jsxEventC.cmi others/jsxEventC.cmj others/jsxEventU.cmi others/jsxEventU.cmj others/jsxPPXReactSupportC.cmi others/jsxPPXReactSupportC.cmj others/jsxPPXReactSupportU.cmi others/jsxPPXReactSupportU.cmj others/jsxU.cmi others/jsxU.cmj +o js_pkg : phony others/js_OO.cmi others/js_OO.cmj others/js_array.cmi others/js_array.cmj others/js_array2.cmi others/js_array2.cmj others/js_array_buffer.cmi others/js_array_buffer.cmj others/js_bigint.cmi others/js_bigint.cmj others/js_blob.cmi others/js_blob.cmj others/js_cast.cmi others/js_cast.cmj others/js_console.cmi others/js_console.cmj others/js_date.cmi others/js_date.cmj others/js_dict.cmi others/js_dict.cmj others/js_exn.cmi others/js_exn.cmj others/js_file.cmi others/js_file.cmj others/js_float.cmi others/js_float.cmj others/js_global.cmi others/js_global.cmj others/js_int.cmi others/js_int.cmj others/js_json.cmi others/js_json.cmj others/js_list.cmi others/js_list.cmj others/js_map.cmi others/js_map.cmj others/js_mapperRt.cmi others/js_mapperRt.cmj others/js_math.cmi others/js_math.cmj others/js_null.cmi others/js_null.cmj others/js_null_undefined.cmi others/js_null_undefined.cmj others/js_obj.cmi others/js_obj.cmj others/js_option.cmi others/js_option.cmj others/js_promise.cmi others/js_promise.cmj others/js_promise2.cmi others/js_promise2.cmj others/js_re.cmi others/js_re.cmj others/js_result.cmi others/js_result.cmj others/js_set.cmi others/js_set.cmj others/js_shared_array_buffer.cmi others/js_shared_array_buffer.cmj others/js_string.cmi others/js_string.cmj others/js_string2.cmi others/js_string2.cmj others/js_typed_array.cmi others/js_typed_array.cmj others/js_typed_array2.cmi others/js_typed_array2.cmj others/js_types.cmi others/js_types.cmj others/js_undefined.cmi others/js_undefined.cmj others/js_vector.cmi others/js_vector.cmj others/js_weakmap.cmi others/js_weakmap.cmj others/js_weakset.cmi others/js_weakset.cmj others/jsxC.cmi others/jsxC.cmj others/jsxDOMC.cmi others/jsxDOMC.cmj others/jsxDOMStyle.cmi others/jsxDOMStyle.cmj others/jsxDOMU.cmi others/jsxDOMU.cmj others/jsxEventC.cmi others/jsxEventC.cmj others/jsxEventU.cmi others/jsxEventU.cmj others/jsxPPXReactSupportC.cmi others/jsxPPXReactSupportC.cmj others/jsxPPXReactSupportU.cmi others/jsxPPXReactSupportU.cmj others/jsxU.cmi others/jsxU.cmj o others/belt_Array.cmj : cc_cmi others/belt_Array.res | others/belt.cmi others/belt_Array.cmi others/belt_internals.cmi others/js.cmi others/js.cmj others/js_math.cmj $bsc js_pkg o others/belt_Array.cmi : cc others/belt_Array.resi | others/belt.cmi others/belt_internals.cmi others/js.cmi others/js.cmj $bsc js_pkg o others/belt_Float.cmj : cc_cmi others/belt_Float.res | others/belt.cmi others/belt_Float.cmi others/belt_internals.cmi others/js.cmi $bsc js_pkg diff --git a/jscomp/runtime/js.ml b/jscomp/runtime/js.ml index d92826849f..100c5ecdc7 100644 --- a/jscomp/runtime/js.ml +++ b/jscomp/runtime/js.ml @@ -22,7 +22,7 @@ * along with this program; if not, write to the Free Software * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. *) -[@@@bs.config {flags = [|"-unboxed-types";"-w" ;"-49"|]}] +[@@@bs.config {flags = [|"-unboxed-types"; "-w"; "-49"|]}] (* DESIGN: - It does not have any code, all its code will be inlined so that there will never be @@ -42,44 +42,38 @@ *) (**/**) -(** Types for JS objects *) + type 'a t = < .. > as 'a +(** Types for JS objects *) module MapperRt = Js_mapperRt -module Internal = struct +module Internal = struct external opaqueFullApply : 'a -> 'a = "%uncurried_apply" (* Use opaque instead of [._n] to prevent some optimizations happening *) - external run : (unit -> 'a [@bs]) -> 'a = "#run" + external run : ((unit -> 'a)[@bs]) -> 'a = "#run" external opaque : 'a -> 'a = "%opaque" +end -end (**/**) - -type + 'a null = - | Value of 'a - | Null [@as null] -[@@unboxed] (** nullable, value of this type can be either [null] or ['a] this type is the same as type [t] in {!Null} *) +type +'a null = Value of 'a | Null [@as null] [@@unboxed] -type + 'a undefined +type +'a undefined (** value of this type can be either [undefined] or ['a] this type is the same as type [t] in {!Undefined} *) -type + 'a nullable = - | Value of 'a - | Null [@as null] - | Undefined [@as undefined] -[@@unboxed] (** value of this type can be [undefined], [null] or ['a] this type is the same as type [t] n {!Null_undefined} *) +type +'a nullable = Value of 'a | Null [@as null] | Undefined [@as undefined] +[@@unboxed] -type + 'a null_undefined = 'a nullable +type +'a null_undefined = 'a nullable -external toOption : 'a nullable -> 'a option = "#nullable_to_opt" +external toOption : 'a nullable -> 'a option = "#nullable_to_opt" external undefinedToOption : 'a undefined -> 'a option = "#undefined_to_opt" external nullToOption : 'a null -> 'a option = "#null_to_opt" @@ -87,9 +81,8 @@ external isNullable : 'a nullable -> bool = "#is_nullable" external import : 'a -> 'a promise = "#import" -(** The same as {!test} except that it is more permissive on the types of input *) external testAny : 'a -> bool = "#is_nullable" - +(** The same as {!test} except that it is more permissive on the types of input *) type (+'a, +'e) promise (** The promise type, defined here for interoperation across packages @@ -102,8 +95,6 @@ external null : 'a null = "#null" external undefined : 'a undefined = "#undefined" (** The same as [empty] {!Js.Undefined} will be compiled as [undefined]*) - - external typeof : 'a -> string = "#typeof" (** [typeof x] will be compiled as [typeof x] in JS Please consider functions in {!Types} for a type safe way of reflection @@ -113,10 +104,8 @@ external log : 'a -> unit = "log" [@@val] [@@scope "console"] (** A convenience function to log everything *) -external log2 : 'a -> 'b -> unit = "log" -[@@bs.val] [@@bs.scope "console"] -external log3 : 'a -> 'b -> 'c -> unit = "log" -[@@bs.val] [@@bs.scope "console"] +external log2 : 'a -> 'b -> unit = "log" [@@bs.val] [@@bs.scope "console"] +external log3 : 'a -> 'b -> 'c -> unit = "log" [@@bs.val] [@@bs.scope "console"] external log4 : 'a -> 'b -> 'c -> 'd -> unit = "log" [@@bs.val] [@@bs.scope "console"] @@ -136,13 +125,11 @@ external unsafe_lt : 'a -> 'a -> bool = "#unsafe_lt" to give a proper semantics for comparision which applies to any type *) - external unsafe_le : 'a -> 'a -> bool = "#unsafe_le" (** [unsafe_le a b] will be compiled as [a <= b]. See also {!unsafe_lt} *) - external unsafe_gt : 'a -> 'a -> bool = "#unsafe_gt" (** [unsafe_gt a b] will be compiled as [a > b]. See also {!unsafe_lt} @@ -153,7 +140,6 @@ external unsafe_ge : 'a -> 'a -> bool = "#unsafe_ge" See also {!unsafe_lt} *) - (** {12 nested modules}*) module Null = Js_null @@ -207,7 +193,7 @@ module Json = Js_json module Math = Js_math (** Provide bindings for JS [Math] object *) -module Obj = Js_obj +module Obj = Js_obj (** Provide utilities for {!Js.t} *) module Typed_array = Js_typed_array diff --git a/jscomp/runtime/release.ninja b/jscomp/runtime/release.ninja index 864f9c5a77..ea8ecb3b33 100644 --- a/jscomp/runtime/release.ninja +++ b/jscomp/runtime/release.ninja @@ -23,7 +23,7 @@ o runtime/caml_exceptions.cmj : cc_cmi runtime/caml_exceptions.res | runtime/cam o runtime/caml_exceptions.cmi : cc runtime/caml_exceptions.resi | runtime/bs_stdlib_mini.cmi runtime/js.cmi runtime/js.cmj o runtime/caml_float.cmj : cc_cmi runtime/caml_float.res | runtime/caml_float.cmi runtime/caml_float_extern.cmj o runtime/caml_float.cmi : cc runtime/caml_float.resi | runtime/bs_stdlib_mini.cmi runtime/js.cmi runtime/js.cmj -o runtime/caml_format.cmj : cc_cmi runtime/caml_format.ml | runtime/caml.cmj runtime/caml_float.cmj runtime/caml_float_extern.cmj runtime/caml_format.cmi runtime/caml_int64.cmj runtime/caml_int64_extern.cmj runtime/caml_nativeint_extern.cmj runtime/caml_string_extern.cmj +o runtime/caml_format.cmj : cc_cmi runtime/caml_format.ml | runtime/caml_float.cmj runtime/caml_float_extern.cmj runtime/caml_format.cmi runtime/caml_int64.cmj runtime/caml_int64_extern.cmj runtime/caml_nativeint_extern.cmj runtime/caml_string_extern.cmj o runtime/caml_format.cmi : cc runtime/caml_format.mli | runtime/bs_stdlib_mini.cmi runtime/js.cmi runtime/js.cmj o runtime/caml_hash.cmj : cc_cmi runtime/caml_hash.res | runtime/caml_hash.cmi runtime/caml_hash_primitive.cmj runtime/caml_nativeint_extern.cmj runtime/js.cmj o runtime/caml_hash.cmi : cc runtime/caml_hash.resi | runtime/bs_stdlib_mini.cmi runtime/js.cmi runtime/js.cmj @@ -39,7 +39,7 @@ o runtime/caml_md5.cmj : cc_cmi runtime/caml_md5.res | runtime/caml_array_extern o runtime/caml_md5.cmi : cc runtime/caml_md5.resi | runtime/bs_stdlib_mini.cmi runtime/js.cmi runtime/js.cmj o runtime/caml_module.cmj : cc_cmi runtime/caml_module.res | runtime/caml_array_extern.cmj runtime/caml_module.cmi runtime/caml_obj.cmj o runtime/caml_module.cmi : cc runtime/caml_module.resi | runtime/bs_stdlib_mini.cmi runtime/js.cmi runtime/js.cmj -o runtime/caml_obj.cmj : cc_cmi runtime/caml_obj.res | runtime/caml.cmj runtime/caml_array_extern.cmj runtime/caml_obj.cmi runtime/caml_option.cmj runtime/js.cmj +o runtime/caml_obj.cmj : cc_cmi runtime/caml_obj.res | runtime/caml_array_extern.cmj runtime/caml_obj.cmi runtime/caml_option.cmj runtime/js.cmj o runtime/caml_obj.cmi : cc runtime/caml_obj.resi | runtime/bs_stdlib_mini.cmi runtime/js.cmi runtime/js.cmj o runtime/caml_option.cmj : cc_cmi runtime/caml_option.res | runtime/caml_option.cmi runtime/caml_undefined_extern.cmj runtime/js.cmj o runtime/caml_option.cmi : cc runtime/caml_option.resi | runtime/bs_stdlib_mini.cmi runtime/caml_undefined_extern.cmj runtime/js.cmi runtime/js.cmj @@ -55,7 +55,7 @@ o runtime/caml_array_extern.cmi runtime/caml_array_extern.cmj : cc runtime/caml_ o runtime/caml_external_polyfill.cmi runtime/caml_external_polyfill.cmj : cc runtime/caml_external_polyfill.res | runtime/bs_stdlib_mini.cmi runtime/js.cmi runtime/js.cmj o runtime/caml_float_extern.cmi runtime/caml_float_extern.cmj : cc runtime/caml_float_extern.res | runtime/bs_stdlib_mini.cmi runtime/js.cmi runtime/js.cmj o runtime/caml_int64_extern.cmi runtime/caml_int64_extern.cmj : cc runtime/caml_int64_extern.res | runtime/bs_stdlib_mini.cmi runtime/js.cmi runtime/js.cmj -o runtime/caml_js_exceptions.cmi runtime/caml_js_exceptions.cmj : cc runtime/caml_js_exceptions.res | runtime/bs_stdlib_mini.cmi runtime/caml_exceptions.cmj runtime/caml_option.cmj runtime/js.cmi runtime/js.cmj +o runtime/caml_js_exceptions.cmi runtime/caml_js_exceptions.cmj : cc runtime/caml_js_exceptions.res | runtime/bs_stdlib_mini.cmi runtime/caml_exceptions.cmj runtime/js.cmi runtime/js.cmj o runtime/caml_nativeint_extern.cmi runtime/caml_nativeint_extern.cmj : cc runtime/caml_nativeint_extern.res | runtime/bs_stdlib_mini.cmi runtime/js.cmi runtime/js.cmj o runtime/caml_string_extern.cmi runtime/caml_string_extern.cmj : cc runtime/caml_string_extern.res | runtime/bs_stdlib_mini.cmi runtime/js.cmi runtime/js.cmj o runtime/caml_undefined_extern.cmi runtime/caml_undefined_extern.cmj : cc runtime/caml_undefined_extern.res | runtime/bs_stdlib_mini.cmi runtime/js.cmi runtime/js.cmj diff --git a/lib/es6/js_array_buffer.js b/lib/es6/js_array_buffer.js new file mode 100644 index 0000000000..ae1b9f17e6 --- /dev/null +++ b/lib/es6/js_array_buffer.js @@ -0,0 +1 @@ +/* This output is empty. Its source's type definitions, externals and/or unused code got optimized away. */ diff --git a/lib/es6/js_shared_array_buffer.js b/lib/es6/js_shared_array_buffer.js new file mode 100644 index 0000000000..ae1b9f17e6 --- /dev/null +++ b/lib/es6/js_shared_array_buffer.js @@ -0,0 +1 @@ +/* This output is empty. Its source's type definitions, externals and/or unused code got optimized away. */ diff --git a/lib/js/js_array_buffer.js b/lib/js/js_array_buffer.js new file mode 100644 index 0000000000..ae1b9f17e6 --- /dev/null +++ b/lib/js/js_array_buffer.js @@ -0,0 +1 @@ +/* This output is empty. Its source's type definitions, externals and/or unused code got optimized away. */ diff --git a/lib/js/js_shared_array_buffer.js b/lib/js/js_shared_array_buffer.js new file mode 100644 index 0000000000..ae1b9f17e6 --- /dev/null +++ b/lib/js/js_shared_array_buffer.js @@ -0,0 +1 @@ +/* This output is empty. Its source's type definitions, externals and/or unused code got optimized away. */ diff --git a/packages/artifacts.txt b/packages/artifacts.txt index 0fbc2e7676..266eb3a77e 100644 --- a/packages/artifacts.txt +++ b/packages/artifacts.txt @@ -111,6 +111,7 @@ lib/es6/js.js lib/es6/js_OO.js lib/es6/js_array.js lib/es6/js_array2.js +lib/es6/js_array_buffer.js lib/es6/js_bigint.js lib/es6/js_blob.js lib/es6/js_cast.js @@ -136,6 +137,7 @@ lib/es6/js_promise2.js lib/es6/js_re.js lib/es6/js_result.js lib/es6/js_set.js +lib/es6/js_shared_array_buffer.js lib/es6/js_string.js lib/es6/js_string2.js lib/es6/js_typed_array.js @@ -274,6 +276,7 @@ lib/js/js.js lib/js/js_OO.js lib/js/js_array.js lib/js/js_array2.js +lib/js/js_array_buffer.js lib/js/js_bigint.js lib/js/js_blob.js lib/js/js_cast.js @@ -299,6 +302,7 @@ lib/js/js_promise2.js lib/js/js_re.js lib/js/js_result.js lib/js/js_set.js +lib/js/js_shared_array_buffer.js lib/js/js_string.js lib/js/js_string2.js lib/js/js_typed_array.js @@ -716,6 +720,10 @@ lib/ocaml/js_array2.cmi lib/ocaml/js_array2.cmj lib/ocaml/js_array2.cmt lib/ocaml/js_array2.res +lib/ocaml/js_array_buffer.cmi +lib/ocaml/js_array_buffer.cmj +lib/ocaml/js_array_buffer.cmt +lib/ocaml/js_array_buffer.res lib/ocaml/js_bigint.cmi lib/ocaml/js_bigint.cmj lib/ocaml/js_bigint.cmt @@ -836,6 +844,10 @@ lib/ocaml/js_set.cmi lib/ocaml/js_set.cmj lib/ocaml/js_set.cmt lib/ocaml/js_set.res +lib/ocaml/js_shared_array_buffer.cmi +lib/ocaml/js_shared_array_buffer.cmj +lib/ocaml/js_shared_array_buffer.cmt +lib/ocaml/js_shared_array_buffer.res lib/ocaml/js_string.cmi lib/ocaml/js_string.cmj lib/ocaml/js_string.cmt