Movatterモバイル変換


[0]ホーム

URL:


Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

Commit34e1219

Browse files
authored
Fix deprecation warnings in tests (Js.log -> Console.log) (#7999)
1 parent76349c5 commit34e1219

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
letsecond=switchintDict {
1717
|dict{"first":first}=>first+2
1818
|_=>1
1919
}
20-
Js.log(second)
20+
Console.log(second)
2121
letthird=switchstringDict {
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
leteachIntLazy= (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
moduletypeBeltList=moduletype ofBelt.List
1212
letbeltAsModule=awaitJs.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
externalmyJson: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
externalbuttonCss: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
letnestedPromise=async (xxx:promise<promise<int>>)=> {
44
letxx=awaitxxx
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
letcreate=asyncx=> {
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
leta=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
letptl=foo(~y="y",...)
4040

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

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

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

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

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

7979
letfn=cb=> {
8080
cb()
8181
}
8282

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

8585
letfn1= (a,b, ())=>a()+b
8686

8787
leta=fn1(()=>1,2,_)
8888

8989
modulePartialApplication= {
9090
letf3= (~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
typecounter
2828
@setexternalsetIncrementC: (counter, @this (counter,int)=>unit)=>unit="increment"
29-
lettsiC=c=>setIncrementC(c, @this (me,amount)=>Js.log(me))
29+
lettsiC=c=>setIncrementC(c, @this (me,amount)=>Console.log(me))
3030
@setexternalsetIncrementU: (counter, @this (counter,int)=>unit)=>unit="increment"
31-
lettsiU=c=>setIncrementU(c, @this (me,amount)=>Js.log(me))
31+
lettsiU=c=>setIncrementU(c, @this (me,amount)=>Console.log(me))
3232

3333
@module("react")
3434
externaluseState: (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
letl1=ListWithTuples.Cons((1,Cons((2,Cons((3,Empty))))))
5353
letl2=tuplesToObjects(l1)
54-
Js.log2("l1",l1)
55-
Js.log2("l2",l2)
54+
Console.log2("l1",l1)
55+
Console.log2("l2",l2)
5656

5757
moduleTruthy= {
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
letcheck=s=>
335335
switchs {
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
letclassify=async (a:arr)=>
377377
switcha {
378-
|Array(arr)=>Js.log(arr->Belt.Array.joinWith("-",x=>x))
379-
|String(s)=>Js.log(s)
380-
|Promise(p)=>Js.log(awaitp)
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(awaitp)
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
letclassifyAll=async (t:t)=>
418418
switcht {
419-
|String(s)=>Js.log(s)
420-
|Promise(p)=>Js.log(awaitp)
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(awaitp)
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
forxin1to (B :>int) {
142-
Js.log(x)
142+
Console.log(x)
143143
}
144144

145145
typeflagStr= | @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
letdoWithA= (a:a)=> {
77
switcha {
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
letdoWithB= (b:b)=> {
1515
switchb {
16-
|One=>Js.log("aaa")
17-
|_=>Js.log("twwwoooo")
16+
|One=>Console.log("aaa")
17+
|_=>Console.log("twwwoooo")
1818
}
1919
}
2020

2121
letlookup= (b:b)=>
2222
switchb {
2323
|...aasa=>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
letlookup2= (d:d)=>
2929
switchd {
3030
|...aasa=>doWithA(a)
3131
|...basb=>doWithB(b)
32-
|Six |Seven=>Js.log("Got rest of d")
32+
|Six |Seven=>Console.log("Got rest of d")
3333
}
3434

3535
letlookupOpt= (b:option<b>)=>
3636
switchb {
3737
|Some(...aasa)=>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
moduleFoo= {
@@ -47,12 +47,12 @@ module Foo = {
4747

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

5454
letlookup3= (d:Foo.xx)=>
5555
switchd {
56-
|...Foo.zzasz=>Js.log(z)
57-
|Third=>Js.log("Third")
56+
|...Foo.zzasz=>Console.log(z)
57+
|Third=>Console.log("Third")
5858
}

0 commit comments

Comments
 (0)

[8]ページ先頭

©2009-2025 Movatter.jp