Skip to content

Commit 577bce5

Browse files
committed
Fix deprecation warnings in tests (Js.log -> Console.log)
1 parent b123655 commit 577bce5

File tree

136 files changed

+333
-333
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

136 files changed

+333
-333
lines changed
Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1 +1 @@
1-
Js.Console.log("src")
1+
Console.log("src")

tests/tests/src/DictInternalRepresentation.res

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -12,15 +12,15 @@ let foo = () => {
1212
| dict{"first": first} => first ++ "2"
1313
| _ => "hello"
1414
}
15-
Js.log(first)
15+
Console.log(first)
1616
let second = switch intDict {
1717
| dict{"first": first} => first + 2
1818
| _ => 1
1919
}
20-
Js.log(second)
20+
Console.log(second)
2121
let third = switch stringDict {
2222
| dict{"first": first} => first ++ "2"
2323
| _ => "hello"
2424
}
25-
Js.log(third)
25+
Console.log(third)
2626
}

tests/tests/src/Import.res

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -5,8 +5,8 @@ let eachIntAsync = async (list: list<int>, f: int => unit) => {
55
let eachIntLazy = (list: list<int>, f: int => unit) =>
66
Js.Promise.then_(each => list->each(f)->Js.Promise.resolve, Js.import(Belt.List.forEach))
77

8-
let _ = list{1, 2, 3}->eachIntLazy(n => Js.log2("lazy", n))
9-
let _ = list{1, 2, 3}->eachIntAsync(n => Js.log2("async", n))
8+
let _ = list{1, 2, 3}->eachIntLazy(n => Console.log2("lazy", n))
9+
let _ = list{1, 2, 3}->eachIntAsync(n => Console.log2("async", n))
1010

1111
module type BeltList = module type of Belt.List
1212
let beltAsModule = await Js.import(module(Belt.List: BeltList))
Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,9 @@
11
@module({from: "./myJson.json", with: {type_: "json", \"some-identifier": "yep"}})
22
external myJson: Js.Json.t = "default"
33

4-
Js.log(myJson)
4+
Console.log(myJson)
55

66
@module({from: "./myCss.css", with: {type_: "css", \"some-identifier": "yep"}})
77
external buttonCss: string = "button"
88

9-
Js.log(buttonCss)
9+
Console.log(buttonCss)

tests/tests/src/SafePromises.res

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -3,18 +3,18 @@
33
let nestedPromise = async (xxx: promise<promise<int>>) => {
44
let xx = await xxx
55

6-
let _ = xx->Js.Promise2.then(x => Js.Promise.resolve(Js.log2("Promise2.then", x)))
6+
let _ = xx->Js.Promise2.then(x => Js.Promise.resolve(Console.log2("Promise2.then", x)))
77
let _ = xx->Js.Promise2.catch(x => {
8-
Js.log2("Promise2.catch_", x)
8+
Console.log2("Promise2.catch_", x)
99
Js.Promise.resolve(0)
1010
})
1111

1212
// This crashes
13-
let _ = Js.Promise.then_(x => Js.Promise.resolve(Js.log2("Promise.then_", x)), xx)
13+
let _ = Js.Promise.then_(x => Js.Promise.resolve(Console.log2("Promise.then_", x)), xx)
1414
}
1515

1616
let create = async x => {
17-
Js.log2("create", x)
17+
Console.log2("create", x)
1818
x
1919
}
2020

tests/tests/src/UncurriedAlways.res

Lines changed: 9 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,7 @@ let w = 3->foo(4)
1212

1313
let a = 3->foo(4)
1414

15-
Js.log(a) // Test automatic uncurried application
15+
Console.log(a) // Test automatic uncurried application
1616

1717
let _ = Js.Array2.map([1], x => x + 1)
1818

@@ -39,7 +39,7 @@ module AllLabels = {
3939
let ptl = foo(~y="y", ...)
4040

4141
let a1 = ptl(~x="x", ~z="z")
42-
Js.log2("a1:", a1)
42+
Console.log2("a1:", a1)
4343
}
4444

4545
module OptAtEnd = {
@@ -48,9 +48,9 @@ module OptAtEnd = {
4848
let ptl = foo(~y="y", ...)
4949

5050
let b1 = ptl(~x="x", ~z="z")
51-
Js.log2("b1:", b1)
51+
Console.log2("b1:", b1)
5252
let b2 = ptl(~x="x", ~z="z", ~d="d<-100")
53-
Js.log2("b2:", b2)
53+
Console.log2("b2:", b2)
5454
}
5555

5656
module OptMixed = {
@@ -69,26 +69,26 @@ module OptMixed = {
6969
let ptl = foo(~y="y", ~w="w", ...)
7070

7171
let c1 = ptl(~x="x", ~z="z")
72-
Js.log2("c1:", c1)
72+
Console.log2("c1:", c1)
7373
let c2 = ptl(~x="x", ~z="z", ~d1="d1<-100")
74-
Js.log2("c2:", c2)
74+
Console.log2("c2:", c2)
7575
let c3 = ptl(~x="x", ~z="z", ~d2="d2<-200", ~d4="d4<-400")
76-
Js.log2("c3:", c3)
76+
Console.log2("c3:", c3)
7777
}
7878

7979
let fn = cb => {
8080
cb()
8181
}
8282

83-
fn(s => Js.log(#foo(s)))
83+
fn(s => Console.log(#foo(s)))
8484

8585
let fn1 = (a, b, ()) => a() + b
8686

8787
let a = fn1(() => 1, 2, _)
8888

8989
module PartialApplication = {
9090
let f3 = (~x, ~y, ~z) => {
91-
Js.log(x)
91+
Console.log(x)
9292
x + y + z
9393
}
9494

tests/tests/src/UncurriedExternals.res

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -26,9 +26,9 @@ module StandardNotation = {
2626

2727
type counter
2828
@set external setIncrementC: (counter, @this (counter, int) => unit) => unit = "increment"
29-
let tsiC = c => setIncrementC(c, @this (me, amount) => Js.log(me))
29+
let tsiC = c => setIncrementC(c, @this (me, amount) => Console.log(me))
3030
@set external setIncrementU: (counter, @this (counter, int) => unit) => unit = "increment"
31-
let tsiU = c => setIncrementU(c, @this (me, amount) => Js.log(me))
31+
let tsiU = c => setIncrementU(c, @this (me, amount) => Console.log(me))
3232

3333
@module("react")
3434
external useState: (unit => 'state) => ('state, ('state => 'state) => unit) = "useState"

tests/tests/src/UntaggedVariants.res

Lines changed: 32 additions & 32 deletions
Original file line numberDiff line numberDiff line change
@@ -51,8 +51,8 @@ let rec tuplesToObjects = (l: ListWithTuples.t<_>): ListWithObjects.t<_> =>
5151

5252
let l1 = ListWithTuples.Cons((1, Cons((2, Cons((3, Empty))))))
5353
let l2 = tuplesToObjects(l1)
54-
Js.log2("l1", l1)
55-
Js.log2("l2", l2)
54+
Console.log2("l1", l1)
55+
Console.log2("l2", l2)
5656

5757
module Truthy = {
5858
@unboxed
@@ -86,7 +86,7 @@ module Unknown = {
8686
| A => "a"
8787
| B => "b"
8888
| Unknown(v) => {
89-
Js.log(x)
89+
Console.log(x)
9090
"Unknown"
9191
}
9292
}
@@ -333,8 +333,8 @@ module ComplexPattern = {
333333

334334
let check = s =>
335335
switch s {
336-
| Array([True, False, Array([String("My name is"), Number(10.)])]) => Js.log("yup")
337-
| _ => Js.log("Nope...")
336+
| Array([True, False, Array([String("My name is"), Number(10.)])]) => Console.log("yup")
337+
| _ => Console.log("Nope...")
338338
}
339339
}
340340

@@ -375,12 +375,12 @@ module Arr = {
375375

376376
let classify = async (a: arr) =>
377377
switch a {
378-
| Array(arr) => Js.log(arr->Belt.Array.joinWith("-", x => x))
379-
| String(s) => Js.log(s)
380-
| Promise(p) => Js.log(await p)
381-
| Object({userName}) => Js.log(userName)
382-
| Test => Js.log("testing")
383-
| TestInt => Js.log(12)
378+
| Array(arr) => Console.log(arr->Belt.Array.joinWith("-", x => x))
379+
| String(s) => Console.log(s)
380+
| Promise(p) => Console.log(await p)
381+
| Object({userName}) => Console.log(userName)
382+
| Test => Console.log("testing")
383+
| TestInt => Console.log(12)
384384
}
385385
}
386386

@@ -416,27 +416,27 @@ module AllInstanceofTypes = {
416416

417417
let classifyAll = async (t: t) =>
418418
switch t {
419-
| String(s) => Js.log(s)
420-
| Promise(p) => Js.log(await p)
421-
| Object({userName}) => Js.log(userName)
422-
| Date(date) => Js.log(date->Js.Date.toString)
423-
| RegExp(re) => Js.log(re->Js.Re.test_("test"))
424-
| Array(arr) => Js.log(arr->Belt.Array.joinWith("-", x => x))
425-
| File(file) => Js.log(file->fileName)
426-
| Blob(blob) => Js.log(blob->blobSize)
427-
| ArrayBuffer(_) => Js.log("ArrayBuffer")
428-
| Int8Array(_) => Js.log("Int8Array")
429-
| Int16Array(_) => Js.log("Int16Array")
430-
| Int32Array(_) => Js.log("Int32Array")
431-
| Uint8Array(_) => Js.log("Uint8Array")
432-
| Uint8ClampedArray(_) => Js.log("Uint8ClampedArray")
433-
| Uint16Array(_) => Js.log("Uint16Array")
434-
| Uint32Array(_) => Js.log("Uint32Array")
435-
| Float32Array(_) => Js.log("Float32Array")
436-
| Float64Array(_) => Js.log("Float64Array")
437-
| BigInt64Array(_) => Js.log("BigInt64Array")
438-
| BigUint64Array(_) => Js.log("BigUint64Array")
439-
| DataView(_) => Js.log("DataView")
419+
| String(s) => Console.log(s)
420+
| Promise(p) => Console.log(await p)
421+
| Object({userName}) => Console.log(userName)
422+
| Date(date) => Console.log(date->Js.Date.toString)
423+
| RegExp(re) => Console.log(re->Js.Re.test_("test"))
424+
| Array(arr) => Console.log(arr->Belt.Array.joinWith("-", x => x))
425+
| File(file) => Console.log(file->fileName)
426+
| Blob(blob) => Console.log(blob->blobSize)
427+
| ArrayBuffer(_) => Console.log("ArrayBuffer")
428+
| Int8Array(_) => Console.log("Int8Array")
429+
| Int16Array(_) => Console.log("Int16Array")
430+
| Int32Array(_) => Console.log("Int32Array")
431+
| Uint8Array(_) => Console.log("Uint8Array")
432+
| Uint8ClampedArray(_) => Console.log("Uint8ClampedArray")
433+
| Uint16Array(_) => Console.log("Uint16Array")
434+
| Uint32Array(_) => Console.log("Uint32Array")
435+
| Float32Array(_) => Console.log("Float32Array")
436+
| Float64Array(_) => Console.log("Float64Array")
437+
| BigInt64Array(_) => Console.log("BigInt64Array")
438+
| BigUint64Array(_) => Console.log("BigUint64Array")
439+
| DataView(_) => Console.log("DataView")
440440
}
441441
}
442442

tests/tests/src/VariantCoercion.res

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -139,7 +139,7 @@ module CoerceVariantBinaryOp = {
139139
}
140140

141141
for x in 1 to (B :> int) {
142-
Js.log(x)
142+
Console.log(x)
143143
}
144144

145145
type flagStr = | @as("one") One | @as("two") Two

tests/tests/src/VariantPatternMatchingSpreads.res

Lines changed: 15 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -5,39 +5,39 @@ type d = | ...b | ...c
55

66
let doWithA = (a: a) => {
77
switch a {
8-
| One => Js.log("aaa")
9-
| Two => Js.log("twwwoooo")
10-
| Three => Js.log("threeeee")
8+
| One => Console.log("aaa")
9+
| Two => Console.log("twwwoooo")
10+
| Three => Console.log("threeeee")
1111
}
1212
}
1313

1414
let doWithB = (b: b) => {
1515
switch b {
16-
| One => Js.log("aaa")
17-
| _ => Js.log("twwwoooo")
16+
| One => Console.log("aaa")
17+
| _ => Console.log("twwwoooo")
1818
}
1919
}
2020

2121
let lookup = (b: b) =>
2222
switch b {
2323
| ...a as a => doWithA(a)
24-
| Four => Js.log("four")
25-
| Five => Js.log("five")
24+
| Four => Console.log("four")
25+
| Five => Console.log("five")
2626
}
2727

2828
let lookup2 = (d: d) =>
2929
switch d {
3030
| ...a as a => doWithA(a)
3131
| ...b as b => doWithB(b)
32-
| Six | Seven => Js.log("Got rest of d")
32+
| Six | Seven => Console.log("Got rest of d")
3333
}
3434

3535
let lookupOpt = (b: option<b>) =>
3636
switch b {
3737
| Some(...a as a) => doWithA(a)
38-
| Some(Four) => Js.log("four")
39-
| Some(Five) => Js.log("five")
40-
| None => Js.log("None")
38+
| Some(Four) => Console.log("four")
39+
| Some(Five) => Console.log("five")
40+
| None => Console.log("None")
4141
}
4242

4343
module Foo = {
@@ -47,12 +47,12 @@ module Foo = {
4747

4848
let doWithZ = (z: Foo.zz) =>
4949
switch z {
50-
| First => Js.log("First")
51-
| Second => Js.log("Second")
50+
| First => Console.log("First")
51+
| Second => Console.log("Second")
5252
}
5353

5454
let lookup3 = (d: Foo.xx) =>
5555
switch d {
56-
| ...Foo.zz as z => Js.log(z)
57-
| Third => Js.log("Third")
56+
| ...Foo.zz as z => Console.log(z)
57+
| Third => Console.log("Third")
5858
}

0 commit comments

Comments
 (0)