Skip to content

Commit 497f233

Browse files
Add reset to experimental_features to correctly reset playground (#7868)
* Add reset to experimental_features to correctly reset playground * Changelog
1 parent 6dcf79a commit 497f233

File tree

4 files changed

+7
-0
lines changed

4 files changed

+7
-0
lines changed

CHANGELOG.md

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -23,6 +23,7 @@
2323
#### :bug: Bug fix
2424

2525
- Fix code generation for emojis in polyvars and labels. https://github.com/rescript-lang/rescript/pull/7853
26+
- Add `reset` to `experimental_features` to correctly reset playground. https://github.com/rescript-lang/rescript/pull/7868
2627
- Fix crash with `@get` on external of type `unit => 'a`. https://github.com/rescript-lang/rescript/pull/7866
2728

2829
#### :memo: Documentation
@@ -31,6 +32,8 @@
3132

3233
#### :house: Internal
3334

35+
- Playground: Add config options for experimental features and jsx preserve mode. https://github.com/rescript-lang/rescript/pull/7865
36+
3437
# 12.0.0-beta.10
3538

3639
#### :rocket: New Feature

compiler/jsoo/jsoo_playground_main.ml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -378,6 +378,7 @@ module Compile = struct
378378
(* Responsible for resetting all compiler state as if it were a new instance *)
379379
let reset_compiler () =
380380
warning_infos := [||];
381+
Experimental_features.reset ();
381382
flush_warning_buffer () |> ignore;
382383
Warnings.reset_fatal ();
383384
Env.reset_cache_toplevel ()

compiler/ml/experimental_features.ml

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -20,4 +20,6 @@ let enable_from_string (s : string) =
2020
| Some f -> enabled_features := FeatureSet.add f !enabled_features
2121
| None -> ()
2222

23+
let reset () = enabled_features := FeatureSet.empty
24+
2325
let is_enabled (f : feature) = FeatureSet.mem f !enabled_features

compiler/ml/experimental_features.mli

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -3,3 +3,4 @@ type feature = LetUnwrap
33
val enable_from_string : string -> unit
44
val is_enabled : feature -> bool
55
val to_string : feature -> string
6+
val reset : unit -> unit

0 commit comments

Comments
 (0)