Skip to content

Commit 186fd00

Browse files
committed
fix roundtrip tests
1 parent 49aa856 commit 186fd00

File tree

5 files changed

+11
-11
lines changed

5 files changed

+11
-11
lines changed

jscomp/syntax/tests/idempotency/covid-19charts.com/src/Data.res

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -57,7 +57,7 @@ type value =
5757
let dataWithGrowth =
5858
Map.entries(data)
5959
|> Js.Array.map(((countryId, dataPoints)) => {
60-
let data = lazy {
60+
let data = Lazy.from_fun(() => {
6161
let countryDataWithGrowth = Map.empty()
6262
let _ = Js.Array.reduce((prevRecord, day) => {
6363
let record = Map.get(dataPoints, day)
@@ -72,7 +72,7 @@ let dataWithGrowth =
7272
Some(record)
7373
}, None, days)
7474
countryDataWithGrowth
75-
}
75+
})
7676
(countryId, data)
7777
})
7878
|> Belt.Map.String.fromArray
@@ -92,7 +92,7 @@ let calendar: t = Js.Array.mapi((day, index) => {
9292
Belt.HashMap.String.set(
9393
values,
9494
Map.get(locations, countryId).name,
95-
lazy Map.get(Belt.Map.String.getExn(dataWithGrowth, countryId) |> Lazy.force, day),
95+
Lazy.from_fun(() => Map.get(Belt.Map.String.getExn(dataWithGrowth, countryId) |> Lazy.force, day)),
9696
),
9797
countryIds,
9898
)
@@ -140,7 +140,7 @@ let getValue = (dataType, dataItem) => getValueFromRecord(dataType, getRecord(da
140140

141141
let alignToDay0 = (dataType, threshold) => {
142142
let data = Belt.Map.String.mapU(dataWithGrowth, (. dataPoints) =>
143-
lazy {
143+
Lazy.from_fun(() => {
144144
let dataPoints = Lazy.force(dataPoints)
145145
Map.entries(dataPoints)
146146
|> Js.Array.map(((date, value)) => (Map.get(dayToIndex, date), value))
@@ -149,7 +149,7 @@ let alignToDay0 = (dataType, threshold) => {
149149
|> Js.Array.filter(value => getValue(dataType, value) >= threshold)
150150
|> Js.Array.mapi((value, index) => (index, value))
151151
|> Belt.Map.Int.fromArray
152-
}
152+
})
153153
)
154154

155155
Array.init(Js.Array.length(days), day => {

jscomp/syntax/tests/idempotency/genType/src/Arnold.res

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1359,7 +1359,7 @@ let traverseAst = (~valueBindingsTable) => {
13591359
valueBindings |> List.iter((vb: Typedtree.value_binding) =>
13601360
switch vb.vb_pat.pat_desc {
13611361
| Tpat_var(id, {loc: {loc_start: pos}}) =>
1362-
let callees = lazy FindFunctionsCalled.findCallees(vb.vb_expr)
1362+
let callees = Lazy.from_fun(() => FindFunctionsCalled.findCallees(vb.vb_expr))
13631363
Hashtbl.replace(valueBindingsTable, Ident.name(id), (pos, vb.vb_expr, callees))
13641364
| _ => ()
13651365
}

jscomp/syntax/tests/idempotency/genType/src/DeadValue.res

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -12,12 +12,12 @@ let whiteListSideEffects = list{
1212
"Int64.one",
1313
"String.length",
1414
}
15-
let whiteTableSideEffects = lazy {
15+
let whiteTableSideEffects = Lazy.from_fun(() => {
1616
let tbl = Hashtbl.create(11)
1717

1818
whiteListSideEffects |> List.iter(s => Hashtbl.add(tbl, s, ()))
1919
tbl
20-
}
20+
})
2121

2222
let pathIsWhitelistedForSideEffects = path =>
2323
switch path |> Path.flatten {

jscomp/syntax/tests/idempotency/genType/src/Log_.res

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
module Color = {
2-
let color_enabled = lazy Unix.isatty(Unix.stdout)
2+
let color_enabled = Lazy.from_fun(() => Unix.isatty(Unix.stdout))
33
let forceColor = ref(false)
44

55
let get_color_enabled = () => forceColor.contents || Lazy.force(color_enabled)

jscomp/syntax/tests/idempotency/genType/src/ModuleResolver.res

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -189,7 +189,7 @@ type resolver = {
189189
}
190190

191191
let createLazyResolver = (~config, ~extensions, ~excludeFile) => {
192-
lazyFind: lazy {
192+
lazyFind: Lazy.from_fun(() => {
193193
let (moduleNameMap, bsDependenciesFileMap) = sourcedirsJsonToMap(
194194
~config,
195195
~extensions,
@@ -210,7 +210,7 @@ let createLazyResolver = (~config, ~extensions, ~excludeFile) => {
210210
moduleName |> find(~bsDependencies=true, ~map=bsDependenciesFileMap)
211211
| res => res
212212
}
213-
},
213+
}),
214214
}
215215

216216
let apply = (~resolver, ~useBsDependencies, moduleName) =>

0 commit comments

Comments
 (0)