Skip to content

Commit

Permalink
fix instances of @U that should be @u0
Browse files Browse the repository at this point in the history
  • Loading branch information
anmonteiro committed Jan 17, 2024
1 parent 033f846 commit 6b1e290
Show file tree
Hide file tree
Showing 22 changed files with 97 additions and 103 deletions.
2 changes: 1 addition & 1 deletion jscomp/others/node_fs.ml
Original file line number Diff line number Diff line change
Expand Up @@ -67,7 +67,7 @@ module Watch = struct
f:
([ `change of
(string (*eventType*) -> Node.string_buffer (* filename *) -> unit[@u])
| `error of (unit -> unit[@u]) ]
| `error of (unit -> unit[@u0]) ]
[@mel.string]) ->
t = "on"
[@@mel.send]
Expand Down
2 changes: 1 addition & 1 deletion jscomp/runtime/caml_external_polyfill.ml
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,7 @@ open struct
module Js = Js_internal
end

let getGlobalThis : (unit -> global[@u]) =
let getGlobalThis : (unit -> global[@u0]) =
[%raw
{| function(){
if (typeof globalThis !== 'undefined') return globalThis;
Expand Down
12 changes: 6 additions & 6 deletions jscomp/stdlib/camlinternalLazy.ml
Original file line number Diff line number Diff line change
Expand Up @@ -36,8 +36,8 @@ type 'a concrete = {

exception Undefined

external fnToVal : (unit -> 'a [@u]) -> 'a = "%identity"
external valToFn : 'a -> (unit -> 'a [@u]) = "%identity"
external fnToVal : (unit -> 'a [@u0]) -> 'a = "%identity"
external valToFn : 'a -> (unit -> 'a [@u0]) = "%identity"
external castToConcrete : 'a lazy_t -> 'a concrete = "%identity"
external of_concrete : 'a concrete -> 'a lazy_t = "%identity"

Expand All @@ -46,15 +46,15 @@ let is_val (type a ) (l : a lazy_t) : bool =



let forward_with_closure (type a ) (blk : a concrete) (closure : unit -> a [@u]) : a =
let result = closure () [@u] in
let forward_with_closure (type a ) (blk : a concrete) (closure : unit -> a [@u0]) : a =
let result = closure () [@u0] in
(* do set_field BEFORE set_tag *)
blk.value <- result;
blk.tag<- true;
result


let raise_undefined = (fun [@u] () -> raise Undefined)
let raise_undefined = (fun [@u0] () -> raise Undefined)

(* Assume [blk] is a block with tag lazy *)
let force_lazy_block (type a ) (blk : a t) : a =
Expand All @@ -64,7 +64,7 @@ let force_lazy_block (type a ) (blk : a t) : a =
try
forward_with_closure blk closure
with e ->
blk.value <- fnToVal (fun [@u] () -> raise e);
blk.value <- fnToVal (fun [@u0] () -> raise e);
raise e


Expand Down
2 changes: 1 addition & 1 deletion jscomp/test/demo.ml
Original file line number Diff line number Diff line change
Expand Up @@ -94,7 +94,7 @@ let ui_layout
with e -> ()
end;
let fmt v = toFixed v 2 in
set_interval (fun [@u] () ->
set_interval (fun [@u0] () ->

grid##dataSource #=
( array_map data (fun [@u] {ticker; price } ->
Expand Down
2 changes: 1 addition & 1 deletion jscomp/test/demo_binding.ml
Original file line number Diff line number Diff line change
Expand Up @@ -102,7 +102,7 @@ class type textArea =
end[@u]


external set_interval : (unit -> unit [@u]) -> float -> unit = "setInterval"
external set_interval : (unit -> unit [@u0]) -> float -> unit = "setInterval"
[@@mel.module "@runtime", "Runtime"]

external toFixed : float -> int -> string = "toFixed" [@@mel.send]
6 changes: 3 additions & 3 deletions jscomp/test/dist/jscomp/test/event_ffi.js

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion jscomp/test/dist/jscomp/test/exception_raise_test.js

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

8 changes: 4 additions & 4 deletions jscomp/test/dist/jscomp/test/ffi_arity_test.js

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

98 changes: 49 additions & 49 deletions jscomp/test/dist/jscomp/test/ocaml_parsetree_test.js

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion jscomp/test/dist/jscomp/test/ppx_apply_test.js

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

4 changes: 2 additions & 2 deletions jscomp/test/dist/jscomp/test/raw_output_test.js

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

4 changes: 2 additions & 2 deletions jscomp/test/dist/jscomp/test/re_or_res/reactTestUtils.js

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

4 changes: 2 additions & 2 deletions jscomp/test/dist/jscomp/test/uncurry_glob_test.js

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

5 changes: 2 additions & 3 deletions jscomp/test/gpr_2682_test.ml
Original file line number Diff line number Diff line change
Expand Up @@ -52,9 +52,8 @@ end
;; forIn [%obj{x = 3 ; y = 3}] (fun[@u] x -> Js.log x)


let f3 : unit -> bool [@u] = [%raw"()=>true"]
let f3 : unit -> bool [@u0] = [%raw"()=>true"]

let bbbb = f3 () [@u]
let bbbb = f3 () [@u0]

;;assert (bbbb)

2 changes: 1 addition & 1 deletion jscomp/test/http_types.ml
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@ class type _resp =
type resp = _resp Js.t
class type _server =
object
method listen : int -> string -> (unit -> unit [@u]) -> unit
method listen : int -> string -> (unit -> unit [@u0]) -> unit
end[@u]
type server = _server Js.t
class type _http =
Expand Down
8 changes: 4 additions & 4 deletions jscomp/test/mt.ml
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
external describe : string -> (unit -> unit[@u]) -> unit = "describe"
external describe : string -> (unit -> unit[@u0]) -> unit = "describe"

external it : string -> (unit -> unit[@mel.uncurry]) -> unit = "it"
external it_promise : string -> (unit -> _ Js.Promise.t [@mel.uncurry]) -> unit = "it"
Expand Down Expand Up @@ -37,7 +37,7 @@ let from_suites name (suite : (string * ('a -> unit)) list) =
match Array.to_list Node.Process.process##argv with
| _cmd :: _ ->
if is_mocha () then
describe name (fun [@u] () ->
describe name (fun [@u0] () ->
List.iter (fun (name, code) -> it name code) suite)

| _ -> ()
Expand Down Expand Up @@ -96,7 +96,7 @@ let from_pair_suites name (suites : pair_suites) =
match Array.to_list Node.Process.process##argv with
| _cmd :: _ ->
if is_mocha () then
describe name (fun [@u] () ->
describe name (fun [@u0] () ->
suites |>
List.iter (fun (name, code) ->
it name (fun _ ->
Expand All @@ -111,7 +111,7 @@ let from_promise_suites name (suites : (string * _ Js.Promise.t ) list) =
match Array.to_list Node.Process.process##argv with
| _cmd :: _ ->
if is_mocha () then
describe name (fun [@u] () ->
describe name (fun [@u0] () ->
suites |>
List.iter (fun (name, code) ->
it_promise name (fun _ ->
Expand Down
8 changes: 4 additions & 4 deletions jscomp/test/ocaml_typedtree_test.ml
Original file line number Diff line number Diff line change
Expand Up @@ -11621,7 +11621,7 @@ end = struct



external describe : string -> (unit -> unit[@u]) -> unit = "describe"
external describe : string -> (unit -> unit[@u0]) -> unit = "describe"


external it : string -> (unit -> unit[@mel.uncurry]) -> unit = "it"
Expand Down Expand Up @@ -11677,7 +11677,7 @@ let from_suites name (suite : (string * ('a -> unit)) list) =
match Array.to_list Node.Process.process##argv with
| cmd :: _ ->
if is_mocha () then
describe name (fun [@u] () ->
describe name (fun [@u0] () ->
List.iter (fun (name, code) -> it name code) suite)

| _ -> ()
Expand Down Expand Up @@ -11736,7 +11736,7 @@ let from_pair_suites name (suites : pair_suites) =
match Array.to_list Node.Process.process##argv with
| cmd :: _ ->
if is_mocha () then
describe name (fun [@u] () ->
describe name (fun [@u0] () ->
suites |>
List.iter (fun (name, code) ->
it name (fun _ ->
Expand All @@ -11751,7 +11751,7 @@ let from_promise_suites name (suites : (string * _ Js.Promise.t ) list) =
match Array.to_list Node.Process.process##argv with
| cmd :: _ ->
if is_mocha () then
describe name (fun [@u] () ->
describe name (fun [@u0] () ->
suites |>
List.iter (fun (name, code) ->
it_promise name (fun _ ->
Expand Down
Loading

0 comments on commit 6b1e290

Please sign in to comment.