Skip to content

Commit

Permalink
CR: Config.target
Browse files Browse the repository at this point in the history
  • Loading branch information
OlivierNicole committed Sep 21, 2024
1 parent fd0d0b4 commit 05e6198
Showing 1 changed file with 5 additions and 4 deletions.
9 changes: 5 additions & 4 deletions compiler/lib/config.ml
Original file line number Diff line number Diff line change
Expand Up @@ -183,11 +183,12 @@ end

(****)

let target_ : [ `JavaScript | `Wasm ] option ref = ref None
let target_ : [ `JavaScript | `Wasm | `None ] ref = ref `None

let target () =
match !target_ with
| Some t -> t
| None -> failwith "target was not set"
| `None -> failwith "target was not set"
| `JavaScript | `Wasm as t -> t

let set_target t = target_ := Some t
let set_target (t : [ `JavaScript | `Wasm ]) =
target_ := (t :> [ `JavaScript | `Wasm | `None ])

0 comments on commit 05e6198

Please sign in to comment.