diff --git a/tests/analysis_tests/tests-reanalyze/deadcode/expected/deadcode.txt b/tests/analysis_tests/tests-reanalyze/deadcode/expected/deadcode.txt index 99902b72a5..43378d7b5a 100644 --- a/tests/analysis_tests/tests-reanalyze/deadcode/expected/deadcode.txt +++ b/tests/analysis_tests/tests-reanalyze/deadcode/expected/deadcode.txt @@ -65,7 +65,7 @@ addTypeReference DeadExn.res:8:16 --> DeadExn.res:1:0 addValueReference DeadExn.res:10:4 --> DeadExn.res:4:2 addTypeReference DeadExn.res:10:14 --> DeadExn.res:4:2 - addValueReference DeadExn.res:12:7 --> DeadExn.res:10:4 + addValueReference DeadExn.res:12:12 --> DeadExn.res:10:4 Scanning DeadExn.cmti Source:DeadExn.resi Scanning DeadRT.cmt Source:DeadRT.res addValueDeclaration +emitModuleAccessPath DeadRT.res:5:8 path:+DeadRT @@ -73,7 +73,7 @@ addVariantCaseDeclaration Kaboom DeadRT.res:3:2 path:+DeadRT.moduleAccessPath addValueReference DeadRT.res:5:8 --> DeadRT.res:7:9 addValueReference DeadRT.res:5:8 --> DeadRT.res:5:31 - addTypeReference DeadRT.res:11:16 --> DeadRT.res:3:2 + addTypeReference DeadRT.res:11:21 --> DeadRT.res:3:2 Scanning DeadRT.cmti Source:DeadRT.resi addVariantCaseDeclaration Root DeadRT.resi:2:2 path:DeadRT.moduleAccessPath extendTypeDependencies DeadRT.res:2:2 --> DeadRT.resi:2:2 @@ -118,7 +118,7 @@ addValueDeclaration +funWithInnerVars DeadTest.res:145:4 path:+DeadTest addValueDeclaration +deadIncorrect DeadTest.res:154:4 path:+DeadTest addValueDeclaration +ira DeadTest.res:160:4 path:+DeadTest - addValueReference DeadTest.res:1:15 --> ImmutableArray.resi:9:0 + addValueReference DeadTest.res:1:20 --> ImmutableArray.resi:9:0 addValueReference DeadTest.res:8:7 --> DeadTest.res:7:4 addValueReference DeadTest.res:11:7 --> DeadTest.res:10:4 addValueReference DeadTest.res:12:7 --> DeadTest.res:10:4 @@ -149,8 +149,8 @@ addValueDeclaration +x DeadTest.res:64:6 path:+DeadTest.MM addValueReference DeadTest.res:64:6 --> DeadTest.res:63:6 addValueDeclaration +valueOnlyInImplementation DeadTest.res:65:6 path:+DeadTest.MM - addValueReference DeadTest.res:69:9 --> DeadTest.res:60:2 - addValueReference DeadTest.res:73:16 --> DeadValueTest.resi:1:0 + addValueReference DeadTest.res:69:14 --> DeadTest.res:60:2 + addValueReference DeadTest.res:73:21 --> DeadValueTest.resi:1:0 addValueReference DeadTest.res:75:8 --> DeadTest.res:75:8 addValueReference DeadTest.res:77:8 --> DeadTest.res:77:20 addValueReference DeadTest.res:77:8 --> DeadTest.res:77:8 @@ -166,22 +166,22 @@ addValueReference DeadTest.res:96:4 --> DeadTest.res:96:42 addValueReference DeadTest.res:96:4 --> DeadTest.res:96:24 addValueReference DeadTest.res:96:4 --> DeadTest.res:96:45 - addTypeReference DeadTest.res:98:16 --> DeadRT.resi:2:2 + addTypeReference DeadTest.res:98:21 --> DeadRT.resi:2:2 addValueDeclaration +a1 DeadTest.res:105:6 path:+DeadTest addValueDeclaration +a2 DeadTest.res:106:6 path:+DeadTest addValueDeclaration +a3 DeadTest.res:107:6 path:+DeadTest - addValueReference DeadTest.res:110:17 --> DynamicallyLoadedComponent.res:2:4 + addValueReference DeadTest.res:110:22 --> DynamicallyLoadedComponent.res:2:4 addRecordLabelDeclaration s DeadTest.res:117:12 path:+DeadTest.props addValueReference DeadTest.res:117:32 --> DeadTest.res:117:12 addValueReference DeadTest.res:117:19 --> React.res:7:0 addTypeReference _none_:1:-1 --> DeadTest.res:117:12 - addValueReference DeadTest.res:119:16 --> DeadTest.res:117:4 + addValueReference DeadTest.res:119:21 --> DeadTest.res:117:4 addVariantCaseDeclaration A DeadTest.res:134:11 path:+DeadTest.WithInclude.t addVariantCaseDeclaration A DeadTest.res:137:13 path:+DeadTest.WithInclude.T.t addVariantCaseDeclaration A DeadTest.res:137:13 path:+DeadTest.WithInclude.t extendTypeDependencies DeadTest.res:137:13 --> DeadTest.res:134:11 extendTypeDependencies DeadTest.res:134:11 --> DeadTest.res:137:13 - addTypeReference DeadTest.res:142:7 --> DeadTest.res:134:11 + addTypeReference DeadTest.res:142:12 --> DeadTest.res:134:11 addValueDeclaration +x DeadTest.res:146:6 path:+DeadTest addValueDeclaration +y DeadTest.res:147:6 path:+DeadTest addValueReference DeadTest.res:145:4 --> DeadTest.res:146:6 @@ -1066,7 +1066,7 @@ addValueDeclaration +ddjdj ModuleExceptionBug.res:7:4 path:+ModuleExceptionBug addValueReference ModuleExceptionBug.res:2:6 --> ModuleExceptionBug.res:2:21 addExceptionDeclaration MyOtherException ModuleExceptionBug.res:5:0 path:+ModuleExceptionBug - addValueReference ModuleExceptionBug.res:8:7 --> ModuleExceptionBug.res:7:4 + addValueReference ModuleExceptionBug.res:8:12 --> ModuleExceptionBug.res:7:4 Scanning NestedModules.cmt Source:NestedModules.res addValueDeclaration +notNested NestedModules.res:2:4 path:+NestedModules addValueDeclaration +theAnswer NestedModules.res:6:6 path:+NestedModules.Universe @@ -1168,9 +1168,9 @@ addValueReference Newton.res:29:4 --> Newton.res:25:4 addValueReference Newton.res:29:4 --> Newton.res:27:4 addValueReference Newton.res:29:4 --> Newton.res:6:4 - addValueReference Newton.res:31:8 --> Newton.res:29:4 - addValueReference Newton.res:31:18 --> Newton.res:29:4 - addValueReference Newton.res:31:16 --> Newton.res:25:4 + addValueReference Newton.res:31:13 --> Newton.res:29:4 + addValueReference Newton.res:31:23 --> Newton.res:29:4 + addValueReference Newton.res:31:21 --> Newton.res:25:4 Scanning Opaque.cmt Source:Opaque.res addValueDeclaration +noConversion Opaque.res:5:4 path:+Opaque addValueDeclaration +testConvertNestedRecordFromOtherFile Opaque.res:11:4 path:+Opaque @@ -1195,10 +1195,10 @@ addValueReference OptArg.res:1:4 --> OptArg.res:1:29 addValueReference OptArg.res:3:4 --> OptArg.res:3:17 addValueReference OptArg.res:3:4 --> OptArg.res:3:27 - DeadOptionalArgs.addReferences foo called with optional argNames:x argNamesMaybe: OptArg.res:5:7 - addValueReference OptArg.res:5:7 --> OptArg.res:1:4 - DeadOptionalArgs.addReferences bar called with optional argNames: argNamesMaybe: OptArg.res:7:7 - addValueReference OptArg.res:7:7 --> OptArg.res:3:4 + DeadOptionalArgs.addReferences foo called with optional argNames:x argNamesMaybe: OptArg.res:5:12 + addValueReference OptArg.res:5:12 --> OptArg.res:1:4 + DeadOptionalArgs.addReferences bar called with optional argNames: argNamesMaybe: OptArg.res:7:12 + addValueReference OptArg.res:7:12 --> OptArg.res:3:4 addValueReference OptArg.res:9:4 --> OptArg.res:9:20 addValueReference OptArg.res:9:4 --> OptArg.res:9:26 addValueReference OptArg.res:9:4 --> OptArg.res:9:32 @@ -1206,17 +1206,17 @@ addValueReference OptArg.res:9:4 --> OptArg.res:9:23 addValueReference OptArg.res:9:4 --> OptArg.res:9:29 addValueReference OptArg.res:9:4 --> OptArg.res:9:35 - DeadOptionalArgs.addReferences threeArgs called with optional argNames:c, a argNamesMaybe: OptArg.res:11:7 - addValueReference OptArg.res:11:7 --> OptArg.res:9:4 - DeadOptionalArgs.addReferences threeArgs called with optional argNames:a argNamesMaybe: OptArg.res:12:7 - addValueReference OptArg.res:12:7 --> OptArg.res:9:4 + DeadOptionalArgs.addReferences threeArgs called with optional argNames:c, a argNamesMaybe: OptArg.res:11:12 + addValueReference OptArg.res:11:12 --> OptArg.res:9:4 + DeadOptionalArgs.addReferences threeArgs called with optional argNames:a argNamesMaybe: OptArg.res:12:12 + addValueReference OptArg.res:12:12 --> OptArg.res:9:4 addValueReference OptArg.res:14:4 --> OptArg.res:14:18 addValueReference OptArg.res:14:4 --> OptArg.res:14:24 addValueReference OptArg.res:14:4 --> OptArg.res:14:15 addValueReference OptArg.res:14:4 --> OptArg.res:14:21 addValueReference OptArg.res:14:4 --> OptArg.res:14:27 - DeadOptionalArgs.addReferences twoArgs called with optional argNames: argNamesMaybe: OptArg.res:16:7 - addValueReference OptArg.res:16:12 --> OptArg.res:14:4 + DeadOptionalArgs.addReferences twoArgs called with optional argNames: argNamesMaybe: OptArg.res:16:12 + addValueReference OptArg.res:16:17 --> OptArg.res:14:4 addValueReference OptArg.res:18:4 --> OptArg.res:18:17 addValueReference OptArg.res:18:4 --> OptArg.res:18:14 addValueReference OptArg.res:18:4 --> OptArg.res:18:24 @@ -1224,8 +1224,8 @@ addValueReference OptArg.res:20:4 --> OptArg.res:20:18 addValueReference OptArg.res:20:4 --> OptArg.res:20:24 addValueReference OptArg.res:20:4 --> OptArg.res:18:4 - DeadOptionalArgs.addReferences wrapOneArg called with optional argNames:a argNamesMaybe: OptArg.res:22:7 - addValueReference OptArg.res:22:7 --> OptArg.res:20:4 + DeadOptionalArgs.addReferences wrapOneArg called with optional argNames:a argNamesMaybe: OptArg.res:22:12 + addValueReference OptArg.res:22:12 --> OptArg.res:20:4 addValueReference OptArg.res:24:4 --> OptArg.res:24:19 addValueReference OptArg.res:24:4 --> OptArg.res:24:25 addValueReference OptArg.res:24:4 --> OptArg.res:24:31 @@ -1241,10 +1241,10 @@ addValueReference OptArg.res:26:4 --> OptArg.res:26:32 addValueReference OptArg.res:26:4 --> OptArg.res:26:38 addValueReference OptArg.res:26:4 --> OptArg.res:24:4 - DeadOptionalArgs.addReferences wrapfourArgs called with optional argNames:c, a argNamesMaybe: OptArg.res:28:7 - addValueReference OptArg.res:28:7 --> OptArg.res:26:4 - DeadOptionalArgs.addReferences wrapfourArgs called with optional argNames:c, b argNamesMaybe: OptArg.res:29:7 - addValueReference OptArg.res:29:7 --> OptArg.res:26:4 + DeadOptionalArgs.addReferences wrapfourArgs called with optional argNames:c, a argNamesMaybe: OptArg.res:28:12 + addValueReference OptArg.res:28:12 --> OptArg.res:26:4 + DeadOptionalArgs.addReferences wrapfourArgs called with optional argNames:c, b argNamesMaybe: OptArg.res:29:12 + addValueReference OptArg.res:29:12 --> OptArg.res:26:4 addValueReference OptArg.resi:1:0 --> OptArg.res:1:4 OptionalArgs.addFunctionReference OptArg.resi:1:0 OptArg.res:1:4 addValueReference OptArg.resi:2:0 --> OptArg.res:3:4 @@ -1392,7 +1392,7 @@ addValueReference RepeatedLabel.res:12:4 --> RepeatedLabel.res:12:20 addTypeReference RepeatedLabel.res:12:16 --> RepeatedLabel.res:7:2 addTypeReference RepeatedLabel.res:12:16 --> RepeatedLabel.res:8:2 - addValueReference RepeatedLabel.res:14:7 --> RepeatedLabel.res:12:4 + addValueReference RepeatedLabel.res:14:12 --> RepeatedLabel.res:12:4 Scanning RequireCond.cmt Source:RequireCond.res Scanning Shadow.cmt Source:Shadow.res addValueDeclaration +test Shadow.res:2:4 path:+Shadow @@ -1450,14 +1450,14 @@ addValueDeclaration +bar TestOptArg.res:5:4 path:+TestOptArg addValueDeclaration +notSuppressesOptArgs TestOptArg.res:9:4 path:+TestOptArg addValueDeclaration +liveSuppressesOptArgs TestOptArg.res:14:4 path:+TestOptArg - DeadOptionalArgs.addReferences OptArg.bar called with optional argNames:z argNamesMaybe: TestOptArg.res:1:7 - addValueReference TestOptArg.res:1:7 --> OptArg.resi:2:0 + DeadOptionalArgs.addReferences OptArg.bar called with optional argNames:z argNamesMaybe: TestOptArg.res:1:12 + addValueReference TestOptArg.res:1:12 --> OptArg.resi:2:0 addValueReference TestOptArg.res:3:4 --> TestOptArg.res:3:14 addValueReference TestOptArg.res:3:4 --> TestOptArg.res:3:11 addValueReference TestOptArg.res:3:4 --> TestOptArg.res:3:17 DeadOptionalArgs.addReferences foo called with optional argNames:x argNamesMaybe: TestOptArg.res:5:16 addValueReference TestOptArg.res:5:4 --> TestOptArg.res:3:4 - addValueReference TestOptArg.res:7:7 --> TestOptArg.res:5:4 + addValueReference TestOptArg.res:7:12 --> TestOptArg.res:5:4 addValueReference TestOptArg.res:9:4 --> TestOptArg.res:9:31 addValueReference TestOptArg.res:9:4 --> TestOptArg.res:9:37 addValueReference TestOptArg.res:9:4 --> TestOptArg.res:9:43 @@ -1749,18 +1749,18 @@ addRecordLabelDeclaration x VariantsWithPayload.res:2:2 path:+VariantsWithPayload.payload addRecordLabelDeclaration y VariantsWithPayload.res:3:2 path:+VariantsWithPayload.payload addValueReference VariantsWithPayload.res:16:4 --> VariantsWithPayload.res:16:23 - addTypeReference VariantsWithPayload.res:26:57 --> VariantsWithPayload.res:2:2 + addTypeReference VariantsWithPayload.res:26:62 --> VariantsWithPayload.res:2:2 addValueReference VariantsWithPayload.res:19:4 --> VariantsWithPayload.res:26:7 - addTypeReference VariantsWithPayload.res:26:74 --> VariantsWithPayload.res:3:2 + addTypeReference VariantsWithPayload.res:26:79 --> VariantsWithPayload.res:3:2 addValueReference VariantsWithPayload.res:19:4 --> VariantsWithPayload.res:26:7 addValueReference VariantsWithPayload.res:19:4 --> VariantsWithPayload.res:19:31 addValueReference VariantsWithPayload.res:37:4 --> VariantsWithPayload.res:37:24 addValueReference VariantsWithPayload.res:40:4 --> VariantsWithPayload.res:42:9 addValueReference VariantsWithPayload.res:40:4 --> VariantsWithPayload.res:43:9 addValueReference VariantsWithPayload.res:40:4 --> VariantsWithPayload.res:43:13 - addTypeReference VariantsWithPayload.res:44:55 --> VariantsWithPayload.res:2:2 + addTypeReference VariantsWithPayload.res:44:60 --> VariantsWithPayload.res:2:2 addValueReference VariantsWithPayload.res:40:4 --> VariantsWithPayload.res:44:11 - addTypeReference VariantsWithPayload.res:44:72 --> VariantsWithPayload.res:3:2 + addTypeReference VariantsWithPayload.res:44:77 --> VariantsWithPayload.res:3:2 addValueReference VariantsWithPayload.res:40:4 --> VariantsWithPayload.res:44:11 addValueReference VariantsWithPayload.res:40:4 --> VariantsWithPayload.res:40:25 addVariantCaseDeclaration A VariantsWithPayload.res:49:2 path:+VariantsWithPayload.simpleVariant @@ -1789,7 +1789,7 @@ Implementation 0 Implementation 0 Implementation 0 - addValueReference TestDeadExn.res:1:7 --> DeadExn.res:1:0 + addValueReference TestDeadExn.res:1:12 --> DeadExn.res:1:0 File References @@ -1893,8 +1893,8 @@ File References Live Value +CreateErrorHandler2.Error2.+notification: 1 references (ErrorHandler.resi:3:2) [0] Live Value +DeadCodeImplementation.M.+x: 1 references (DeadCodeInterface.res:2:2) [0] Dead Value +DeadRT.+emitModuleAccessPath: 0 references () [0] - Live VariantCase +DeadRT.moduleAccessPath.Kaboom: 1 references (DeadRT.res:11:16) [0] - Live VariantCase DeadRT.moduleAccessPath.Root: 1 references (DeadTest.res:98:16) [1] + Live VariantCase +DeadRT.moduleAccessPath.Kaboom: 1 references (DeadRT.res:11:21) [0] + Live VariantCase DeadRT.moduleAccessPath.Root: 1 references (DeadTest.res:98:21) [1] Live VariantCase +DeadRT.moduleAccessPath.Root: 1 references (DeadRT.resi:2:2) [0] Live VariantCase DeadRT.moduleAccessPath.Kaboom: 1 references (DeadRT.res:3:2) [0] Dead RecordLabel +DeadTest.inlineRecord3.IR3.b: 0 references () [0] @@ -1917,7 +1917,7 @@ File References Dead Value +DeadTest.+funWithInnerVars: 0 references () [1] Dead Value +DeadTest.+y: 0 references () [0] Dead Value +DeadTest.+x: 0 references () [0] - Live VariantCase +DeadTest.WithInclude.t.A: 1 references (DeadTest.res:142:7) [1] + Live VariantCase +DeadTest.WithInclude.t.A: 1 references (DeadTest.res:142:12) [1] Live VariantCase +DeadTest.WithInclude.t.A: 1 references (DeadTest.res:134:11) [0] Live Value +DeadTest.GloobLive.+globallyLive3: 0 references () [0] Live Value +DeadTest.GloobLive.+globallyLive2: 0 references () [0] @@ -1925,7 +1925,7 @@ File References Dead Value +DeadTest.+stringLengthNoSideEffects: 0 references () [0] Dead Value +DeadTest.+theSideEffectIsLogging: 0 references () [0] Live RecordLabel +DeadTest.props.s: 1 references (_none_:1:-1) [0] - Live Value +DeadTest.+make: 1 references (DeadTest.res:119:16) [0] + Live Value +DeadTest.+make: 1 references (DeadTest.res:119:21) [0] Dead Value +DeadTest.+deadRef: 0 references () [0] Dead Value +DeadTest.+second: 0 references () [0] Dead Value +DeadTest.+a3: 0 references () [0] @@ -1943,7 +1943,7 @@ File References Dead Value +DeadTest.+split_map: 0 references () [0] Dead Value +DeadTest.+unusedRec: 0 references () [0] Dead Value +DeadTest.MM.+valueOnlyInImplementation: 0 references () [0] - Live Value +DeadTest.MM.+x: 1 references (DeadTest.res:69:9) [1] + Live Value +DeadTest.MM.+x: 1 references (DeadTest.res:69:14) [1] Live Value +DeadTest.MM.+x: 1 references (DeadTest.res:60:2) [0] Dead Value +DeadTest.MM.+y: 0 references () [1] Live Value +DeadTest.MM.+y: 1 references (DeadTest.res:64:6) [0] @@ -2052,7 +2052,7 @@ File References Dead RecordLabel +ModuleAliases2.Outer.outer.outer: 0 references () [0] Dead RecordLabel +ModuleAliases2.record.y: 0 references () [0] Dead RecordLabel +ModuleAliases2.record.x: 0 references () [0] - Live Value +ModuleExceptionBug.+ddjdj: 1 references (ModuleExceptionBug.res:8:7) [0] + Live Value +ModuleExceptionBug.+ddjdj: 1 references (ModuleExceptionBug.res:8:12) [0] Dead Exception +ModuleExceptionBug.MyOtherException: 0 references () [0] Dead Value +ModuleExceptionBug.Dep.+customDouble: 0 references () [0] Live Value +NestedModules.Universe.+someString: 0 references () [0] @@ -2081,9 +2081,9 @@ File References Dead RecordLabel +Newsyntax.record.xxx: 0 references () [0] Dead Value +Newsyntax.+y: 0 references () [0] Dead Value +Newsyntax.+x: 0 references () [0] - Live Value +Newton.+result: 2 references (Newton.res:31:8, Newton.res:31:18) [0] + Live Value +Newton.+result: 2 references (Newton.res:31:13, Newton.res:31:23) [0] Live Value +Newton.+fPrimed: 1 references (Newton.res:29:4) [0] - Live Value +Newton.+f: 2 references (Newton.res:29:4, Newton.res:31:16) [0] + Live Value +Newton.+f: 2 references (Newton.res:29:4, Newton.res:31:21) [0] Live Value +Newton.+newton: 1 references (Newton.res:29:4) [2] Live Value +Newton.+loop: 1 references (Newton.res:6:4) [1] Live Value +Newton.+next: 1 references (Newton.res:14:10) [0] @@ -2153,7 +2153,7 @@ File References Live Value +References.+update: 0 references () [0] Live Value +References.+access: 0 references () [0] Live Value +References.+create: 0 references () [0] - Live Value +RepeatedLabel.+userData: 1 references (RepeatedLabel.res:14:7) [0] + Live Value +RepeatedLabel.+userData: 1 references (RepeatedLabel.res:14:12) [0] Dead RecordLabel +RepeatedLabel.tabState.f: 0 references () [0] Live RecordLabel +RepeatedLabel.tabState.b: 1 references (RepeatedLabel.res:12:16) [0] Live RecordLabel +RepeatedLabel.tabState.a: 1 references (RepeatedLabel.res:12:16) [0] @@ -2189,7 +2189,7 @@ File References Live Value +TestModuleAliases.+testInner1: 0 references () [0] Live Value +TestOptArg.+liveSuppressesOptArgs: 1 references (TestOptArg.res:16:8) [0] Live Value +TestOptArg.+notSuppressesOptArgs: 1 references (TestOptArg.res:11:8) [0] - Live Value +TestOptArg.+bar: 1 references (TestOptArg.res:7:7) [0] + Live Value +TestOptArg.+bar: 1 references (TestOptArg.res:7:12) [0] Live Value +TestOptArg.+foo: 1 references (TestOptArg.res:5:4) [0] Live Value +TestPromise.+convert: 0 references () [0] Dead RecordLabel +TestPromise.toPayload.result: 0 references () [0] @@ -2318,9 +2318,9 @@ File References Live Value +VariantsWithPayload.+testManyPayloads: 0 references () [0] Live Value +VariantsWithPayload.+printVariantWithPayload: 0 references () [0] Live Value +VariantsWithPayload.+testWithPayload: 0 references () [0] - Live RecordLabel +VariantsWithPayload.payload.y: 2 references (VariantsWithPayload.res:26:74, VariantsWithPayload.res:44:72) [0] - Live RecordLabel +VariantsWithPayload.payload.x: 2 references (VariantsWithPayload.res:26:57, VariantsWithPayload.res:44:55) [0] - Live Value +DeadExn.+eInside: 1 references (DeadExn.res:12:7) [0] + Live RecordLabel +VariantsWithPayload.payload.y: 2 references (VariantsWithPayload.res:26:79, VariantsWithPayload.res:44:77) [0] + Live RecordLabel +VariantsWithPayload.payload.x: 2 references (VariantsWithPayload.res:26:62, VariantsWithPayload.res:44:60) [0] + Live Value +DeadExn.+eInside: 1 references (DeadExn.res:12:12) [0] Dead Value +DeadExn.+eToplevel: 0 references () [0] Dead Exception +DeadExn.DeadE: 0 references () [0] Live Exception +DeadExn.Inside.Einside: 1 references (DeadExn.res:10:14) [0] @@ -2335,9 +2335,9 @@ File References Dead Value +DeadTypeTest.+a: 0 references () [0] Dead VariantCase +DeadTypeTest.t.B: 0 references () [0] Dead Value DeadValueTest.+valueDead: 0 references () [0] - Live Value DeadValueTest.+valueAlive: 1 references (DeadTest.res:73:16) [0] + Live Value DeadValueTest.+valueAlive: 1 references (DeadTest.res:73:21) [0] Live RecordLabel +DynamicallyLoadedComponent.props.s: 1 references (_none_:1:-1) [0] - Live Value +DynamicallyLoadedComponent.+make: 1 references (DeadTest.res:110:17) [0] + Live Value +DynamicallyLoadedComponent.+make: 1 references (DeadTest.res:110:22) [0] Dead Value ErrorHandler.+x: 0 references () [0] Live Value ErrorHandler.Make.+notify: 1 references (CreateErrorHandler1.res:8:0) [0] Dead Value +FirstClassModulesInterface.+r: 0 references () [0] @@ -2402,7 +2402,7 @@ File References Dead Value ImmutableArray.+size: 0 references () [0] Dead Value ImmutableArray.+length: 0 references () [0] Dead Value ImmutableArray.+toArray: 0 references () [0] - Live Value ImmutableArray.+fromArray: 1 references (DeadTest.res:1:15) [0] + Live Value ImmutableArray.+fromArray: 1 references (DeadTest.res:1:20) [0] Live Value ImmutableArray.Array.+get: 1 references (TestImmutableArray.res:2:4) [0] Live RecordLabel +ImportHookDefault.props.renderMe: 0 references () [0] Live RecordLabel +ImportHookDefault.props.children: 0 references () [0] @@ -2437,7 +2437,7 @@ File References Dead RecordLabel +ImportJsValue.point.x: 0 references () [0] Live Value +ImportJsValue.+round: 1 references (ImportJsValue.res:27:4) [0] Live Value +NestedModulesInSignature.Universe.+theAnswer: 1 references (NestedModulesInSignature.resi:2:2) [0] - Live Value OptArg.+bar: 1 references (TestOptArg.res:1:7) [0] + Live Value OptArg.+bar: 1 references (TestOptArg.res:1:12) [0] Dead Value OptArg.+foo: 0 references () [0] Dead Value +DeadValueTest.+tail: 0 references () [0] Dead Value +DeadValueTest.+subList: 0 references () [0] @@ -2506,14 +2506,14 @@ File References Dead Value +ImmutableArray.+length: 0 references () [0] Dead Value +ImmutableArray.+toArray: 0 references () [0] Live Value +ImmutableArray.+fromArray: 1 references (ImmutableArray.resi:9:0) [0] - Live Value +OptArg.+wrapfourArgs: 2 references (OptArg.res:28:7, OptArg.res:29:7) [0] + Live Value +OptArg.+wrapfourArgs: 2 references (OptArg.res:28:12, OptArg.res:29:12) [0] Live Value +OptArg.+fourArgs: 1 references (OptArg.res:26:4) [0] - Live Value +OptArg.+wrapOneArg: 1 references (OptArg.res:22:7) [0] + Live Value +OptArg.+wrapOneArg: 1 references (OptArg.res:22:12) [0] Live Value +OptArg.+oneArg: 1 references (OptArg.res:20:4) [0] - Live Value +OptArg.+twoArgs: 1 references (OptArg.res:16:12) [0] - Live Value +OptArg.+threeArgs: 2 references (OptArg.res:11:7, OptArg.res:12:7) [0] - Live Value +OptArg.+bar: 2 references (OptArg.res:7:7, OptArg.resi:2:0) [0] - Live Value +OptArg.+foo: 1 references (OptArg.res:5:7) [0] + Live Value +OptArg.+twoArgs: 1 references (OptArg.res:16:17) [0] + Live Value +OptArg.+threeArgs: 2 references (OptArg.res:11:12, OptArg.res:12:12) [0] + Live Value +OptArg.+bar: 2 references (OptArg.res:7:12, OptArg.resi:2:0) [0] + Live Value +OptArg.+foo: 1 references (OptArg.res:5:12) [0] Incorrect Dead Annotation DeadTest.res:153:1-28 @@ -2752,7 +2752,7 @@ File References @dead("deadRef") let deadRef = ref(12) Warning Dead Value With Side Effects - DeadTest.res:121:1-40 + DeadTest.res:121:1-45 theSideEffectIsLogging is never used and could have side effects Warning Dead Value With Side Effects diff --git a/tests/analysis_tests/tests-reanalyze/deadcode/src/DeadExn.res b/tests/analysis_tests/tests-reanalyze/deadcode/src/DeadExn.res index 3f68ffce74..547bb1bcb3 100644 --- a/tests/analysis_tests/tests-reanalyze/deadcode/src/DeadExn.res +++ b/tests/analysis_tests/tests-reanalyze/deadcode/src/DeadExn.res @@ -9,5 +9,5 @@ let eToplevel = Etoplevel let eInside = Inside.Einside -Js.log(eInside) +Console.log(eInside) diff --git a/tests/analysis_tests/tests-reanalyze/deadcode/src/DeadRT.res b/tests/analysis_tests/tests-reanalyze/deadcode/src/DeadRT.res index be16b074f3..1e5414f77e 100644 --- a/tests/analysis_tests/tests-reanalyze/deadcode/src/DeadRT.res +++ b/tests/analysis_tests/tests-reanalyze/deadcode/src/DeadRT.res @@ -8,5 +8,5 @@ let rec emitModuleAccessPath = moduleAccessPath => | Kaboom => "" } -let () = Js.log(Kaboom) +let () = Console.log(Kaboom) diff --git a/tests/analysis_tests/tests-reanalyze/deadcode/src/DeadTest.res b/tests/analysis_tests/tests-reanalyze/deadcode/src/DeadTest.res index 61b320568b..a700d78b52 100644 --- a/tests/analysis_tests/tests-reanalyze/deadcode/src/DeadTest.res +++ b/tests/analysis_tests/tests-reanalyze/deadcode/src/DeadTest.res @@ -1,4 +1,4 @@ -let _ = Js.log(ImmutableArray.fromArray) +let _ = Console.log(ImmutableArray.fromArray) let fortytwo = 42 @genType @@ -66,11 +66,11 @@ module MM: { } let _ = { - Js.log(MM.x) + Console.log(MM.x) 44 } -let () = Js.log(DeadValueTest.valueAlive) +let () = Console.log(DeadValueTest.valueAlive) let rec unusedRec = () => unusedRec() @@ -95,7 +95,7 @@ and bar = () => foo() let withDefaultValue = (~paramWithDefault=3, y) => paramWithDefault + y -let () = Js.log(DeadRT.Root("xzz")) +let () = Console.log(DeadRT.Root("xzz")) module type LocalDynamicallyLoadedComponent2 = module type of DynamicallyLoadedComponent @@ -107,7 +107,7 @@ let zzz = { let a3 = 3 } -let () = Js.log() +let () = Console.log() let second = 1 @@ -116,9 +116,9 @@ let deadRef = ref(12) @react.component let make = (~s) => React.string(s) -let () = Js.log(make) +let () = Console.log(make) -let theSideEffectIsLogging = Js.log(123) +let theSideEffectIsLogging = Console.log(123) let stringLengthNoSideEffects = String.length("sdkdl") @@ -139,7 +139,7 @@ module WithInclude: { include T } -Js.log(WithInclude.A) +Console.log(WithInclude.A) @dead let funWithInnerVars = () => { diff --git a/tests/analysis_tests/tests-reanalyze/deadcode/src/ModuleExceptionBug.res b/tests/analysis_tests/tests-reanalyze/deadcode/src/ModuleExceptionBug.res index f9b36ce235..7ac327b39b 100644 --- a/tests/analysis_tests/tests-reanalyze/deadcode/src/ModuleExceptionBug.res +++ b/tests/analysis_tests/tests-reanalyze/deadcode/src/ModuleExceptionBug.res @@ -5,4 +5,4 @@ module Dep = { exception MyOtherException let ddjdj = 34 -Js.log(ddjdj) +Console.log(ddjdj) diff --git a/tests/analysis_tests/tests-reanalyze/deadcode/src/Newton.res b/tests/analysis_tests/tests-reanalyze/deadcode/src/Newton.res index ce8f338890..5536fdb17e 100644 --- a/tests/analysis_tests/tests-reanalyze/deadcode/src/Newton.res +++ b/tests/analysis_tests/tests-reanalyze/deadcode/src/Newton.res @@ -28,5 +28,5 @@ let fPrimed = x => 3.0 * x * x - 4.0 * x - 11.0 let result = newton(~f, ~fPrimed, ~initial=5.0, ~threshold=0.0003) -Js.log2(result, f(result)) +Console.log2(result, f(result)) diff --git a/tests/analysis_tests/tests-reanalyze/deadcode/src/OptArg.res b/tests/analysis_tests/tests-reanalyze/deadcode/src/OptArg.res index a556a52c0f..1768d4b1e5 100644 --- a/tests/analysis_tests/tests-reanalyze/deadcode/src/OptArg.res +++ b/tests/analysis_tests/tests-reanalyze/deadcode/src/OptArg.res @@ -2,29 +2,29 @@ let foo = (~x=1, ~y=2, ~z=3, w) => x + y + z + w let bar = (~x=?, ~y, ~z=?, w) => y + w -Js.log(foo(~x=3, 4)) +Console.log(foo(~x=3, 4)) -Js.log(bar(~y=3, 4)) +Console.log(bar(~y=3, 4)) let threeArgs = (~a=1, ~b=2, ~c=3, d) => a + b + c + d -Js.log(threeArgs(~a=4, ~c=7, 1)) -Js.log(threeArgs(~a=4, 1)) +Console.log(threeArgs(~a=4, ~c=7, 1)) +Console.log(threeArgs(~a=4, 1)) let twoArgs = (~a=1, ~b=2, c) => a + b + c -Js.log(1 |> twoArgs) +Console.log(1 |> twoArgs) let oneArg = (~a=1, ~z, b) => a + b let wrapOneArg = (~a=?, n) => oneArg(~a?, ~z=33, n) -Js.log(wrapOneArg(~a=3, 44)) +Console.log(wrapOneArg(~a=3, 44)) let fourArgs = (~a=1, ~b=2, ~c=3, ~d=4, n) => a + b + c + d + n let wrapfourArgs = (~a=?, ~b=?, ~c=?, n) => fourArgs(~a?, ~b?, ~c?, n) -Js.log(wrapfourArgs(~a=3, ~c=44, 44)) -Js.log(wrapfourArgs(~b=4, ~c=44, 44)) +Console.log(wrapfourArgs(~a=3, ~c=44, 44)) +Console.log(wrapfourArgs(~b=4, ~c=44, 44)) diff --git a/tests/analysis_tests/tests-reanalyze/deadcode/src/RepeatedLabel.res b/tests/analysis_tests/tests-reanalyze/deadcode/src/RepeatedLabel.res index 3c0b6ddeb9..1efb1efd1c 100644 --- a/tests/analysis_tests/tests-reanalyze/deadcode/src/RepeatedLabel.res +++ b/tests/analysis_tests/tests-reanalyze/deadcode/src/RepeatedLabel.res @@ -11,5 +11,5 @@ type tabState = { let userData = ({a, b}): userData => {a: a, b: b} -Js.log(userData) +Console.log(userData) diff --git a/tests/analysis_tests/tests-reanalyze/deadcode/src/TestDeadExn.res b/tests/analysis_tests/tests-reanalyze/deadcode/src/TestDeadExn.res index 7810b9ccf3..e05edf2505 100644 --- a/tests/analysis_tests/tests-reanalyze/deadcode/src/TestDeadExn.res +++ b/tests/analysis_tests/tests-reanalyze/deadcode/src/TestDeadExn.res @@ -1,2 +1,2 @@ -Js.log(DeadExn.Etoplevel) +Console.log(DeadExn.Etoplevel) diff --git a/tests/analysis_tests/tests-reanalyze/deadcode/src/TestOptArg.res b/tests/analysis_tests/tests-reanalyze/deadcode/src/TestOptArg.res index ef38c7c7ec..53ce173fb7 100644 --- a/tests/analysis_tests/tests-reanalyze/deadcode/src/TestOptArg.res +++ b/tests/analysis_tests/tests-reanalyze/deadcode/src/TestOptArg.res @@ -1,10 +1,10 @@ -Js.log(OptArg.bar(~z=3, ~y=3, 4)) +Console.log(OptArg.bar(~z=3, ~y=3, 4)) let foo = (~x=3, y) => x + y let bar = () => foo(~x=12, 3) -Js.log(bar) +Console.log(bar) let notSuppressesOptArgs = (~x=1, ~y=2, ~z=3, w) => x + y + z + w diff --git a/tests/analysis_tests/tests-reanalyze/deadcode/src/Uncurried.res b/tests/analysis_tests/tests-reanalyze/deadcode/src/Uncurried.res index cf85f9d9cd..211f3c937b 100644 --- a/tests/analysis_tests/tests-reanalyze/deadcode/src/Uncurried.res +++ b/tests/analysis_tests/tests-reanalyze/deadcode/src/Uncurried.res @@ -38,20 +38,20 @@ let callback2 = auth => auth.login() let callback2U = auth => auth.loginU(.) @genType -let sumU = (. n, m) => Js.log4("sumU 2nd arg", m, "result", n + m) +let sumU = (. n, m) => Console.log4("sumU 2nd arg", m, "result", n + m) @genType -let sumU2 = (. n, . m) => Js.log4("sumU2 2nd arg", m, "result", n + m) +let sumU2 = (. n, . m) => Console.log4("sumU2 2nd arg", m, "result", n + m) @genType let sumCurried = n => { - Js.log2("sumCurried 1st arg", n) - m => Js.log4("sumCurried 2nd arg", m, "result", n + m) + Console.log2("sumCurried 1st arg", n) + m => Console.log4("sumCurried 2nd arg", m, "result", n + m) } @genType let sumLblCurried = (s: string, ~n) => { - Js.log3(s, "sumLblCurried 1st arg", n) - (~m) => Js.log4("sumLblCurried 2nd arg", m, "result", n + m) + Console.log3(s, "sumLblCurried 1st arg", n) + (~m) => Console.log4("sumLblCurried 2nd arg", m, "result", n + m) } diff --git a/tests/analysis_tests/tests-reanalyze/deadcode/src/VariantsWithPayload.res b/tests/analysis_tests/tests-reanalyze/deadcode/src/VariantsWithPayload.res index 4da94ed578..def8d27679 100644 --- a/tests/analysis_tests/tests-reanalyze/deadcode/src/VariantsWithPayload.res +++ b/tests/analysis_tests/tests-reanalyze/deadcode/src/VariantsWithPayload.res @@ -18,12 +18,12 @@ let testWithPayload = (x: withPayload) => x @genType let printVariantWithPayload = (x: withPayload) => switch x { - | #a => Js.log("printVariantWithPayload: a") - | #b => Js.log("printVariantWithPayload: b") - | #True => Js.log("printVariantWithPayload: True") - | #Twenty => Js.log("printVariantWithPayload: Twenty") - | #Half => Js.log("printVariantWithPayload: Half") - | #c(payload) => Js.log4("printVariantWithPayload x:", payload.x, "y:", payload.y) + | #a => Console.log("printVariantWithPayload: a") + | #b => Console.log("printVariantWithPayload: b") + | #True => Console.log("printVariantWithPayload: True") + | #Twenty => Console.log("printVariantWithPayload: Twenty") + | #Half => Console.log("printVariantWithPayload: Half") + | #c(payload) => Console.log4("printVariantWithPayload x:", payload.x, "y:", payload.y) } @genType @@ -39,9 +39,9 @@ let testManyPayloads = (x: manyPayloads) => x @genType let printManyPayloads = (x: manyPayloads) => switch x { - | #one(n) => Js.log2("printManyPayloads one:", n) - | #two(s1, s2) => Js.log3("printManyPayloads two:", s1, s2) - | #three(payload) => Js.log4("printManyPayloads x:", payload.x, "y:", payload.y) + | #one(n) => Console.log2("printManyPayloads one:", n) + | #two(s1, s2) => Console.log3("printManyPayloads two:", s1, s2) + | #three(payload) => Console.log4("printManyPayloads x:", payload.x, "y:", payload.y) } @genType @@ -67,20 +67,20 @@ let testVariantWithPayloads = (x: variantWithPayloads) => x @genType let printVariantWithPayloads = x => switch x { - | A => Js.log2("printVariantWithPayloads", "A") - | B(x) => Js.log2("printVariantWithPayloads", "B(" ++ (string_of_int(x) ++ ")")) + | A => Console.log2("printVariantWithPayloads", "A") + | B(x) => Console.log2("printVariantWithPayloads", "B(" ++ (string_of_int(x) ++ ")")) | C(x, y) => - Js.log2( + Console.log2( "printVariantWithPayloads", "C(" ++ (string_of_int(x) ++ (", " ++ (string_of_int(y) ++ ")"))), ) | D((x, y)) => - Js.log2( + Console.log2( "printVariantWithPayloads", "D((" ++ (string_of_int(x) ++ (", " ++ (string_of_int(y) ++ "))"))), ) | E(x, s, y) => - Js.log2( + Console.log2( "printVariantWithPayloads", "E(" ++ (string_of_int(x) ++ (", " ++ (s ++ (", " ++ (string_of_int(y) ++ ")"))))), ) diff --git a/tests/build_tests/case/src/demo.res b/tests/build_tests/case/src/demo.res index 8d0b19151f..3bfb9a1da2 100644 --- a/tests/build_tests/case/src/demo.res +++ b/tests/build_tests/case/src/demo.res @@ -1 +1 @@ -let () = Js.log("Hello, ReScript") +let () = Console.log("Hello, ReScript") diff --git a/tests/build_tests/case2/src/X.res b/tests/build_tests/case2/src/X.res index 8d0b19151f..3bfb9a1da2 100644 --- a/tests/build_tests/case2/src/X.res +++ b/tests/build_tests/case2/src/X.res @@ -1 +1 @@ -let () = Js.log("Hello, ReScript") +let () = Console.log("Hello, ReScript") diff --git a/tests/build_tests/deprecated-package-specs/src/Index.res b/tests/build_tests/deprecated-package-specs/src/Index.res index 8d0b19151f..3bfb9a1da2 100644 --- a/tests/build_tests/deprecated-package-specs/src/Index.res +++ b/tests/build_tests/deprecated-package-specs/src/Index.res @@ -1 +1 @@ -let () = Js.log("Hello, ReScript") +let () = Console.log("Hello, ReScript") diff --git a/tests/build_tests/devonly/src/demo.res b/tests/build_tests/devonly/src/demo.res index dda4ba39eb..df948c53dc 100644 --- a/tests/build_tests/devonly/src/demo.res +++ b/tests/build_tests/devonly/src/demo.res @@ -1 +1 @@ -let () = Js.log(Depdemo.a) +let () = Console.log(Depdemo.a) diff --git a/tests/build_tests/devonly/src2/hellodep.res b/tests/build_tests/devonly/src2/hellodep.res index 382ad1a9a6..a2bc3d182b 100644 --- a/tests/build_tests/devonly/src2/hellodep.res +++ b/tests/build_tests/devonly/src2/hellodep.res @@ -1 +1 @@ -Js.log(Hello.v) +Console.log(Hello.v) diff --git a/tests/build_tests/hyphen2/y-src/demo.res b/tests/build_tests/hyphen2/y-src/demo.res index 8d0b19151f..3bfb9a1da2 100644 --- a/tests/build_tests/hyphen2/y-src/demo.res +++ b/tests/build_tests/hyphen2/y-src/demo.res @@ -1 +1 @@ -let () = Js.log("Hello, ReScript") +let () = Console.log("Hello, ReScript") diff --git a/tests/build_tests/install/src/Foo.res b/tests/build_tests/install/src/Foo.res index 95d72e3b10..bf9a5db140 100644 --- a/tests/build_tests/install/src/Foo.res +++ b/tests/build_tests/install/src/Foo.res @@ -1 +1 @@ -let main = () => Js.log("hello") +let main = () => Console.log("hello") diff --git a/tests/build_tests/ns/src/demo.res b/tests/build_tests/ns/src/demo.res index b4490c8ff9..bb62248e72 100644 --- a/tests/build_tests/ns/src/demo.res +++ b/tests/build_tests/ns/src/demo.res @@ -1 +1 @@ -let () = Js.log(Hello.a + Hello.b) +let () = Console.log(Hello.a + Hello.b) diff --git a/tests/build_tests/post-build/src/demo.res b/tests/build_tests/post-build/src/demo.res index 8d0b19151f..3bfb9a1da2 100644 --- a/tests/build_tests/post-build/src/demo.res +++ b/tests/build_tests/post-build/src/demo.res @@ -1 +1 @@ -let () = Js.log("Hello, ReScript") +let () = Console.log("Hello, ReScript") diff --git a/tests/build_tests/super_errors/expected/dict_magic_field_on_non_dict.res.expected b/tests/build_tests/super_errors/expected/dict_magic_field_on_non_dict.res.expected index 05d88219c2..3a8d4af497 100644 --- a/tests/build_tests/super_errors/expected/dict_magic_field_on_non_dict.res.expected +++ b/tests/build_tests/super_errors/expected/dict_magic_field_on_non_dict.res.expected @@ -4,8 +4,8 @@ 3 │ let foo = (fakeDict: fakeDict<'a>) => { 4 │ switch fakeDict { - 5 │ | {someUndefinedField: 1} => Js.log("one") - 6 │ | _ => Js.log("not one") + 5 │ | {someUndefinedField: 1} => Console.log("one") + 6 │ | _ => Console.log("not one") 7 │ } The field someUndefinedField does not belong to type fakeDict diff --git a/tests/build_tests/super_errors/expected/dict_pattern_inference.res.expected b/tests/build_tests/super_errors/expected/dict_pattern_inference.res.expected index eb2a546da9..0684eb6917 100644 --- a/tests/build_tests/super_errors/expected/dict_pattern_inference.res.expected +++ b/tests/build_tests/super_errors/expected/dict_pattern_inference.res.expected @@ -4,8 +4,8 @@ 1 │ let foo = dict => 2 │ switch dict { - 3 │ | dict{"one": 1, "two": "hello"} => Js.log("one") - 4 │ | _ => Js.log("not one") + 3 │ | dict{"one": 1, "two": "hello"} => Console.log("one") + 4 │ | _ => Console.log("not one") 5 │ } This pattern matches values of type string diff --git a/tests/build_tests/super_errors/expected/dict_pattern_inference_constrained.res.expected b/tests/build_tests/super_errors/expected/dict_pattern_inference_constrained.res.expected index ce340c0ae9..15a310b731 100644 --- a/tests/build_tests/super_errors/expected/dict_pattern_inference_constrained.res.expected +++ b/tests/build_tests/super_errors/expected/dict_pattern_inference_constrained.res.expected @@ -5,8 +5,8 @@ 2 ┆ switch dict { 3 ┆ | dict{"one": 1} => 4 ┆ let _: dict = dict - 5 ┆ Js.log("one") - 6 ┆ | _ => Js.log("not one") + 5 ┆ Console.log("one") + 6 ┆ | _ => Console.log("not one") This has type: dict But it's expected to have type: dict diff --git a/tests/build_tests/super_errors/expected/dict_pattern_regular_record.res.expected b/tests/build_tests/super_errors/expected/dict_pattern_regular_record.res.expected index 69b1bb9e15..3ddb62c122 100644 --- a/tests/build_tests/super_errors/expected/dict_pattern_regular_record.res.expected +++ b/tests/build_tests/super_errors/expected/dict_pattern_regular_record.res.expected @@ -4,8 +4,8 @@ 3 │ let constrainedAsDict = (dict: x) => 4 │ switch dict { - 5 │ | dict{"one": "one"} => Js.log("one") - 6 │ | _ => Js.log("not one") + 5 │ | dict{"one": "one"} => Console.log("one") + 6 │ | _ => Console.log("not one") 7 │ } This pattern matches values of type dict diff --git a/tests/build_tests/super_errors/expected/variant_pattern_type_spreads_not_subtype.res.expected b/tests/build_tests/super_errors/expected/variant_pattern_type_spreads_not_subtype.res.expected index deb18a1a62..48c8eaf690 100644 --- a/tests/build_tests/super_errors/expected/variant_pattern_type_spreads_not_subtype.res.expected +++ b/tests/build_tests/super_errors/expected/variant_pattern_type_spreads_not_subtype.res.expected @@ -4,8 +4,8 @@ 5 │ let lookup = (b: b) => 6 │ switch b { - 7 │ | ...c as c => Js.log(c) - 8 │ | Four => Js.log("four") - 9 │ | Five => Js.log("five") + 7 │ | ...c as c => Console.log(c) + 8 │ | Four => Console.log("four") + 9 │ | Five => Console.log("five") Type c is not a subtype of b \ No newline at end of file diff --git a/tests/build_tests/super_errors/expected/variant_pattern_type_spreads_not_variant.res.expected b/tests/build_tests/super_errors/expected/variant_pattern_type_spreads_not_variant.res.expected index ac3ad7103c..33b9d6690c 100644 --- a/tests/build_tests/super_errors/expected/variant_pattern_type_spreads_not_variant.res.expected +++ b/tests/build_tests/super_errors/expected/variant_pattern_type_spreads_not_variant.res.expected @@ -4,9 +4,9 @@ 5 │ let lookup = (b: b) => 6 │ switch b { - 7 │ | ...c as c => Js.log(c) - 8 │ | Four => Js.log("four") - 9 │ | Five => Js.log("five") + 7 │ | ...c as c => Console.log(c) + 8 │ | Four => Console.log("four") + 9 │ | Five => Console.log("five") The type c is not a variant type \ No newline at end of file diff --git a/tests/build_tests/super_errors/expected/warnings4.res.expected b/tests/build_tests/super_errors/expected/warnings4.res.expected index 0e45f5b371..9eec05e9d6 100644 --- a/tests/build_tests/super_errors/expected/warnings4.res.expected +++ b/tests/build_tests/super_errors/expected/warnings4.res.expected @@ -5,7 +5,7 @@ 9 │ @val external x: myType = "myVariable" 10 │ 11 │ switch x { - 12 │ | #first => Js.log("first") + 12 │ | #first => Console.log("first") 13 │ } 14 │ diff --git a/tests/build_tests/super_errors/expected/warnings5.res.expected b/tests/build_tests/super_errors/expected/warnings5.res.expected index 204f9f1608..23302e6c3f 100644 --- a/tests/build_tests/super_errors/expected/warnings5.res.expected +++ b/tests/build_tests/super_errors/expected/warnings5.res.expected @@ -4,7 +4,7 @@ 10 │ 11 │ switch y { - 12 │ | {otherValue: false} => Js.log("first") + 12 │ | {otherValue: false} => Console.log("first") 13 │ } 14 │ @@ -18,7 +18,7 @@ Either bind these labels explicitly or add ', _' to the pattern. 9 │ @val external y: someRecord = "otherVariable" 10 │ 11 │ switch y { - 12 │ | {otherValue: false} => Js.log("first") + 12 │ | {otherValue: false} => Console.log("first") 13 │ } 14 │ 15 │ switch y { @@ -32,7 +32,7 @@ Either bind these labels explicitly or add ', _' to the pattern. 14 │ 15 │ switch y { - 16 │ | {typ: WithPayload(true)} => Js.log("first") + 16 │ | {typ: WithPayload(true)} => Console.log("first") 17 │ } 18 │ @@ -46,7 +46,7 @@ Either bind these labels explicitly or add ', _' to the pattern. 13 │ } 14 │ 15 │ switch y { - 16 │ | {typ: WithPayload(true)} => Js.log("first") + 16 │ | {typ: WithPayload(true)} => Console.log("first") 17 │ } 18 │ 19 │ let arr = [1] @@ -62,7 +62,7 @@ Either bind these labels explicitly or add ', _' to the pattern. 19 │ let arr = [1] 20 │ 21 │ switch arr { - 22 │ | [] => Js.log("") + 22 │ | [] => Console.log("") 23 │ } 24 │ 25 │ switch arr { @@ -77,7 +77,7 @@ Either bind these labels explicitly or add ', _' to the pattern. 23 │ } 24 │ 25 │ switch arr { - 26 │ | [one] => Js.log(one) + 26 │ | [one] => Console.log(one) 27 │ } 28 │ 29 │ switch arr { diff --git a/tests/build_tests/super_errors/fixtures/curry_in_uncurry.res b/tests/build_tests/super_errors/fixtures/curry_in_uncurry.res index 0c0c3b67e1..92e656deef 100644 --- a/tests/build_tests/super_errors/fixtures/curry_in_uncurry.res +++ b/tests/build_tests/super_errors/fixtures/curry_in_uncurry.res @@ -1,3 +1,3 @@ let f = (a, b) => a + b -f(2, 2)->Js.log +f(2, 2)->Console.log diff --git a/tests/build_tests/super_errors/fixtures/dict_magic_field_on_non_dict.res b/tests/build_tests/super_errors/fixtures/dict_magic_field_on_non_dict.res index 5f3e978589..486c90adc2 100644 --- a/tests/build_tests/super_errors/fixtures/dict_magic_field_on_non_dict.res +++ b/tests/build_tests/super_errors/fixtures/dict_magic_field_on_non_dict.res @@ -2,7 +2,7 @@ type fakeDict<'t> = {dictValuesType?: 't} let foo = (fakeDict: fakeDict<'a>) => { switch fakeDict { - | {someUndefinedField: 1} => Js.log("one") - | _ => Js.log("not one") + | {someUndefinedField: 1} => Console.log("one") + | _ => Console.log("not one") } } diff --git a/tests/build_tests/super_errors/fixtures/dict_pattern_inference.res b/tests/build_tests/super_errors/fixtures/dict_pattern_inference.res index b2b9e66b34..7d193de476 100644 --- a/tests/build_tests/super_errors/fixtures/dict_pattern_inference.res +++ b/tests/build_tests/super_errors/fixtures/dict_pattern_inference.res @@ -1,5 +1,5 @@ let foo = dict => switch dict { - | dict{"one": 1, "two": "hello"} => Js.log("one") - | _ => Js.log("not one") + | dict{"one": 1, "two": "hello"} => Console.log("one") + | _ => Console.log("not one") } diff --git a/tests/build_tests/super_errors/fixtures/dict_pattern_inference_constrained.res b/tests/build_tests/super_errors/fixtures/dict_pattern_inference_constrained.res index 36b315487e..c22fc0a8c1 100644 --- a/tests/build_tests/super_errors/fixtures/dict_pattern_inference_constrained.res +++ b/tests/build_tests/super_errors/fixtures/dict_pattern_inference_constrained.res @@ -2,6 +2,6 @@ let foo = dict => switch dict { | dict{"one": 1} => let _: dict = dict - Js.log("one") - | _ => Js.log("not one") + Console.log("one") + | _ => Console.log("not one") } diff --git a/tests/build_tests/super_errors/fixtures/dict_pattern_regular_record.res b/tests/build_tests/super_errors/fixtures/dict_pattern_regular_record.res index c5caecc489..ad1dfd37ed 100644 --- a/tests/build_tests/super_errors/fixtures/dict_pattern_regular_record.res +++ b/tests/build_tests/super_errors/fixtures/dict_pattern_regular_record.res @@ -2,6 +2,6 @@ type x = {one: int} let constrainedAsDict = (dict: x) => switch dict { - | dict{"one": "one"} => Js.log("one") - | _ => Js.log("not one") + | dict{"one": "one"} => Console.log("one") + | _ => Console.log("not one") } diff --git a/tests/build_tests/super_errors/fixtures/todo_with_no_payload.res b/tests/build_tests/super_errors/fixtures/todo_with_no_payload.res index d7aa60688c..60aae3f827 100644 --- a/tests/build_tests/super_errors/fixtures/todo_with_no_payload.res +++ b/tests/build_tests/super_errors/fixtures/todo_with_no_payload.res @@ -2,4 +2,4 @@ let implementMeLater = (): string => %todo let x = implementMeLater() -Js.log(x->Js.String2.includes("x")) +Console.log(x->Js.String2.includes("x")) diff --git a/tests/build_tests/super_errors/fixtures/todo_with_payload.res b/tests/build_tests/super_errors/fixtures/todo_with_payload.res index a52d80d5c1..53f32201dd 100644 --- a/tests/build_tests/super_errors/fixtures/todo_with_payload.res +++ b/tests/build_tests/super_errors/fixtures/todo_with_payload.res @@ -2,4 +2,4 @@ let implementMeLater = (): string => %todo("This should return a string eventual let x = implementMeLater() -Js.log(x->Js.String2.includes("x")) +Console.log(x->Js.String2.includes("x")) diff --git a/tests/build_tests/super_errors/fixtures/variant_pattern_type_spreads_not_subtype.res b/tests/build_tests/super_errors/fixtures/variant_pattern_type_spreads_not_subtype.res index f29def3d0f..88d56ad130 100644 --- a/tests/build_tests/super_errors/fixtures/variant_pattern_type_spreads_not_subtype.res +++ b/tests/build_tests/super_errors/fixtures/variant_pattern_type_spreads_not_subtype.res @@ -4,7 +4,7 @@ type c = Six | Seven let lookup = (b: b) => switch b { - | ...c as c => Js.log(c) - | Four => Js.log("four") - | Five => Js.log("five") + | ...c as c => Console.log(c) + | Four => Console.log("four") + | Five => Console.log("five") } diff --git a/tests/build_tests/super_errors/fixtures/variant_pattern_type_spreads_not_variant.res b/tests/build_tests/super_errors/fixtures/variant_pattern_type_spreads_not_variant.res index 2eac576137..e57c5c473c 100644 --- a/tests/build_tests/super_errors/fixtures/variant_pattern_type_spreads_not_variant.res +++ b/tests/build_tests/super_errors/fixtures/variant_pattern_type_spreads_not_variant.res @@ -4,7 +4,7 @@ type c = {name: string} let lookup = (b: b) => switch b { - | ...c as c => Js.log(c) - | Four => Js.log("four") - | Five => Js.log("five") + | ...c as c => Console.log(c) + | Four => Console.log("four") + | Five => Console.log("five") } diff --git a/tests/build_tests/super_errors/fixtures/warnings4.res b/tests/build_tests/super_errors/fixtures/warnings4.res index 3c65caefe2..94de143aa1 100644 --- a/tests/build_tests/super_errors/fixtures/warnings4.res +++ b/tests/build_tests/super_errors/fixtures/warnings4.res @@ -9,5 +9,5 @@ type myType = [ @val external x: myType = "myVariable" switch x { -| #first => Js.log("first") +| #first => Console.log("first") } diff --git a/tests/build_tests/super_errors/fixtures/warnings5.res b/tests/build_tests/super_errors/fixtures/warnings5.res index 9e69c5076d..a3739d03b6 100644 --- a/tests/build_tests/super_errors/fixtures/warnings5.res +++ b/tests/build_tests/super_errors/fixtures/warnings5.res @@ -9,21 +9,21 @@ type someRecord = { @val external y: someRecord = "otherVariable" switch y { -| {otherValue: false} => Js.log("first") +| {otherValue: false} => Console.log("first") } switch y { -| {typ: WithPayload(true)} => Js.log("first") +| {typ: WithPayload(true)} => Console.log("first") } let arr = [1] switch arr { -| [] => Js.log("") +| [] => Console.log("") } switch arr { -| [one] => Js.log(one) +| [one] => Console.log(one) } switch arr { diff --git a/tests/build_tests/uncurried-always/src/UncurriedAlways.res b/tests/build_tests/uncurried-always/src/UncurriedAlways.res index 01f9d2ee16..222160cda1 100644 --- a/tests/build_tests/uncurried-always/src/UncurriedAlways.res +++ b/tests/build_tests/uncurried-always/src/UncurriedAlways.res @@ -10,6 +10,6 @@ let w = 3->foo(4) let a = 3->foo(4) -Js.log(a) // Test automatic uncurried application +Console.log(a) // Test automatic uncurried application -let _ = Js.Array2.map([1], x => x + 1) +let _ = Array.map([1], x => x + 1) diff --git a/tests/build_tests/warn_legacy_config/src/demo.res b/tests/build_tests/warn_legacy_config/src/demo.res index 8d0b19151f..3bfb9a1da2 100644 --- a/tests/build_tests/warn_legacy_config/src/demo.res +++ b/tests/build_tests/warn_legacy_config/src/demo.res @@ -1 +1 @@ -let () = Js.log("Hello, ReScript") +let () = Console.log("Hello, ReScript") diff --git a/tests/build_tests/weird_deps/src/demo.res b/tests/build_tests/weird_deps/src/demo.res index 8d0b19151f..3bfb9a1da2 100644 --- a/tests/build_tests/weird_deps/src/demo.res +++ b/tests/build_tests/weird_deps/src/demo.res @@ -1 +1 @@ -let () = Js.log("Hello, ReScript") +let () = Console.log("Hello, ReScript") diff --git a/tests/build_tests/weird_devdeps/src/demo.res b/tests/build_tests/weird_devdeps/src/demo.res index 8d0b19151f..3bfb9a1da2 100644 --- a/tests/build_tests/weird_devdeps/src/demo.res +++ b/tests/build_tests/weird_devdeps/src/demo.res @@ -1 +1 @@ -let () = Js.log("Hello, ReScript") +let () = Console.log("Hello, ReScript") diff --git a/tests/build_tests/x-y/x-src/demo.res b/tests/build_tests/x-y/x-src/demo.res index 8d0b19151f..3bfb9a1da2 100644 --- a/tests/build_tests/x-y/x-src/demo.res +++ b/tests/build_tests/x-y/x-src/demo.res @@ -1 +1 @@ -let () = Js.log("Hello, ReScript") +let () = Console.log("Hello, ReScript") diff --git a/tests/gentype_tests/typescript-react-example/src/EmitModuleIfNoConversion.res b/tests/gentype_tests/typescript-react-example/src/EmitModuleIfNoConversion.res index 7d74a6ed1d..3efaca0b8e 100644 --- a/tests/gentype_tests/typescript-react-example/src/EmitModuleIfNoConversion.res +++ b/tests/gentype_tests/typescript-react-example/src/EmitModuleIfNoConversion.res @@ -8,8 +8,8 @@ module X = { @genType let foo = (t: t) => switch t { - | A => Js.log("A") - | B({name}) => Js.log("B" ++ name) + | A => Console.log("A") + | B({name}) => Console.log("B" ++ name) } @genType let x = 42 diff --git a/tests/gentype_tests/typescript-react-example/src/Uncurried.res b/tests/gentype_tests/typescript-react-example/src/Uncurried.res index 8de34f67d9..73b83f9acd 100644 --- a/tests/gentype_tests/typescript-react-example/src/Uncurried.res +++ b/tests/gentype_tests/typescript-react-example/src/Uncurried.res @@ -25,18 +25,18 @@ type authU = {loginU: unit => string} @genType let callback2U = auth => auth.loginU() -@genType let sumU = (n, m) => Js.log4("sumU 2nd arg", m, "result", n + m) +@genType let sumU = (n, m) => Console.log4("sumU 2nd arg", m, "result", n + m) -@genType let sumU2 = n => m => Js.log4("sumU2 2nd arg", m, "result", n + m) +@genType let sumU2 = n => m => Console.log4("sumU2 2nd arg", m, "result", n + m) @genType let sumCurried = n => { - Js.log2("sumCurried 1st arg", n) - m => Js.log4("sumCurried 2nd arg", m, "result", n + m) + Console.log2("sumCurried 1st arg", n) + m => Console.log4("sumCurried 2nd arg", m, "result", n + m) } @genType let sumLblCurried = (s: string, ~n) => { - Js.log3(s, "sumLblCurried 1st arg", n) - (~m) => Js.log4("sumLblCurried 2nd arg", m, "result", n + m) + Console.log3(s, "sumLblCurried 1st arg", n) + (~m) => Console.log4("sumLblCurried 2nd arg", m, "result", n + m) } diff --git a/tests/gentype_tests/typescript-react-example/src/VariantsWithPayload.res b/tests/gentype_tests/typescript-react-example/src/VariantsWithPayload.res index 1ccc9d1b6c..1bae4b07bc 100644 --- a/tests/gentype_tests/typescript-react-example/src/VariantsWithPayload.res +++ b/tests/gentype_tests/typescript-react-example/src/VariantsWithPayload.res @@ -17,12 +17,12 @@ type withPayload = [ @genType let printVariantWithPayload = (x: withPayload) => switch x { - | #a => Js.log("printVariantWithPayload: a") - | #b => Js.log("printVariantWithPayload: b") - | #True => Js.log("printVariantWithPayload: True") - | #Twenty => Js.log("printVariantWithPayload: Twenty") - | #Half => Js.log("printVariantWithPayload: Half") - | #c(payload) => Js.log4("printVariantWithPayload x:", payload.x, "y:", payload.y) + | #a => Console.log("printVariantWithPayload: a") + | #b => Console.log("printVariantWithPayload: b") + | #True => Console.log("printVariantWithPayload: True") + | #Twenty => Console.log("printVariantWithPayload: Twenty") + | #Half => Console.log("printVariantWithPayload: Half") + | #c(payload) => Console.log4("printVariantWithPayload x:", payload.x, "y:", payload.y) } @genType @@ -37,9 +37,9 @@ type manyPayloads = [ @genType let printManyPayloads = (x: manyPayloads) => switch x { - | #one(n) => Js.log2("printManyPayloads one:", n) - | #two(s1, s2) => Js.log3("printManyPayloads two:", s1, s2) - | #three(payload) => Js.log4("printManyPayloads x:", payload.x, "y:", payload.y) + | #one(n) => Console.log2("printManyPayloads one:", n) + | #two(s1, s2) => Console.log3("printManyPayloads two:", s1, s2) + | #three(payload) => Console.log4("printManyPayloads x:", payload.x, "y:", payload.y) } @genType @@ -63,20 +63,20 @@ type variantWithPayloads = @genType let printVariantWithPayloads = x => switch x { - | A => Js.log2("printVariantWithPayloads", "A") - | B(x) => Js.log2("printVariantWithPayloads", "B(" ++ (Belt.Int.toString(x) ++ ")")) + | A => Console.log2("printVariantWithPayloads", "A") + | B(x) => Console.log2("printVariantWithPayloads", "B(" ++ (Belt.Int.toString(x) ++ ")")) | C(x, y) => - Js.log2( + Console.log2( "printVariantWithPayloads", "C(" ++ (Belt.Int.toString(x) ++ (", " ++ (Belt.Int.toString(y) ++ ")"))), ) | D((x, y)) => - Js.log2( + Console.log2( "printVariantWithPayloads", "D((" ++ (Belt.Int.toString(x) ++ (", " ++ (Belt.Int.toString(y) ++ "))"))), ) | E(x, s, y) => - Js.log2( + Console.log2( "printVariantWithPayloads", "E(" ++ (Belt.Int.toString(x) ++ (", " ++ (s ++ (", " ++ (Belt.Int.toString(y) ++ ")"))))), ) diff --git a/tests/tests/src/DictInternalRepresentation.res b/tests/tests/src/DictInternalRepresentation.res index a7ba45b640..144b3d7b0f 100644 --- a/tests/tests/src/DictInternalRepresentation.res +++ b/tests/tests/src/DictInternalRepresentation.res @@ -12,15 +12,15 @@ let foo = () => { | dict{"first": first} => first ++ "2" | _ => "hello" } - Js.log(first) + Console.log(first) let second = switch intDict { | dict{"first": first} => first + 2 | _ => 1 } - Js.log(second) + Console.log(second) let third = switch stringDict { | dict{"first": first} => first ++ "2" | _ => "hello" } - Js.log(third) + Console.log(third) } diff --git a/tests/tests/src/DictTests.res b/tests/tests/src/DictTests.res index e1d2523cac..83d5beee43 100644 --- a/tests/tests/src/DictTests.res +++ b/tests/tests/src/DictTests.res @@ -21,15 +21,15 @@ module PatternMatching = { | dict{"one": 1, "three": 3, "four": 4} => // Make sure that the dict is of correct type dict->Js.Dict.set("five", 5) - | dict{"two": 1} => Js.log("two") - | _ => Js.log("not one") + | dict{"two": 1} => Console.log("two") + | _ => Console.log("not one") } let constrainedAsDict = (dict: dict) => switch dict { | dict{"one": 1} => let _d: dict = dict - Js.log("one") - | _ => Js.log("not one") + Console.log("one") + | _ => Console.log("not one") } } diff --git a/tests/tests/src/Import.res b/tests/tests/src/Import.res index 9cfd032fe8..c79e474257 100644 --- a/tests/tests/src/Import.res +++ b/tests/tests/src/Import.res @@ -5,8 +5,8 @@ let eachIntAsync = async (list: list, f: int => unit) => { let eachIntLazy = (list: list, f: int => unit) => Js.Promise.then_(each => list->each(f)->Js.Promise.resolve, Js.import(Belt.List.forEach)) -let _ = list{1, 2, 3}->eachIntLazy(n => Js.log2("lazy", n)) -let _ = list{1, 2, 3}->eachIntAsync(n => Js.log2("async", n)) +let _ = list{1, 2, 3}->eachIntLazy(n => Console.log2("lazy", n)) +let _ = list{1, 2, 3}->eachIntAsync(n => Console.log2("async", n)) module type BeltList = module type of Belt.List let beltAsModule = await Js.import(module(Belt.List: BeltList)) diff --git a/tests/tests/src/ImportAttributes.res b/tests/tests/src/ImportAttributes.res index 3fb4ee6249..e5619ba386 100644 --- a/tests/tests/src/ImportAttributes.res +++ b/tests/tests/src/ImportAttributes.res @@ -1,9 +1,9 @@ @module({from: "./myJson.json", with: {type_: "json", \"some-identifier": "yep"}}) external myJson: Js.Json.t = "default" -Js.log(myJson) +Console.log(myJson) @module({from: "./myCss.css", with: {type_: "css", \"some-identifier": "yep"}}) external buttonCss: string = "button" -Js.log(buttonCss) +Console.log(buttonCss) diff --git a/tests/tests/src/SafePromises.res b/tests/tests/src/SafePromises.res index 091adf475d..8de4bcf067 100644 --- a/tests/tests/src/SafePromises.res +++ b/tests/tests/src/SafePromises.res @@ -3,18 +3,18 @@ let nestedPromise = async (xxx: promise>) => { let xx = await xxx - let _ = xx->Js.Promise2.then(x => Js.Promise.resolve(Js.log2("Promise2.then", x))) + let _ = xx->Js.Promise2.then(x => Js.Promise.resolve(Console.log2("Promise2.then", x))) let _ = xx->Js.Promise2.catch(x => { - Js.log2("Promise2.catch_", x) + Console.log2("Promise2.catch_", x) Js.Promise.resolve(0) }) // This crashes - let _ = Js.Promise.then_(x => Js.Promise.resolve(Js.log2("Promise.then_", x)), xx) + let _ = Js.Promise.then_(x => Js.Promise.resolve(Console.log2("Promise.then_", x)), xx) } let create = async x => { - Js.log2("create", x) + Console.log2("create", x) x } diff --git a/tests/tests/src/UncurriedAlways.res b/tests/tests/src/UncurriedAlways.res index b4ababc7f0..378629181e 100644 --- a/tests/tests/src/UncurriedAlways.res +++ b/tests/tests/src/UncurriedAlways.res @@ -12,9 +12,9 @@ let w = 3->foo(4) let a = 3->foo(4) -Js.log(a) // Test automatic uncurried application +Console.log(a) // Test automatic uncurried application -let _ = Js.Array2.map([1], x => x + 1) +let _ = Array.map([1], x => x + 1) let ptl = foo(10, ...) // force partial application @@ -39,7 +39,7 @@ module AllLabels = { let ptl = foo(~y="y", ...) let a1 = ptl(~x="x", ~z="z") - Js.log2("a1:", a1) + Console.log2("a1:", a1) } module OptAtEnd = { @@ -48,9 +48,9 @@ module OptAtEnd = { let ptl = foo(~y="y", ...) let b1 = ptl(~x="x", ~z="z") - Js.log2("b1:", b1) + Console.log2("b1:", b1) let b2 = ptl(~x="x", ~z="z", ~d="d<-100") - Js.log2("b2:", b2) + Console.log2("b2:", b2) } module OptMixed = { @@ -69,18 +69,18 @@ module OptMixed = { let ptl = foo(~y="y", ~w="w", ...) let c1 = ptl(~x="x", ~z="z") - Js.log2("c1:", c1) + Console.log2("c1:", c1) let c2 = ptl(~x="x", ~z="z", ~d1="d1<-100") - Js.log2("c2:", c2) + Console.log2("c2:", c2) let c3 = ptl(~x="x", ~z="z", ~d2="d2<-200", ~d4="d4<-400") - Js.log2("c3:", c3) + Console.log2("c3:", c3) } let fn = cb => { cb() } -fn(s => Js.log(#foo(s))) +fn(s => Console.log(#foo(s))) let fn1 = (a, b, ()) => a() + b @@ -88,7 +88,7 @@ let a = fn1(() => 1, 2, _) module PartialApplication = { let f3 = (~x, ~y, ~z) => { - Js.log(x) + Console.log(x) x + y + z } diff --git a/tests/tests/src/UncurriedExternals.res b/tests/tests/src/UncurriedExternals.res index 8de1186b81..122eaca2e4 100644 --- a/tests/tests/src/UncurriedExternals.res +++ b/tests/tests/src/UncurriedExternals.res @@ -26,9 +26,9 @@ module StandardNotation = { type counter @set external setIncrementC: (counter, @this (counter, int) => unit) => unit = "increment" - let tsiC = c => setIncrementC(c, @this (me, amount) => Js.log(me)) + let tsiC = c => setIncrementC(c, @this (me, amount) => Console.log(me)) @set external setIncrementU: (counter, @this (counter, int) => unit) => unit = "increment" - let tsiU = c => setIncrementU(c, @this (me, amount) => Js.log(me)) + let tsiU = c => setIncrementU(c, @this (me, amount) => Console.log(me)) @module("react") external useState: (unit => 'state) => ('state, ('state => 'state) => unit) = "useState" diff --git a/tests/tests/src/UntaggedVariants.res b/tests/tests/src/UntaggedVariants.res index 72644ce1c2..4143e0b962 100644 --- a/tests/tests/src/UntaggedVariants.res +++ b/tests/tests/src/UntaggedVariants.res @@ -53,8 +53,8 @@ let rec tuplesToObjects = (l: ListWithTuples.t<_>): ListWithObjects.t<_> => let l1 = ListWithTuples.Cons((1, Cons((2, Cons((3, Empty)))))) let l2 = tuplesToObjects(l1) -Js.log2("l1", l1) -Js.log2("l2", l2) +Console.log2("l1", l1) +Console.log2("l2", l2) module Truthy = { @unboxed @@ -88,7 +88,7 @@ module Unknown = { | A => "a" | B => "b" | Unknown(v) => { - Js.log(x) + Console.log(x) "Unknown" } } @@ -335,8 +335,8 @@ module ComplexPattern = { let check = s => switch s { - | Array([True, False, Array([String("My name is"), Number(10.)])]) => Js.log("yup") - | _ => Js.log("Nope...") + | Array([True, False, Array([String("My name is"), Number(10.)])]) => Console.log("yup") + | _ => Console.log("Nope...") } } @@ -377,12 +377,12 @@ module Arr = { let classify = async (a: arr) => switch a { - | Array(arr) => Js.log(arr->Belt.Array.joinWith("-", x => x)) - | String(s) => Js.log(s) - | Promise(p) => Js.log(await p) - | Object({userName}) => Js.log(userName) - | Test => Js.log("testing") - | TestInt => Js.log(12) + | Array(arr) => Console.log(arr->Belt.Array.joinWith("-", x => x)) + | String(s) => Console.log(s) + | Promise(p) => Console.log(await p) + | Object({userName}) => Console.log(userName) + | Test => Console.log("testing") + | TestInt => Console.log(12) } } @@ -405,14 +405,14 @@ module AllInstanceofTypes = { let classifyAll = async (t: t) => switch t { - | String(s) => Js.log(s) - | Promise(p) => Js.log(await p) - | Object({userName}) => Js.log(userName) - | Date(date) => Js.log(date->Js.Date.toString) - | RegExp(re) => Js.log(re->Js.Re.test_("test")) - | Array(arr) => Js.log(arr->Belt.Array.joinWith("-", x => x)) - | File(file) => Js.log(file->fileName) - | Blob(blob) => Js.log(blob->blobSize) + | String(s) => Console.log(s) + | Promise(p) => Console.log(await p) + | Object({userName}) => Console.log(userName) + | Date(date) => Console.log(date->Js.Date.toString) + | RegExp(re) => Console.log(re->Js.Re.test_("test")) + | Array(arr) => Console.log(arr->Belt.Array.joinWith("-", x => x)) + | File(file) => Console.log(file->fileName) + | Blob(blob) => Console.log(blob->blobSize) } } diff --git a/tests/tests/src/VariantCoercion.res b/tests/tests/src/VariantCoercion.res index c1e197be55..f41111b915 100644 --- a/tests/tests/src/VariantCoercion.res +++ b/tests/tests/src/VariantCoercion.res @@ -139,7 +139,7 @@ module CoerceVariantBinaryOp = { } for x in 1 to (B :> int) { - Js.log(x) + Console.log(x) } type flagStr = | @as("one") One | @as("two") Two diff --git a/tests/tests/src/VariantPatternMatchingSpreads.res b/tests/tests/src/VariantPatternMatchingSpreads.res index a549ee35a7..3df231817d 100644 --- a/tests/tests/src/VariantPatternMatchingSpreads.res +++ b/tests/tests/src/VariantPatternMatchingSpreads.res @@ -5,39 +5,39 @@ type d = | ...b | ...c let doWithA = (a: a) => { switch a { - | One => Js.log("aaa") - | Two => Js.log("twwwoooo") - | Three => Js.log("threeeee") + | One => Console.log("aaa") + | Two => Console.log("twwwoooo") + | Three => Console.log("threeeee") } } let doWithB = (b: b) => { switch b { - | One => Js.log("aaa") - | _ => Js.log("twwwoooo") + | One => Console.log("aaa") + | _ => Console.log("twwwoooo") } } let lookup = (b: b) => switch b { | ...a as a => doWithA(a) - | Four => Js.log("four") - | Five => Js.log("five") + | Four => Console.log("four") + | Five => Console.log("five") } let lookup2 = (d: d) => switch d { | ...a as a => doWithA(a) | ...b as b => doWithB(b) - | Six | Seven => Js.log("Got rest of d") + | Six | Seven => Console.log("Got rest of d") } let lookupOpt = (b: option) => switch b { | Some(...a as a) => doWithA(a) - | Some(Four) => Js.log("four") - | Some(Five) => Js.log("five") - | None => Js.log("None") + | Some(Four) => Console.log("four") + | Some(Five) => Console.log("five") + | None => Console.log("None") } module Foo = { @@ -47,12 +47,12 @@ module Foo = { let doWithZ = (z: Foo.zz) => switch z { - | First => Js.log("First") - | Second => Js.log("Second") + | First => Console.log("First") + | Second => Console.log("Second") } let lookup3 = (d: Foo.xx) => switch d { - | ...Foo.zz as z => Js.log(z) - | Third => Js.log("Third") + | ...Foo.zz as z => Console.log(z) + | Third => Console.log("Third") } diff --git a/tests/tests/src/VariantPatternMatchingSpreadsWithPayloads.res b/tests/tests/src/VariantPatternMatchingSpreadsWithPayloads.res index 3b40e14452..7e2735e4ff 100644 --- a/tests/tests/src/VariantPatternMatchingSpreadsWithPayloads.res +++ b/tests/tests/src/VariantPatternMatchingSpreadsWithPayloads.res @@ -5,29 +5,29 @@ type d = | ...b | ...c let doWithA = (a: a) => { switch a { - | One => Js.log("aaa") - | Two(_) => Js.log("twwwoooo") - | Three => Js.log("threeeee") + | One => Console.log("aaa") + | Two(_) => Console.log("twwwoooo") + | Three => Console.log("threeeee") } } let doWithB = (b: b) => { switch b { - | One => Js.log("aaa") - | _ => Js.log("twwwoooo") + | One => Console.log("aaa") + | _ => Console.log("twwwoooo") } } let lookup = (b: b) => switch b { | ...a as a => doWithA(a) - | Four => Js.log("four") - | Five => Js.log("five") + | Four => Console.log("four") + | Five => Console.log("five") } let lookup2 = (d: d) => switch d { | ...a as a => doWithA(a) | ...b as b => doWithB(b) - | Six | Seven(_) => Js.log("Got rest of d") + | Six | Seven(_) => Console.log("Got rest of d") } diff --git a/tests/tests/src/a_recursive_type.res b/tests/tests/src/a_recursive_type.res index 5df8db5136..e7e7769e10 100644 --- a/tests/tests/src/a_recursive_type.res +++ b/tests/tests/src/a_recursive_type.res @@ -27,7 +27,7 @@ type rec t1 = A(array) let rec h1 = A [|h1|] // could be relaxed let rec h2 = A2 [|h2|] -;; Js.log (h,h2) */ +;; Console.log (h,h2) */ /* If we inline g's definition -- it will be the same, inline uncarefully (inline the inlined result) will make it non-terminating diff --git a/tests/tests/src/a_scope_bug.res b/tests/tests/src/a_scope_bug.res index 931f97c101..104242a6f6 100644 --- a/tests/tests/src/a_scope_bug.res +++ b/tests/tests/src/a_scope_bug.res @@ -7,7 +7,7 @@ let rec odd = z => { let even = even * even even + 4 + even } - a->Js.Int.toString->Js.log + a->Js.Int.toString->Console.log even(32) } and even = y => odd(y) diff --git a/tests/tests/src/acyc/a4_a5.res b/tests/tests/src/acyc/a4_a5.res index fe605a8638..d28e885e91 100644 --- a/tests/tests/src/acyc/a4_a5.res +++ b/tests/tests/src/acyc/a4_a5.res @@ -1,3 +1,3 @@ include A3_a4 -Js.log(v) +Console.log(v) diff --git a/tests/tests/src/acyc/x.res b/tests/tests/src/acyc/x.res index c1e75af08d..389f650aef 100644 --- a/tests/tests/src/acyc/x.res +++ b/tests/tests/src/acyc/x.res @@ -15,5 +15,5 @@ module A3_a4 = { module A4_a5 = { include A3_a4 - Js.log(v) + Console.log(v) } diff --git a/tests/tests/src/arity.res b/tests/tests/src/arity.res index 09e4abfbc5..898fb785da 100644 --- a/tests/tests/src/arity.res +++ b/tests/tests/src/arity.res @@ -1,15 +1,15 @@ type t = (~x: int, ~y: int) => int let u = (~f: t, a, b) => { - f(~x=a, ~y=b)->Js.log - f(~y=b, ~x=a)->Js.log + f(~x=a, ~y=b)->Console.log + f(~y=b, ~x=a)->Console.log } type t0 = (~x: int, ~y: int) => int let u2 = (~f: t0, a, b) => { - f(~x=a, ~y=b)->Js.log - f(~y=b, ~x=a)->Js.log + f(~x=a, ~y=b)->Console.log + f(~y=b, ~x=a)->Console.log } let f = (~x, y) => x + y diff --git a/tests/tests/src/array_safe_get.res b/tests/tests/src/array_safe_get.res index 50113f5b9d..1889507dc0 100644 --- a/tests/tests/src/array_safe_get.res +++ b/tests/tests/src/array_safe_get.res @@ -3,6 +3,6 @@ module Array = Ocaml_Array let x = [1, 2] let y = try x[3] catch { | Invalid_argument(msg) => - Js.log(msg) + Console.log(msg) 0 } diff --git a/tests/tests/src/array_subtle_test.mjs b/tests/tests/src/array_subtle_test.mjs index 233c0680ee..1bd23e2475 100644 --- a/tests/tests/src/array_subtle_test.mjs +++ b/tests/tests/src/array_subtle_test.mjs @@ -1,7 +1,6 @@ // Generated by ReScript, PLEASE EDIT WITH CARE import * as Mt from "./mt.mjs"; -import * as Primitive_array from "rescript/lib/es6/Primitive_array.js"; let suites = { contents: /* [] */0 @@ -41,8 +40,8 @@ eq("File \"array_subtle_test.res\", line 16, characters 12-19", [ ]); eq("File \"array_subtle_test.res\", line 19, characters 5-12", [ - 5, - v.push(3) + undefined, + (v.push(3), undefined) ]); eq("File \"array_subtle_test.res\", line 20, characters 5-12", [ @@ -57,14 +56,14 @@ eq("File \"array_subtle_test.res\", line 21, characters 5-12", [ eq("File \"array_subtle_test.res\", line 25, characters 5-12", [ 3, - Primitive_array.get(v, 2) + v[2] ]); -Primitive_array.set(v, 2, 4); +v[2] = 4; eq("File \"array_subtle_test.res\", line 27, characters 5-12", [ 4, - Primitive_array.get(v, 2) + v[2] ]); while (v.length > 0) { @@ -87,7 +86,7 @@ function f(v) { } function fff(x) { - return true; + return x.length >= 0; } function fff2(x) { @@ -99,11 +98,15 @@ function fff2(x) { } function fff3(x) { - return 1; + if (x.length >= 0) { + return 1; + } else { + return 2; + } } function fff4(x) { - if (x.length !== 0) { + if (x.length > 0) { return 1; } else { return 2; @@ -127,10 +130,7 @@ eq("File \"array_subtle_test.res\", line 68, characters 3-10", [ Mt.from_pair_suites("Array_subtle_test", suites.contents); -let $$Array; - export { - $$Array, suites, test_id, eq, diff --git a/tests/tests/src/array_subtle_test.res b/tests/tests/src/array_subtle_test.res index 1f9bb0686b..bfb47bc7e3 100644 --- a/tests/tests/src/array_subtle_test.res +++ b/tests/tests/src/array_subtle_test.res @@ -1,4 +1,4 @@ -module Array = Ocaml_Array +// module Array = Ocaml_Array let suites: ref = ref(list{}) let test_id = ref(0) @@ -16,37 +16,37 @@ let v = [1, 2, 3, 3] let () = eq(__LOC__, (4, Array.length(v))) let () = { - eq(__LOC__, (5, Js.Array2.push(v, 3))) /* in Js array length can be changing .. */ + eq(__LOC__, ((), Array.push(v, 3))) /* in Js array length can be changing .. */ + eq(__LOC__, (5, Array.length(v))) eq(__LOC__, (5, Array.length(v))) - eq(__LOC__, (5, Js.Array2.length(v))) } let () = { - eq(__LOC__, (3, v[2])) + eq(__LOC__, (Some(3), v[2])) v[2] = 4 - eq(__LOC__, (4, v[2])) + eq(__LOC__, (Some(4), v[2])) } /* should not inline */ let () = { - while Js.Array2.length(v) > 0 { - ignore(Js.Array2.pop(v)) + while Array.length(v) > 0 { + ignore(Array.pop(v)) } - eq(__LOC__, (0, Js.Array2.length(v))) + eq(__LOC__, (0, Array.length(v))) } let f = v => { - switch Js.Array2.pop(v) { - | Some(x) => Js.log("hi") - | None => Js.log("hi2") + switch Array.pop(v) { + | Some(x) => Console.log("hi") + | None => Console.log("hi2") } - Js.log(ignore(Js.Array2.pop(v))) + Console.log(ignore(Array.pop(v))) } let fff = x => Array.length(x) >= 0 let fff2 = x => if Array.length(x) >= 10 { - Js.log("hi") + Console.log("hi") } let fff3 = x => diff --git a/tests/tests/src/async_inline.res b/tests/tests/src/async_inline.res index 9e489e8928..e86bfd2fc0 100644 --- a/tests/tests/src/async_inline.res +++ b/tests/tests/src/async_inline.res @@ -6,7 +6,7 @@ let wrapSomethingAsync: unit => unit = () => { let _ = ( async _ => { let test = await Js.Promise.resolve("Test") - Js.log(test) + Console.log(test) } )(777) } @@ -17,7 +17,7 @@ let wrapSomethingAsync2 = () => ( async () => { let test = await Js.Promise.resolve("Test") - Js.log(test) + Console.log(test) } )()->ignorePromise diff --git a/tests/tests/src/async_inside_loop.res b/tests/tests/src/async_inside_loop.res index 93adcc7154..c76bec311f 100644 --- a/tests/tests/src/async_inside_loop.res +++ b/tests/tests/src/async_inside_loop.res @@ -1,7 +1,7 @@ let topLevelAsyncFunction = async () => { for innerScopeVal in 0 to 3 { let asyncClosureAccessingScopedVal = async () => { - Js.log2("Accessing scoped var inside loop", innerScopeVal) + Console.log2("Accessing scoped var inside loop", innerScopeVal) await Js.Promise.resolve() } diff --git a/tests/tests/src/attr_test.res b/tests/tests/src/attr_test.res index 957191cb0d..b109a3d0f3 100644 --- a/tests/tests/src/attr_test.res +++ b/tests/tests/src/attr_test.res @@ -16,4 +16,4 @@ let hh = max2(1., 2.) @val external des: (string, unit => unit) => unit = "des" -let f = x => des(x, () => Js.log("hei")) +let f = x => des(x, () => Console.log("hei")) diff --git a/tests/tests/src/bal_set_mini.res b/tests/tests/src/bal_set_mini.res index 4e3ce3f560..fa4f4a313b 100644 --- a/tests/tests/src/bal_set_mini.res +++ b/tests/tests/src/bal_set_mini.res @@ -153,7 +153,7 @@ let () = { for i in 0 to iter { if !mem(i, v.contents) { - Js.log("impossible") + Console.log("impossible") } } for i in 0 to iter { @@ -161,6 +161,6 @@ let () = { } switch v.contents { | Empty => () - | Node(_) => Js.log("impossible") + | Node(_) => Console.log("impossible") } } diff --git a/tests/tests/src/bench.res b/tests/tests/src/bench.res index 0be1bd44f0..690c65de19 100644 --- a/tests/tests/src/bench.res +++ b/tests/tests/src/bench.res @@ -47,7 +47,7 @@ let f2 = () => { let arr = init(3_000_000, i => float_of_int(i)) let b = map(i => i +. i -. 1., arr) let v = fold_left(\"+.", 0., b) - Js.log2("%f", v) + Console.log2("%f", v) } f2() diff --git a/tests/tests/src/bs_array_test.mjs b/tests/tests/src/bs_array_test.mjs index 3aa3a01f3e..0171248b27 100644 --- a/tests/tests/src/bs_array_test.mjs +++ b/tests/tests/src/bs_array_test.mjs @@ -3,6 +3,7 @@ import * as Mt from "./mt.mjs"; import * as Belt_List from "rescript/lib/es6/Belt_List.js"; import * as Belt_Array from "rescript/lib/es6/Belt_Array.js"; +import * as Stdlib_Array from "rescript/lib/es6/Stdlib_Array.js"; import * as Primitive_int from "rescript/lib/es6/Primitive_int.js"; import * as Primitive_object from "rescript/lib/es6/Primitive_object.js"; @@ -45,12 +46,12 @@ function push(prim0, prim1) { prim0.push(prim1); } -console.log([ +console.log(Stdlib_Array.reduce([ 1, 2, 3, 4 -].filter(x => x > 2).map((x, i) => x + i | 0).reduce((x, y) => x + y | 0, 0)); +].filter(x => x > 2).map((x, i) => x + i | 0), 0, (x, y) => x + y | 0)); let v = [ 1, diff --git a/tests/tests/src/bs_array_test.res b/tests/tests/src/bs_array_test.res index e367311365..ecaa80a7c7 100644 --- a/tests/tests/src/bs_array_test.res +++ b/tests/tests/src/bs_array_test.res @@ -17,13 +17,13 @@ module L = Belt.List let {push} = module(A) -type t<'a> = Js.Array2.t<'a> +type t<'a> = array<'a> let () = [1, 2, 3, 4] - ->Js.Array2.filter(x => x > 2) - ->Js.Array2.mapi((x, i) => x + i) - ->Js.Array2.reduce((x, y) => x + y, 0) - ->Js.log + ->Array.filter(x => x > 2) + ->Array.mapWithIndex((x, i) => x + i) + ->Array.reduce(0, (x, y) => x + y) + ->Console.log let () = { let v = [1, 2] diff --git a/tests/tests/src/bs_auto_uncurry.res b/tests/tests/src/bs_auto_uncurry.res index fbd1b56c05..fe01bc6c78 100644 --- a/tests/tests/src/bs_auto_uncurry.res +++ b/tests/tests/src/bs_auto_uncurry.res @@ -37,13 +37,13 @@ let f_0 = () => hi(() => ()) let f_01 = () => hi((() as x) => if x == () { - Js.log("x") + Console.log("x") } ) /* FIXME: not inlined */ let f_02 = xs => hi((() as x) => { xs := x - Js.log("x") + Console.log("x") }) let f_03 = (xs, u) => hi(u) /* arity adjust to [0] [ function (){return u (0)}] */ @@ -62,7 +62,7 @@ let h4 = x => ff1(x, add3(1)) let h5 = x => ff2(x, add3(2)) let add = (x, y) => { - Js.log((x, y)) + Console.log((x, y)) x + y } @@ -76,9 +76,9 @@ external optional_cb: ( ) => int = "optional_cb" /* -let fishy_unit = fun () -> Js.log 1 +let fishy_unit = fun () -> Console.log 1 -let fishy_unit_2 = fun [@bs] (() as x) -> Js.log x +let fishy_unit_2 = fun [@bs] (() as x) -> Console.log x let v = fishy_unit_2 () [@bs] @@ -98,7 +98,7 @@ external ff : /* So if we pass -{[ (fun (() as x) -> Js.log x ) ]} +{[ (fun (() as x) -> Console.log x ) ]} Then we call it on JS side [g ()], we are passing undefined @@ -158,8 +158,8 @@ Mt.from_pair_suites __MODULE__ !suites */ let unit_magic = () => { - Js.log("noinline") - Js.log("noinline") + Console.log("noinline") + Console.log("noinline") 3 } diff --git a/tests/tests/src/bs_auto_uncurry_test.mjs b/tests/tests/src/bs_auto_uncurry_test.mjs index c38b3e66e4..1e74ffa745 100644 --- a/tests/tests/src/bs_auto_uncurry_test.mjs +++ b/tests/tests/src/bs_auto_uncurry_test.mjs @@ -1,6 +1,7 @@ // Generated by ReScript, PLEASE EDIT WITH CARE import * as Mt from "./mt.mjs"; +import * as Stdlib_Array from "rescript/lib/es6/Stdlib_Array.js"; let suites = { contents: /* [] */0 @@ -77,17 +78,17 @@ eq("File \"bs_auto_uncurry_test.res\", line 32, characters 5-12", [ 4 ]); -eq("File \"bs_auto_uncurry_test.res\", line 34, characters 5-12", [ +eq("File \"bs_auto_uncurry_test.res\", line 34, characters 5-12", Stdlib_Array.reduce([ 1, 2, 3 -].reduce((prim0, prim1) => prim0 + prim1 | 0, 0), 6); +], 0, (prim0, prim1) => prim0 + prim1 | 0), 6); -eq("File \"bs_auto_uncurry_test.res\", line 36, characters 5-12", [ +eq("File \"bs_auto_uncurry_test.res\", line 36, characters 5-12", Stdlib_Array.reduceWithIndex([ 1, 2, 3 -].reduce((x, y, i) => (x + y | 0) + i | 0, 0), 9); +], 0, (x, y, i) => (x + y | 0) + i | 0), 9); eq("File \"bs_auto_uncurry_test.res\", line 38, characters 5-12", [ 1, diff --git a/tests/tests/src/bs_auto_uncurry_test.res b/tests/tests/src/bs_auto_uncurry_test.res index 5dfac16a7d..13911e92c2 100644 --- a/tests/tests/src/bs_auto_uncurry_test.res +++ b/tests/tests/src/bs_auto_uncurry_test.res @@ -29,15 +29,15 @@ let () = { let () = { eq(__LOC__, [1, 2, 3]->map(x => x + 1), [2, 3, 4]) - eq(__LOC__, [1, 2, 3]->Js.Array2.map(x => x + 1), [2, 3, 4]) + eq(__LOC__, [1, 2, 3]->Array.map(x => x + 1), [2, 3, 4]) - eq(__LOC__, [1, 2, 3]->Js.Array2.reduce(\"+", 0), 6) + eq(__LOC__, [1, 2, 3]->Array.reduce(0, \"+"), 6) - eq(__LOC__, [1, 2, 3]->Js.Array2.reducei((x, y, i) => x + y + i, 0), 9) + eq(__LOC__, [1, 2, 3]->Array.reduceWithIndex(0, (x, y, i) => x + y + i), 9) - eq(__LOC__, [1, 2, 3]->Js.Array2.some(x => x < 1), false) + eq(__LOC__, [1, 2, 3]->Array.some(x => x < 1), false) - eq(__LOC__, [1, 2, 3]->Js.Array2.every(x => x > 0), true) + eq(__LOC__, [1, 2, 3]->Array.every(x => x > 0), true) } let () = Mt.from_pair_suites(__MODULE__, suites.contents) diff --git a/tests/tests/src/bs_ignore_test.res b/tests/tests/src/bs_ignore_test.res index 7cf4c7c8e6..8afa7b64a7 100644 --- a/tests/tests/src/bs_ignore_test.res +++ b/tests/tests/src/bs_ignore_test.res @@ -9,8 +9,8 @@ type rec kind<_> = @val external add: (@ignore kind<'a>, 'a, 'a) => 'a = "add" let () = { - Js.log(add(Float, 3.0, 2.0)) - Js.log(add(String, "x", "y")) + Console.log(add(Float, 3.0, 2.0)) + Console.log(add(String, "x", "y")) } %%raw(` @@ -33,6 +33,6 @@ let string_of_kind = (type t, kind: kind) => let add2 = (k, x, y) => add_dyn(k, string_of_kind(k), x, y) let () = { - Js.log(add2(Float, 3.0, 2.0)) - Js.log(add2(String, "x", "y")) + Console.log(add2(Float, 3.0, 2.0)) + Console.log(add2(String, "x", "y")) } diff --git a/tests/tests/src/bs_map_set_dict_test.res b/tests/tests/src/bs_map_set_dict_test.res index ccb8c0e0c5..9c926967b1 100644 --- a/tests/tests/src/bs_map_set_dict_test.res +++ b/tests/tests/src/bs_map_set_dict_test.res @@ -37,7 +37,7 @@ let () = { data := Md0.set(data.contents, ~cmp=Mm.cmp, i, i) } let newm = M.packIdData(~data=data.contents, ~id=m_dict) - Js.log(newm) + Console.log(newm) } module ISet = Belt.Set let () = { @@ -45,7 +45,7 @@ let () = { let m11 = Md0.set(~cmp=Icmp.cmp, m, 1, 1) let _m20 = M.make(~id=module(Icmp)) - Js.log(m11) + Console.log(m11) } module S0 = Belt.Set.Dict @@ -59,7 +59,7 @@ let () = { for i in 0 to count { data := S0.add(~cmp, data.contents, i) } - Js.log(data.contents) + Console.log(data.contents) } let f = M.fromArray(~id=module(Icmp), ...) diff --git a/tests/tests/src/bs_qualified.res b/tests/tests/src/bs_qualified.res index 279e418197..8cce9a276b 100644 --- a/tests/tests/src/bs_qualified.res +++ b/tests/tests/src/bs_qualified.res @@ -76,17 +76,17 @@ let f3 = x => { ignore(makeBuffer1(20)) ignore(makeBuffer2(100)) ignore(makeBuffer3(20)) - Js.log(max(1.0, 2.0)) - /* Js.log @@ scope_f x ; */ - Js.log(getMockFn1(x, 0)) - Js.log(getMockFn2(x, 0)) - Js.log(getMockFn3(x, 0)) + Console.log(max(1.0, 2.0)) + /* Console.log @@ scope_f x ; */ + Console.log(getMockFn1(x, 0)) + Console.log(getMockFn2(x, 0)) + Console.log(getMockFn3(x, 0)) setMocFn1(x, 0, "x") setMocFn2(x, 0, "x") setMocFn3(x, 0, "x") - Js.log(getX1(x)) - Js.log(getX2(x)) - Js.log(getX3(x)) + Console.log(getX1(x)) + Console.log(getX2(x)) + Console.log(getX3(x)) setX1(x, 0) setX2(x, 0) diff --git a/tests/tests/src/bs_queue_test.res b/tests/tests/src/bs_queue_test.res index ca9f08e375..fa47f1b7b7 100644 --- a/tests/tests/src/bs_queue_test.res +++ b/tests/tests/src/bs_queue_test.res @@ -189,7 +189,7 @@ let () = { assert(Q.reduce(q2, 0, (x, y) => x - y) == Belt.Array.reduce(v, 0, (x, y) => x - y)) } -let () = Js.log("OK") +let () = Console.log("OK") let () = { let q = Q.fromArray([1, 2, 3, 4]) diff --git a/tests/tests/src/bs_splice_partial.res b/tests/tests/src/bs_splice_partial.res index 58938b6bf7..21633ee154 100644 --- a/tests/tests/src/bs_splice_partial.res +++ b/tests/tests/src/bs_splice_partial.res @@ -16,7 +16,7 @@ let test_hi = x => switch x->hi([1, 2, 3]) { | None => 1 | Some(y) => - Js.log(y) + Console.log(y) 2 } diff --git a/tests/tests/src/bs_string_test.mjs b/tests/tests/src/bs_string_test.mjs index 1024e25c3f..2db325d507 100644 --- a/tests/tests/src/bs_string_test.mjs +++ b/tests/tests/src/bs_string_test.mjs @@ -1,6 +1,7 @@ // Generated by ReScript, PLEASE EDIT WITH CARE import * as Mt from "./mt.mjs"; +import * as Stdlib_Array from "rescript/lib/es6/Stdlib_Array.js"; let suites = { contents: /* [] */0 @@ -25,7 +26,7 @@ function eq(loc, x, y) { }; } -eq("File \"bs_string_test.res\", line 13, characters 2-9", "ghso ghso g".split(" ").reduce((x, y) => x + ("-" + y), ""), "-ghso-ghso-g"); +eq("File \"bs_string_test.res\", line 13, characters 2-9", Stdlib_Array.reduce("ghso ghso g".split(" "), "", (x, y) => x + ("-" + y)), "-ghso-ghso-g"); Mt.from_pair_suites("Bs_string_test", suites.contents); diff --git a/tests/tests/src/bs_string_test.res b/tests/tests/src/bs_string_test.res index 89ba251510..29663d193f 100644 --- a/tests/tests/src/bs_string_test.res +++ b/tests/tests/src/bs_string_test.res @@ -11,7 +11,7 @@ let eq = (loc, x, y) => { let () = eq( __LOC__, - "ghso ghso g"->Js.String2.split(" ")->Js.Array2.reduce((x, y) => x ++ ("-" ++ y), ""), + "ghso ghso g"->Js.String2.split(" ")->Array.reduce("", (x, y) => x ++ ("-" ++ y)), "-ghso-ghso-g", ) diff --git a/tests/tests/src/bs_unwrap_test.res b/tests/tests/src/bs_unwrap_test.res index c89fb14e7b..f5db83be79 100644 --- a/tests/tests/src/bs_unwrap_test.res +++ b/tests/tests/src/bs_unwrap_test.res @@ -56,7 +56,7 @@ let _ = log3( ~req=#Int(7), ~opt=?( _ => { - Js.log("trace") + Console.log("trace") None } )(), diff --git a/tests/tests/src/chn_test.res b/tests/tests/src/chn_test.res index cb11cdaabd..ef544dc90d 100644 --- a/tests/tests/src/chn_test.res +++ b/tests/tests/src/chn_test.res @@ -12,10 +12,10 @@ let eq = (loc, x, y) => { } } -Js.log(`你好, +Console.log(`你好, 世界`) -Js.log(`\x3f\u003f\b\t\n\v\f\r\0"'`) +Console.log(`\x3f\u003f\b\t\n\v\f\r\0"'`) let convert = (s: string): list => List.fromArray( diff --git a/tests/tests/src/coercion_module_alias_test.res b/tests/tests/src/coercion_module_alias_test.res index bc82a64f8d..3801348a0d 100644 --- a/tests/tests/src/coercion_module_alias_test.res +++ b/tests/tests/src/coercion_module_alias_test.res @@ -1,6 +1,6 @@ open Belt -let l = Js.log +let l = Console.log module C = Char module C': module type of Char = C diff --git a/tests/tests/src/complex_while_loop.res b/tests/tests/src/complex_while_loop.res index 7fceaac61a..ac58e1830a 100644 --- a/tests/tests/src/complex_while_loop.res +++ b/tests/tests/src/complex_while_loop.res @@ -8,7 +8,7 @@ let f = () => { } fib(n.contents) > 10 } { - n.contents->Js.Int.toString->Js.log + n.contents->Js.Int.toString->Console.log incr(n) } } diff --git a/tests/tests/src/custom_error_test.res b/tests/tests/src/custom_error_test.res index 78a24a1dda..86283d2e46 100644 --- a/tests/tests/src/custom_error_test.res +++ b/tests/tests/src/custom_error_test.res @@ -1,7 +1,7 @@ let test_js_error = () => switch Js.Json.parseExn(` {"x" : }`) { | exception Js.Exn.Error(err) => - Js.log(Js.Exn.stack(err)) + Console.log(Js.Exn.stack(err)) None | e => Some(e) } @@ -9,14 +9,14 @@ let test_js_error = () => let test_js_error2 = () => try Js.Json.parseExn(` {"x" : }`) catch { | Js.Exn.Error(err) as e => - Js.log(Js.Exn.stack(err)) + Console.log(Js.Exn.stack(err)) raise(e) } let example1 = () => switch Js.Json.parseExn(` {"x" }`) { | exception Js.Exn.Error(err) => - Js.log(Js.Exn.stack(err)) + Console.log(Js.Exn.stack(err)) None | v => Some(v) } @@ -27,5 +27,5 @@ let example2 = () => } /* let () = - Js.log @@ test_js_error () + Console.log @@ test_js_error () */ diff --git a/tests/tests/src/debug_tmp.res b/tests/tests/src/debug_tmp.res index 8a62d81319..b0cf09079c 100644 --- a/tests/tests/src/debug_tmp.res +++ b/tests/tests/src/debug_tmp.res @@ -19,4 +19,4 @@ let f x ~y = x + y in /* let f x ~y = x + y -;; Js.log (f 2 3) */ +;; Console.log (f 2 3) */ diff --git a/tests/tests/src/debugger_test.res b/tests/tests/src/debugger_test.res index b4081074f0..5d75c902d9 100644 --- a/tests/tests/src/debugger_test.res +++ b/tests/tests/src/debugger_test.res @@ -1,5 +1,5 @@ let f = (x, y) => { - Js.log((x, y)) + Console.log((x, y)) x + y } @@ -14,7 +14,7 @@ let g = () => { let exterme_g = () => { ignore(f(1, 2)) let v = %debugger - Js.log(v) + Console.log(v) ignore(f(1, 2)) %debugger 3 diff --git a/tests/tests/src/defunctor_make_test.res b/tests/tests/src/defunctor_make_test.res index 662f4dbc76..72fcbde043 100644 --- a/tests/tests/src/defunctor_make_test.res +++ b/tests/tests/src/defunctor_make_test.res @@ -164,7 +164,7 @@ let v0 = empty(module(V0)) let v1 = empty(module(V1)) let v3 = add(3, "a", v0) -Js.log(v3) +Console.log(v3) /* let () = v0 = v1 */ /* let v1 = empty */ diff --git a/tests/tests/src/demo_int_map.res b/tests/tests/src/demo_int_map.res index d549afc645..f2cebc2f9b 100644 --- a/tests/tests/src/demo_int_map.res +++ b/tests/tests/src/demo_int_map.res @@ -11,6 +11,6 @@ let test = () => { } } -let () = /* Js.log "start" ; */ +let () = /* Console.log "start" ; */ test() -/* Js.log "finish" */ +/* Console.log "finish" */ diff --git a/tests/tests/src/demo_pipe.res b/tests/tests/src/demo_pipe.res index 484e65df85..fb945c7b08 100644 --- a/tests/tests/src/demo_pipe.res +++ b/tests/tests/src/demo_pipe.res @@ -8,4 +8,4 @@ external on: ( | #close(unit => unit) ], ) => readline = "on" -let register = rl => rl->on(#line(x => Js.log(x)))->on(#close(() => Js.log("finished"))) +let register = rl => rl->on(#line(x => Console.log(x)))->on(#close(() => Console.log("finished"))) diff --git a/tests/tests/src/earger_curry_test.res b/tests/tests/src/earger_curry_test.res index 1f06624f6f..9266c8dd3e 100644 --- a/tests/tests/src/earger_curry_test.res +++ b/tests/tests/src/earger_curry_test.res @@ -55,7 +55,7 @@ let f = { let arr = init(10000000, i => float_of_int(i)) let b = arr->map(i => i +. i -. 1.) let v = b->reduceReverse(0., \"+.") - v->Js.Float.toString->Js.log + v->Js.Float.toString->Console.log } } @@ -64,7 +64,7 @@ let f2 = () => { let arr = init(30_000_000, i => float_of_int(i)) let b = arr->map(i => i +. i -. 1.) let v = b->reduceReverse(0., \"+.") - v->Js.Float.toString->Js.log + v->Js.Float.toString->Console.log } /* let time label f = */ @@ -98,7 +98,7 @@ let all_v = ref(list{}) let add5 = (a0, a1, a2, a3, a4) => { /* [@bs.noinline] ; */ /* Makes sense for debugging */ - Js.log((a0, a1, a2, a3, a4)) + Console.log((a0, a1, a2, a3, a4)) all_v := list{v.contents, ...all_v.contents} a0 + a1 + a2 + a3 + a4 } diff --git a/tests/tests/src/effect.res b/tests/tests/src/effect.res index 69adcf64fa..979017762a 100644 --- a/tests/tests/src/effect.res +++ b/tests/tests/src/effect.res @@ -1,5 +1,5 @@ let a = 3 let b = 4 -let () = Js.log("hello") -Js.log("hey") +let () = Console.log("hello") +Console.log("hey") let c = 3 diff --git a/tests/tests/src/es6_import.res b/tests/tests/src/es6_import.res index bbd59f7de5..c0883eda8a 100644 --- a/tests/tests/src/es6_import.res +++ b/tests/tests/src/es6_import.res @@ -1 +1 @@ -Js.log(Es6_export.default) +Console.log(Es6_export.default) diff --git a/tests/tests/src/esmodule_ref.res b/tests/tests/src/esmodule_ref.res index 4794e81a8a..2530cf212e 100644 --- a/tests/tests/src/esmodule_ref.res +++ b/tests/tests/src/esmodule_ref.res @@ -1,2 +1,2 @@ assert(!Escape_esmodule.__esModule) -Js.log(Escape_esmodule.__esModule) +Console.log(Escape_esmodule.__esModule) diff --git a/tests/tests/src/event_ffi.res b/tests/tests/src/event_ffi.res index b5821c612f..601457e434 100644 --- a/tests/tests/src/event_ffi.res +++ b/tests/tests/src/event_ffi.res @@ -48,7 +48,7 @@ let h34 = x => x(1, 2, 3)(4) let ocaml_run = (b, c) => ((x, y, z) => x + y + z)(1, b, c) -let a0 = () => Js.log("hi") +let a0 = () => Console.log("hi") let a1 = () => x => x let a2 = (x, y) => x + y let a3 = (x, y, z) => x + y + z @@ -61,6 +61,6 @@ let a3 = (x, y, z) => x + y + z let test_as: (_ as 'b, 'a => 'a) => 'b = Belt.List.map -let xx: unit => _ => unit = () => _ => Js.log(3) +let xx: unit => _ => unit = () => _ => Console.log(3) /* let test_hihi = hihi _ [@bs] */ diff --git a/tests/tests/src/exception_value_test.res b/tests/tests/src/exception_value_test.res index b5b753e290..ac494dde2c 100644 --- a/tests/tests/src/exception_value_test.res +++ b/tests/tests/src/exception_value_test.res @@ -25,7 +25,7 @@ let test_not_found = (f, ()) => let test_js_error2 = () => try Js.Json.parseExn(` {"x" : }`) catch { | Js.Exn.Error(err) as e => - Js.log(Js.Exn.stack(err)) + Console.log(Js.Exn.stack(err)) raise(e) } diff --git a/tests/tests/src/ffi_arity_test.res b/tests/tests/src/ffi_arity_test.res index fd8b5673fd..56cc51868a 100644 --- a/tests/tests/src/ffi_arity_test.res +++ b/tests/tests/src/ffi_arity_test.res @@ -22,8 +22,8 @@ let u = () => 3 let vvv = ref(0) let fff = () => { /* No inline */ - Js.log("x") - Js.log("x") + Console.log("x") + Console.log("x") incr(vvv) } @@ -33,8 +33,8 @@ let g = () => fff() not {[ var g = fff ]} */ let abc = (x, y, z) => { - Js.log("xx") - Js.log("yy") + Console.log("xx") + Console.log("yy") x + y + z } diff --git a/tests/tests/src/ffi_js_test.res b/tests/tests/src/ffi_js_test.res index 165228a637..382e1ff5be 100644 --- a/tests/tests/src/ffi_js_test.res +++ b/tests/tests/src/ffi_js_test.res @@ -92,14 +92,14 @@ let ffff = x => { setGADT2(x, Int, Str, (3, "3")) setGADT2(x, Str, Int, ("3", 3)) switch getGADTI3(x, Int, Str) { - | (cc, dd) => Js.log((cc, dd)) + | (cc, dd) => Console.log((cc, dd)) } - Js.log(getGADT(x, Int)) + Console.log(getGADT(x, Int)) switch getGADT2(x, Int, Str) { - | (a: int, b: string) => Js.log2(a, b) + | (a: int, b: string) => Console.log2(a, b) } switch getGADTI2(x, Int, Str, 0) { - | (a: int, b: string) => Js.log2(a, b) + | (a: int, b: string) => Console.log2(a, b) } setGADTI2(x, Int, Str, 0, (1, "x")) setGADTI3(x, Int, Str, (3, "x")) diff --git a/tests/tests/src/flattern_order_test.res b/tests/tests/src/flattern_order_test.res index 3bac0b9d71..3f98624797 100644 --- a/tests/tests/src/flattern_order_test.res +++ b/tests/tests/src/flattern_order_test.res @@ -1,7 +1,7 @@ /* such recursive value not allowed in 4.06 */ /* and us = 3 in */ -/* Js.log us; */ +/* Console.log us; */ /* let second xs = diff --git a/tests/tests/src/for_side_effect_test.res b/tests/tests/src/for_side_effect_test.res index 016d0c1a8c..86403fe005 100644 --- a/tests/tests/src/for_side_effect_test.res +++ b/tests/tests/src/for_side_effect_test.res @@ -1,9 +1,9 @@ let tst = () => for i in { - Js.log("hi") + Console.log("hi") 0 } to { - Js.log("hello") + Console.log("hello") 3 } { () diff --git a/tests/tests/src/fun_pattern_match.res b/tests/tests/src/fun_pattern_match.res index 8b484e0023..6aa7d2af58 100644 --- a/tests/tests/src/fun_pattern_match.res +++ b/tests/tests/src/fun_pattern_match.res @@ -50,13 +50,13 @@ let v = { x() } -Js.log(v) +Console.log(v) let handle_tuple = (x, y) => switch (x, y) { | (0, 1) => 2 | (1, 2) => 3 | (a, b) as x => - Js.log(x) + Console.log(x) a + b } diff --git a/tests/tests/src/functor_def.res b/tests/tests/src/functor_def.res index b59e840ff4..2917aed7a4 100644 --- a/tests/tests/src/functor_def.res +++ b/tests/tests/src/functor_def.res @@ -13,9 +13,9 @@ module Make = ( let say: (int, int) => int }, ) => { - /* let () = Js.log "no inline" */ + /* let () = Console.log "no inline" */ let h = (x, x) => { - Js.log(f(x, x)) + Console.log(f(x, x)) U.say(x, x) } } diff --git a/tests/tests/src/gbk.res b/tests/tests/src/gbk.res index 4274cba1f0..ded2de5b49 100644 --- a/tests/tests/src/gbk.res +++ b/tests/tests/src/gbk.res @@ -1,11 +1,11 @@ { - Js.log("你好") + Console.log("你好") - Js.log(`你好`) + Console.log(`你好`) - Js.log(%raw(`"你好"`)) + Console.log(%raw(`"你好"`)) - Js.log((%raw(`"你好你好"`): string)) + Console.log((%raw(`"你好你好"`): string)) - Js.log(%raw(`"\\u4f60\\u597d"`)) + Console.log(%raw(`"\\u4f60\\u597d"`)) } diff --git a/tests/tests/src/gpr_1245_test.res b/tests/tests/src/gpr_1245_test.res index db1c15ed6f..1f34e383b7 100644 --- a/tests/tests/src/gpr_1245_test.res +++ b/tests/tests/src/gpr_1245_test.res @@ -4,7 +4,7 @@ let (x, y) = (ref(a), ref(b)) let f = ((c, d)) => { let (a, b) = (ref(c), ref(d)) - Js.log2(a, b) + Console.log2(a, b) } /* escape analysis to avoid allocation @@ -36,8 +36,8 @@ let a0 = f => { switch u { | None => 0 | Some(x) => - Js.log(x) - Js.log(x) + Console.log(x) + Console.log(x) 1 } } diff --git a/tests/tests/src/gpr_1268.res b/tests/tests/src/gpr_1268.res index c184bea513..573160d291 100644 --- a/tests/tests/src/gpr_1268.res +++ b/tests/tests/src/gpr_1268.res @@ -8,8 +8,8 @@ let f = (a, b, x, y) => a(x) + b(y) let f1 = (a, b, x, y) => add(a(x), b(y)) -let f2 = x => Js.log(x) +let f2 = x => Console.log(x) -let f3 = x => Js.log(x) +let f3 = x => Console.log(x) let f4 = (x, y) => add(y, x) diff --git a/tests/tests/src/gpr_1409_test.res b/tests/tests/src/gpr_1409_test.res index 52455e2eb5..f75dbb9fdc 100644 --- a/tests/tests/src/gpr_1409_test.res +++ b/tests/tests/src/gpr_1409_test.res @@ -30,8 +30,8 @@ let b_ = make(~foo=42, ()) eq(__LOC__, b_["foo"], Js.Undefined.return("42")) -Js.log(Js.Obj.keys(a_)) -Js.log4(a, b, a_, b_) +Console.log(Js.Obj.keys(a_)) +Console.log4(a, b, a_, b_) eq(__LOC__, Array.length(Js.Obj.keys(a_)), 0) @@ -41,21 +41,21 @@ let test2 = mangle(~hi=2, ()) @inline(never) let test3 = (_open, xx__hi) => - /* Js.log "no inlin"; */ + /* Console.log "no inlin"; */ mangle(~_open?, ~xx__hi?, ~hi=2, ()) let test4 = (_open, xx__hi) => { - Js.log("no inlin") + Console.log("no inlin") mangle(~_open=?Some(_open), ~xx__hi?, ~hi=2, ()) } let test5 = (f, x) => { - Js.log("no inline") + Console.log("no inline") mangle(~_open=?f(x), ~xx__hi=?f(x), ~hi=2, ()) } let test6 = (f, x) => { - Js.log("no inline") + Console.log("no inline") let x = ref(3) mangle( ~_open=?{ diff --git a/tests/tests/src/gpr_1423_app_test.res b/tests/tests/src/gpr_1423_app_test.res index ed16e139e0..5c1af9b356 100644 --- a/tests/tests/src/gpr_1423_app_test.res +++ b/tests/tests/src/gpr_1423_app_test.res @@ -9,7 +9,7 @@ let eq = (loc, x, y) => { } } -let foo = f => Js.log(f(~a1="a1", ())) +let foo = f => Console.log(f(~a1="a1", ())) let _ = foo(Gpr_1423_nav.busted(~a2="a2", ...)) diff --git a/tests/tests/src/gpr_1698_test.res b/tests/tests/src/gpr_1698_test.res index 37e09f9a56..68117389c7 100644 --- a/tests/tests/src/gpr_1698_test.res +++ b/tests/tests/src/gpr_1698_test.res @@ -20,10 +20,10 @@ let rec is_number = (expr: t) => let sym = x => Val(Symbol(x)) let rec compare = (context, state, a, b) => - /* Js.log {j|$a vs $b |j}; */ + /* Console.log {j|$a vs $b |j}; */ switch (a, b, context) { | (Neg(x), y, _) | (x, Neg(y), _) => - /* Js.log ""; */ + /* Console.log ""; */ compare(context, state, x, y) | (Val(_), Val(_), _) => 111 | (Gcd(na, da), Gcd(nb, db), _) @@ -44,4 +44,4 @@ let a = Sum(list{sym("a"), Val(Natural(2))}) let b = sym("x") type st = {complex: bool} let empty = () => {complex: true} -let _ = Js.log(compare(InSum, empty(), a, b)) +let _ = Console.log(compare(InSum, empty(), a, b)) diff --git a/tests/tests/src/gpr_1817_test.res b/tests/tests/src/gpr_1817_test.res index 940f02746e..15a1ec2a62 100644 --- a/tests/tests/src/gpr_1817_test.res +++ b/tests/tests/src/gpr_1817_test.res @@ -19,6 +19,6 @@ let f = () => { } /* y > x */ let (a0, a1, a2) = f() -Js.log2(a0, a1) +Console.log2(a0, a1) eq(__LOC__, a2, true) Mt.from_pair_suites(__MODULE__, suites.contents) diff --git a/tests/tests/src/gpr_1891_test.res b/tests/tests/src/gpr_1891_test.res index 83c763ecbf..b3c4e7d036 100644 --- a/tests/tests/src/gpr_1891_test.res +++ b/tests/tests/src/gpr_1891_test.res @@ -1,7 +1,7 @@ let foo = x => switch x { - | #Foo(3) => Js.log("1") - | _ => Js.log("2") + | #Foo(3) => Console.log("1") + | _ => Console.log("2") } let foo2 = x => @@ -24,6 +24,6 @@ let foo4 = (x, h) => let foo5 = x => switch x { - | #Foo(3) => Js.log("hi") - | _ => Js.log("x") + | #Foo(3) => Console.log("hi") + | _ => Console.log("x") } diff --git a/tests/tests/src/gpr_1946_test.res b/tests/tests/src/gpr_1946_test.res index 54919e2dc8..7369438bf7 100644 --- a/tests/tests/src/gpr_1946_test.res +++ b/tests/tests/src/gpr_1946_test.res @@ -23,6 +23,6 @@ let f = id => { eq(__LOC__, ({"_5": 3})["_5"], 3) eq(__LOC__, (2, 3), (f(h).a, f(h).b)) -Js.log(Obj.tag(Obj.repr({"_5": 3}))) +Console.log(Obj.tag(Obj.repr({"_5": 3}))) Mt.from_pair_suites(__LOC__, suites.contents) diff --git a/tests/tests/src/gpr_2316_test.res b/tests/tests/src/gpr_2316_test.res index d1a9139eca..355e1dc2da 100644 --- a/tests/tests/src/gpr_2316_test.res +++ b/tests/tests/src/gpr_2316_test.res @@ -17,7 +17,7 @@ let y = switch failwith("boo") { let x = switch failwith("boo") { | exception Failure(msg) => Some(msg) | e => - Js.log("ok") + Console.log("ok") None } diff --git a/tests/tests/src/gpr_2503_test.res b/tests/tests/src/gpr_2503_test.res index 84d03c1e58..3e7d620f80 100644 --- a/tests/tests/src/gpr_2503_test.res +++ b/tests/tests/src/gpr_2503_test.res @@ -7,23 +7,23 @@ let b = (loc, b) => Mt.bool_suites(~suites, ~test_id, loc, b) @obj external make: (~foo: [#a | #b]=?, unit) => _ = "" -let makeWrapper = (~foo=?, ()) => Js.log(make(~foo?, ())) +let makeWrapper = (~foo=?, ()) => Console.log(make(~foo?, ())) @obj external make2: (~foo: [#a | #b], unit) => _ = "" -let makeWrapper2 = (foo, ()) => Js.log(make2(~foo, ())) +let makeWrapper2 = (foo, ()) => Console.log(make2(~foo, ())) let _ = makeWrapper2(#a, ()) @obj external make3: (~foo: [#a | #b]=?, unit) => _ = "" let makeWrapper3 = (~foo=?, ()) => { - Js.log(2) + Console.log(2) make(~foo?, ()) } let makeWrapper4 = (foo, ()) => { - Js.log(2) + Console.log(2) make( ~foo=?if foo > 100 { None diff --git a/tests/tests/src/gpr_2682_test.res b/tests/tests/src/gpr_2682_test.res index 74f7c0d7c3..4feee366db 100644 --- a/tests/tests/src/gpr_2682_test.res +++ b/tests/tests/src/gpr_2682_test.res @@ -35,15 +35,15 @@ let%raw forIn : 'a -> (string -> unit [@bs]) -> unit = fun o foo -> {| module N: { let log2: string => unit } = { - let log = x => Js.log(x) + let log = x => Console.log(x) let log2: 'a => unit = log } /* let log : 'a -> unit = fun%raw x -> {|console.log (x)|} */ -forIn({"x": 3}, x => Js.log(x)) -forIn({"x": 3, "y": 3}, x => Js.log(x)) +forIn({"x": 3}, x => Console.log(x)) +forIn({"x": 3, "y": 3}, x => Console.log(x)) let f3: unit => bool = %raw("()=>true") diff --git a/tests/tests/src/gpr_3492_test.res b/tests/tests/src/gpr_3492_test.res index 3aad61c499..e78bcf1dd9 100644 --- a/tests/tests/src/gpr_3492_test.res +++ b/tests/tests/src/gpr_3492_test.res @@ -6,7 +6,7 @@ let eq = (loc, x, y) => Mt.eq_suites(~test_id, ~suites, loc, x, y) @val("foo") external foo: (unit => int) => int = "" let fn = () => { - Js.log("hi") + Console.log("hi") 1 } diff --git a/tests/tests/src/gpr_3548_test.res b/tests/tests/src/gpr_3548_test.res index 337d5d731b..03d685fc95 100644 --- a/tests/tests/src/gpr_3548_test.res +++ b/tests/tests/src/gpr_3548_test.res @@ -4,4 +4,4 @@ type orientation = [ | @as("vertical") #Vertical ] -let () = Js.log(orientationToJs(#Horizontal)) +let () = Console.log(orientationToJs(#Horizontal)) diff --git a/tests/tests/src/gpr_3566_test.res b/tests/tests/src/gpr_3566_test.res index be890db5de..da177e5d4e 100644 --- a/tests/tests/src/gpr_3566_test.res +++ b/tests/tests/src/gpr_3566_test.res @@ -10,7 +10,7 @@ let eq_A = (x: t, y) => } module Test = () => { - let () = Js.log("no inline") + let () = Console.log("no inline") let u = A(3) module Block = {} let y = 32 @@ -18,7 +18,7 @@ module Test = () => { } module Test2 = () => { - let () = Js.log("no inline") + let () = Console.log("no inline") module Block = {} let y = 32 diff --git a/tests/tests/src/gpr_3852_effect.res b/tests/tests/src/gpr_3852_effect.res index d9572c9f09..bcec3e30ce 100644 --- a/tests/tests/src/gpr_3852_effect.res +++ b/tests/tests/src/gpr_3852_effect.res @@ -1,2 +1,2 @@ let v = 0 -let () = Js.log("hello") +let () = Console.log("hello") diff --git a/tests/tests/src/gpr_3865.res b/tests/tests/src/gpr_3865.res index 4430d02329..f5fbcebb8f 100644 --- a/tests/tests/src/gpr_3865.res +++ b/tests/tests/src/gpr_3865.res @@ -1,5 +1,5 @@ module F = Gpr_3865_foo module B = Gpr_3865_bar.Make(Gpr_3865_foo) -Js.log(F.return) -Js.log(B.return) +Console.log(F.return) +Console.log(B.return) diff --git a/tests/tests/src/gpr_3931_test.res b/tests/tests/src/gpr_3931_test.res index a18788f197..41fdb8ba78 100644 --- a/tests/tests/src/gpr_3931_test.res +++ b/tests/tests/src/gpr_3931_test.res @@ -10,7 +10,7 @@ module rec PA: { and P: { let print: int => unit } = { - let print = i => Js.log2("%d", i) + let print = i => Console.log2("%d", i) } let () = PA.print([1, 2]) diff --git a/tests/tests/src/gpr_4025_test.res b/tests/tests/src/gpr_4025_test.res index 0981bff720..a45bb902d4 100644 --- a/tests/tests/src/gpr_4025_test.res +++ b/tests/tests/src/gpr_4025_test.res @@ -3,7 +3,7 @@ type u = {mutable x: int} {x: 3}.x = { - Js.log("hi") + Console.log("hi") 2 } @@ -12,7 +12,7 @@ let f = x => {x: x}.x = x + 1 let f = x => { x: { - Js.log("hi") + Console.log("hi") x }, }.x = x + 1 diff --git a/tests/tests/src/gpr_4274_test.res b/tests/tests/src/gpr_4274_test.res index d638baaafd..12729cf1d7 100644 --- a/tests/tests/src/gpr_4274_test.res +++ b/tests/tests/src/gpr_4274_test.res @@ -8,9 +8,9 @@ module type X = { } /* type annotation here interferes.. */ -let f = (module(X: X), xs: array) => X.forEach(xs, {X.i: x => Js.log(x.x)}) +let f = (module(X: X), xs: array) => X.forEach(xs, {X.i: x => Console.log(x.x)}) -Belt.List.forEach(list{{N.x: 3}}, x => Js.log(x.x)) +Belt.List.forEach(list{{N.x: 3}}, x => Console.log(x.x)) module Foo = { type record = {foo: string} diff --git a/tests/tests/src/gpr_4280_test.res b/tests/tests/src/gpr_4280_test.res index ac0fc6e15e..6e3faaab52 100644 --- a/tests/tests/src/gpr_4280_test.res +++ b/tests/tests/src/gpr_4280_test.res @@ -7,13 +7,13 @@ let u = ref(0) let div = (~children, ()) => for i in 0 to 1 { u := 300 - Js.log("nonline") + Console.log("nonline") } let string = (s: string) => for i in 0 to 1 { u := 200 - Js.log("no") + Console.log("no") } let fn = (authState, route) => diff --git a/tests/tests/src/gpr_4491_test.res b/tests/tests/src/gpr_4491_test.res index b6364b9ff7..b04ba7de6c 100644 --- a/tests/tests/src/gpr_4491_test.res +++ b/tests/tests/src/gpr_4491_test.res @@ -1,10 +1,10 @@ let f = xs => { let unused = switch xs { | Some(l) => - Js.log("side effect") + Console.log("side effect") list{l, l} | None => list{1, 2} } - Js.log2("nothing to see here", xs) + Console.log2("nothing to see here", xs) } diff --git a/tests/tests/src/gpr_5753.res b/tests/tests/src/gpr_5753.res index 0a46f612bb..94c0a79e30 100644 --- a/tests/tests/src/gpr_5753.res +++ b/tests/tests/src/gpr_5753.res @@ -2,4 +2,4 @@ flags: ["-w", "-8"], }) -'文'->Js.log +'文'->Console.log diff --git a/tests/tests/src/gpr_977_test.res b/tests/tests/src/gpr_977_test.res index 836e650425..b3229c51fa 100644 --- a/tests/tests/src/gpr_977_test.res +++ b/tests/tests/src/gpr_977_test.res @@ -11,7 +11,7 @@ let eq = (loc, x, y) => { let f = x => { for i in 0 to 100 { - Js.log(".") /* prevent optimization */ + Console.log(".") /* prevent optimization */ } -x } diff --git a/tests/tests/src/hello.foo.res b/tests/tests/src/hello.foo.res index 3d4c10ddd7..68a098f5f4 100644 --- a/tests/tests/src/hello.foo.res +++ b/tests/tests/src/hello.foo.res @@ -1 +1 @@ -Js.log(__MODULE__) +Console.log(__MODULE__) diff --git a/tests/tests/src/hello_res.res b/tests/tests/src/hello_res.res index 040bdfaf48..788c822dee 100644 --- a/tests/tests/src/hello_res.res +++ b/tests/tests/src/hello_res.res @@ -8,7 +8,7 @@ open Belt let b = List.length(list{1, 2, 3}) let a = b - 1 -Js.log("hello, res") +Console.log("hello, res") type t = {"x": int} @@ -39,10 +39,10 @@ let u = { let h = { let {v} = module(H.H1) - Js.log(v) + Console.log(v) } let to = 3 let downto = 1 -Js.log([to, downto]) +Console.log([to, downto]) diff --git a/tests/tests/src/ignore_test.res b/tests/tests/src/ignore_test.res index d4354e5a27..381aae54aa 100644 --- a/tests/tests/src/ignore_test.res +++ b/tests/tests/src/ignore_test.res @@ -11,7 +11,7 @@ let eq = (loc, x, y) => { let f = x => ignore(x) -let ff = x => ignore(Js.log(x)) +let ff = x => ignore(Console.log(x)) let () = eq(__LOC__, f(3), ()) diff --git a/tests/tests/src/incomplete_toplevel_test.res b/tests/tests/src/incomplete_toplevel_test.res index 9945f0e0b2..cf57bd02c4 100644 --- a/tests/tests/src/incomplete_toplevel_test.res +++ b/tests/tests/src/incomplete_toplevel_test.res @@ -1,5 +1,5 @@ let f = () => { - Js.log("no inline") + Console.log("no inline") (1, 2, 3) } diff --git a/tests/tests/src/inline_const.res b/tests/tests/src/inline_const.res index e1e770c219..976b29e03b 100644 --- a/tests/tests/src/inline_const.res +++ b/tests/tests/src/inline_const.res @@ -34,4 +34,4 @@ let (a, b, c, d, e) = (f, f1, f2, f3, f4) @inline let f6 = 1 -let () = Js.log((xx, xx0)) +let () = Console.log((xx, xx0)) diff --git a/tests/tests/src/inline_record_test.res b/tests/tests/src/inline_record_test.res index 26e8a9d594..c1358a6bfd 100644 --- a/tests/tests/src/inline_record_test.res +++ b/tests/tests/src/inline_record_test.res @@ -18,8 +18,8 @@ let f = (x: t0) => } eq(__LOC__, f(v), 3) eq(__LOC__, f(v1), 3) -Js.log(f(v)) -Js.log(f(v1)) +Console.log(f(v)) +Console.log(f(v1)) /* let foo ?(bar= 1) baz = bar + baz */ type t1 = @@ -123,14 +123,14 @@ type emptyRecord = A | B({}) let b = B({}) let () = switch b { -| A => Js.log("A!") -| B({}) => Js.log("B") +| A => Console.log("A!") +| B({}) => Console.log("B") } type r = {y: int} let r = {y: 10} switch r { -| {y: 10} => Js.log("10!") -| {} => Js.log("Catch all?") +| {y: 10} => Console.log("10!") +| {} => Console.log("Catch all?") } diff --git a/tests/tests/src/inline_string_test.res b/tests/tests/src/inline_string_test.res index 4264e2be32..0160c9ad92 100644 --- a/tests/tests/src/inline_string_test.res +++ b/tests/tests/src/inline_string_test.res @@ -9,7 +9,7 @@ let string_of_associative_type = x => | A_hashtable => "Hashtbl.t" } -Js.log(string_of_associative_type(A_list)) +Console.log(string_of_associative_type(A_list)) type t2 = | A_list @@ -22,7 +22,7 @@ let string_of_associative_type = x => | A_bad => "bad" } -Js.log(string_of_associative_type(A_list)) +Console.log(string_of_associative_type(A_list)) let v = Some(3) @@ -32,7 +32,7 @@ let f = x => | None => "None" } let u = v => f(Some(v)) -Js.log((f(v), f(None), f(Some(3)))) +Console.log((f(v), f(None), f(Some(3)))) type v = | A(int) @@ -56,7 +56,7 @@ let ff = x => | H(_) => "H" } -Js.log(( +Console.log(( ff(A(3)), ( x => diff --git a/tests/tests/src/inner_call.res b/tests/tests/src/inner_call.res index 6adc75c5ee..fcca54a8e3 100644 --- a/tests/tests/src/inner_call.res +++ b/tests/tests/src/inner_call.res @@ -1,4 +1,4 @@ -Js.log(Inner_define.N.add(1, 2)) +Console.log(Inner_define.N.add(1, 2)) open Inner_define diff --git a/tests/tests/src/inner_unused.res b/tests/tests/src/inner_unused.res index 75c8dfd985..f1d735bbd2 100644 --- a/tests/tests/src/inner_unused.res +++ b/tests/tests/src/inner_unused.res @@ -1,6 +1,6 @@ let f = x => { let unused_f = x => { - Js.log("x") + Console.log("x") x + x } let unused_h = x => unused_f(3) diff --git a/tests/tests/src/internal_unused_test.res b/tests/tests/src/internal_unused_test.res index 437c3cf754..b7fe7ab045 100644 --- a/tests/tests/src/internal_unused_test.res +++ b/tests/tests/src/internal_unused_test.res @@ -4,7 +4,7 @@ module P0 = { { let a = 3 - Js.log(a) + Console.log(a) (a + 2)->ignore } } @@ -46,12 +46,12 @@ module N = { let b = a + 2 } -Js.log(h5) -Js.log(h2) +Console.log(h5) +Console.log(h2) -Js.log(f) +Console.log(f) -Js.log(h(1, 2)) +Console.log(h(1, 2)) /* module%private X = Arg type x = X.spec */ diff --git a/tests/tests/src/js_array_test.mjs b/tests/tests/src/js_array_test.mjs deleted file mode 100644 index 9b14eaf969..0000000000 --- a/tests/tests/src/js_array_test.mjs +++ /dev/null @@ -1,1007 +0,0 @@ -// Generated by ReScript, PLEASE EDIT WITH CARE - -import * as Mt from "./mt.mjs"; -import * as Primitive_option from "rescript/lib/es6/Primitive_option.js"; - -let suites_0 = [ - "isArray_array", - param => ({ - TAG: "Eq", - _0: true, - _1: Array.isArray([]) - }) -]; - -let suites_1 = { - hd: [ - "isArray_int", - param => ({ - TAG: "Eq", - _0: false, - _1: Array.isArray(34) - }) - ], - tl: { - hd: [ - "length", - param => ({ - TAG: "Eq", - _0: 3, - _1: [ - 1, - 2, - 3 - ].length - }) - ], - tl: { - hd: [ - "copyWithin", - param => ({ - TAG: "Eq", - _0: [ - 1, - 2, - 3, - 1, - 2 - ], - _1: [ - 1, - 2, - 3, - 4, - 5 - ].copyWithin(-2) - }) - ], - tl: { - hd: [ - "copyWithinFrom", - param => ({ - TAG: "Eq", - _0: [ - 4, - 5, - 3, - 4, - 5 - ], - _1: [ - 1, - 2, - 3, - 4, - 5 - ].copyWithin(0, 3) - }) - ], - tl: { - hd: [ - "copyWithinFromRange", - param => ({ - TAG: "Eq", - _0: [ - 4, - 2, - 3, - 4, - 5 - ], - _1: [ - 1, - 2, - 3, - 4, - 5 - ].copyWithin(0, 3, 4) - }) - ], - tl: { - hd: [ - "fillInPlace", - param => ({ - TAG: "Eq", - _0: [ - 4, - 4, - 4 - ], - _1: [ - 1, - 2, - 3 - ].fill(4) - }) - ], - tl: { - hd: [ - "fillFromInPlace", - param => ({ - TAG: "Eq", - _0: [ - 1, - 4, - 4 - ], - _1: [ - 1, - 2, - 3 - ].fill(4, 1) - }) - ], - tl: { - hd: [ - "fillRangeInPlace", - param => ({ - TAG: "Eq", - _0: [ - 1, - 4, - 3 - ], - _1: [ - 1, - 2, - 3 - ].fill(4, 1, 2) - }) - ], - tl: { - hd: [ - "pop", - param => ({ - TAG: "Eq", - _0: 3, - _1: Primitive_option.fromUndefined([ - 1, - 2, - 3 - ].pop()) - }) - ], - tl: { - hd: [ - "pop - empty array", - param => ({ - TAG: "Eq", - _0: undefined, - _1: Primitive_option.fromUndefined([].pop()) - }) - ], - tl: { - hd: [ - "push", - param => ({ - TAG: "Eq", - _0: 4, - _1: [ - 1, - 2, - 3 - ].push(4) - }) - ], - tl: { - hd: [ - "pushMany", - param => ({ - TAG: "Eq", - _0: 5, - _1: [ - 1, - 2, - 3 - ].push(4, 5) - }) - ], - tl: { - hd: [ - "reverseInPlace", - param => ({ - TAG: "Eq", - _0: [ - 3, - 2, - 1 - ], - _1: [ - 1, - 2, - 3 - ].reverse() - }) - ], - tl: { - hd: [ - "shift", - param => ({ - TAG: "Eq", - _0: 1, - _1: Primitive_option.fromUndefined([ - 1, - 2, - 3 - ].shift()) - }) - ], - tl: { - hd: [ - "shift - empty array", - param => ({ - TAG: "Eq", - _0: undefined, - _1: Primitive_option.fromUndefined([].shift()) - }) - ], - tl: { - hd: [ - "sortInPlace", - param => ({ - TAG: "Eq", - _0: [ - 1, - 2, - 3 - ], - _1: [ - 3, - 1, - 2 - ].sort() - }) - ], - tl: { - hd: [ - "sortInPlaceWith", - param => ({ - TAG: "Eq", - _0: [ - 3, - 2, - 1 - ], - _1: [ - 3, - 1, - 2 - ].sort((a, b) => b - a | 0) - }) - ], - tl: { - hd: [ - "spliceInPlace", - param => { - let arr = [ - 1, - 2, - 3, - 4 - ]; - let removed = arr.splice(2, 0, 5); - return { - TAG: "Eq", - _0: [ - [ - 1, - 2, - 5, - 3, - 4 - ], - [] - ], - _1: [ - arr, - removed - ] - }; - } - ], - tl: { - hd: [ - "removeFromInPlace", - param => { - let arr = [ - 1, - 2, - 3, - 4 - ]; - let removed = arr.splice(2); - return { - TAG: "Eq", - _0: [ - [ - 1, - 2 - ], - [ - 3, - 4 - ] - ], - _1: [ - arr, - removed - ] - }; - } - ], - tl: { - hd: [ - "removeCountInPlace", - param => { - let arr = [ - 1, - 2, - 3, - 4 - ]; - let removed = arr.splice(2, 1); - return { - TAG: "Eq", - _0: [ - [ - 1, - 2, - 4 - ], - [3] - ], - _1: [ - arr, - removed - ] - }; - } - ], - tl: { - hd: [ - "unshift", - param => ({ - TAG: "Eq", - _0: 4, - _1: [ - 1, - 2, - 3 - ].unshift(4) - }) - ], - tl: { - hd: [ - "unshiftMany", - param => ({ - TAG: "Eq", - _0: 5, - _1: [ - 1, - 2, - 3 - ].unshift(4, 5) - }) - ], - tl: { - hd: [ - "append", - param => ({ - TAG: "Eq", - _0: [ - 1, - 2, - 3, - 4 - ], - _1: [ - 1, - 2, - 3 - ].concat([4]) - }) - ], - tl: { - hd: [ - "concat", - param => ({ - TAG: "Eq", - _0: [ - 1, - 2, - 3, - 4, - 5 - ], - _1: [ - 1, - 2, - 3 - ].concat([ - 4, - 5 - ]) - }) - ], - tl: { - hd: [ - "concatMany", - param => ({ - TAG: "Eq", - _0: [ - 1, - 2, - 3, - 4, - 5, - 6, - 7 - ], - _1: [ - 1, - 2, - 3 - ].concat([ - 4, - 5 - ], [ - 6, - 7 - ]) - }) - ], - tl: { - hd: [ - "includes", - param => ({ - TAG: "Eq", - _0: true, - _1: [ - 1, - 2, - 3 - ].includes(3) - }) - ], - tl: { - hd: [ - "indexOf", - param => ({ - TAG: "Eq", - _0: 1, - _1: [ - 1, - 2, - 3 - ].indexOf(2) - }) - ], - tl: { - hd: [ - "indexOfFrom", - param => ({ - TAG: "Eq", - _0: 3, - _1: [ - 1, - 2, - 3, - 2 - ].indexOf(2, 2) - }) - ], - tl: { - hd: [ - "join", - param => ({ - TAG: "Eq", - _0: "1,2,3", - _1: [ - 1, - 2, - 3 - ].join() - }) - ], - tl: { - hd: [ - "joinWith", - param => ({ - TAG: "Eq", - _0: "1;2;3", - _1: [ - 1, - 2, - 3 - ].join(";") - }) - ], - tl: { - hd: [ - "lastIndexOf", - param => ({ - TAG: "Eq", - _0: 1, - _1: [ - 1, - 2, - 3 - ].lastIndexOf(2) - }) - ], - tl: { - hd: [ - "lastIndexOfFrom", - param => ({ - TAG: "Eq", - _0: 1, - _1: [ - 1, - 2, - 3, - 2 - ].lastIndexOf(2, 2) - }) - ], - tl: { - hd: [ - "slice", - param => ({ - TAG: "Eq", - _0: [ - 2, - 3 - ], - _1: [ - 1, - 2, - 3, - 4, - 5 - ].slice(1, 3) - }) - ], - tl: { - hd: [ - "copy", - param => ({ - TAG: "Eq", - _0: [ - 1, - 2, - 3, - 4, - 5 - ], - _1: [ - 1, - 2, - 3, - 4, - 5 - ].slice() - }) - ], - tl: { - hd: [ - "sliceFrom", - param => ({ - TAG: "Eq", - _0: [ - 3, - 4, - 5 - ], - _1: [ - 1, - 2, - 3, - 4, - 5 - ].slice(2) - }) - ], - tl: { - hd: [ - "toString", - param => ({ - TAG: "Eq", - _0: "1,2,3", - _1: [ - 1, - 2, - 3 - ].toString() - }) - ], - tl: { - hd: [ - "toLocaleString", - param => ({ - TAG: "Eq", - _0: "1,2,3", - _1: [ - 1, - 2, - 3 - ].toLocaleString() - }) - ], - tl: { - hd: [ - "every", - param => ({ - TAG: "Eq", - _0: true, - _1: [ - 1, - 2, - 3 - ].every(n => n > 0) - }) - ], - tl: { - hd: [ - "everyi", - param => ({ - TAG: "Eq", - _0: false, - _1: [ - 1, - 2, - 3 - ].every((param, i) => i > 0) - }) - ], - tl: { - hd: [ - "filter", - param => ({ - TAG: "Eq", - _0: [ - 2, - 4 - ], - _1: [ - 1, - 2, - 3, - 4 - ].filter(n => n % 2 === 0) - }) - ], - tl: { - hd: [ - "filteri", - param => ({ - TAG: "Eq", - _0: [ - 1, - 3 - ], - _1: [ - 1, - 2, - 3, - 4 - ].filter((param, i) => i % 2 === 0) - }) - ], - tl: { - hd: [ - "find", - param => ({ - TAG: "Eq", - _0: 2, - _1: Primitive_option.fromUndefined([ - 1, - 2, - 3, - 4 - ].find(n => n % 2 === 0)) - }) - ], - tl: { - hd: [ - "find - no match", - param => ({ - TAG: "Eq", - _0: undefined, - _1: Primitive_option.fromUndefined([ - 1, - 2, - 3, - 4 - ].find(n => n % 2 === 5)) - }) - ], - tl: { - hd: [ - "findi", - param => ({ - TAG: "Eq", - _0: 1, - _1: Primitive_option.fromUndefined([ - 1, - 2, - 3, - 4 - ].find((param, i) => i % 2 === 0)) - }) - ], - tl: { - hd: [ - "findi - no match", - param => ({ - TAG: "Eq", - _0: undefined, - _1: Primitive_option.fromUndefined([ - 1, - 2, - 3, - 4 - ].find((param, i) => i % 2 === 5)) - }) - ], - tl: { - hd: [ - "findIndex", - param => ({ - TAG: "Eq", - _0: 1, - _1: [ - 1, - 2, - 3, - 4 - ].findIndex(n => n % 2 === 0) - }) - ], - tl: { - hd: [ - "findIndexi", - param => ({ - TAG: "Eq", - _0: 0, - _1: [ - 1, - 2, - 3, - 4 - ].findIndex((param, i) => i % 2 === 0) - }) - ], - tl: { - hd: [ - "forEach", - param => { - let sum = { - contents: 0 - }; - [ - 1, - 2, - 3 - ].forEach(n => { - sum.contents = sum.contents + n | 0; - }); - return { - TAG: "Eq", - _0: 6, - _1: sum.contents - }; - } - ], - tl: { - hd: [ - "forEachi", - param => { - let sum = { - contents: 0 - }; - [ - 1, - 2, - 3 - ].forEach((param, i) => { - sum.contents = sum.contents + i | 0; - }); - return { - TAG: "Eq", - _0: 3, - _1: sum.contents - }; - } - ], - tl: { - hd: [ - "map", - param => ({ - TAG: "Eq", - _0: [ - 2, - 4, - 6, - 8 - ], - _1: [ - 1, - 2, - 3, - 4 - ].map(n => (n << 1)) - }) - ], - tl: { - hd: [ - "map", - param => ({ - TAG: "Eq", - _0: [ - 0, - 2, - 4, - 6 - ], - _1: [ - 1, - 2, - 3, - 4 - ].map((param, i) => (i << 1)) - }) - ], - tl: { - hd: [ - "reduce", - param => ({ - TAG: "Eq", - _0: -10, - _1: [ - 1, - 2, - 3, - 4 - ].reduce((acc, n) => acc - n | 0, 0) - }) - ], - tl: { - hd: [ - "reducei", - param => ({ - TAG: "Eq", - _0: -6, - _1: [ - 1, - 2, - 3, - 4 - ].reduce((acc, param, i) => acc - i | 0, 0) - }) - ], - tl: { - hd: [ - "reduceRight", - param => ({ - TAG: "Eq", - _0: -10, - _1: [ - 1, - 2, - 3, - 4 - ].reduceRight((acc, n) => acc - n | 0, 0) - }) - ], - tl: { - hd: [ - "reduceRighti", - param => ({ - TAG: "Eq", - _0: -6, - _1: [ - 1, - 2, - 3, - 4 - ].reduceRight((acc, param, i) => acc - i | 0, 0) - }) - ], - tl: { - hd: [ - "some", - param => ({ - TAG: "Eq", - _0: false, - _1: [ - 1, - 2, - 3, - 4 - ].some(n => n <= 0) - }) - ], - tl: { - hd: [ - "somei", - param => ({ - TAG: "Eq", - _0: true, - _1: [ - 1, - 2, - 3, - 4 - ].some((param, i) => i <= 0) - }) - ], - tl: /* [] */0 - } - } - } - } - } - } - } - } - } - } - } - } - } - } - } - } - } - } - } - } - } - } - } - } - } - } - } - } - } - } - } - } - } - } - } - } - } - } - } - } - } - } - } - } - } - } - } - } - } - } - } - } - } - } - } - } -}; - -let suites = { - hd: suites_0, - tl: suites_1 -}; - -Mt.from_pair_suites("Js_array_test", suites); - -export { - suites, -} -/* Not a pure module */ diff --git a/tests/tests/src/js_array_test.res b/tests/tests/src/js_array_test.res deleted file mode 100644 index 9a03f7aa5f..0000000000 --- a/tests/tests/src/js_array_test.res +++ /dev/null @@ -1,165 +0,0 @@ -let suites = { - open Mt - list{ - /* es2015, unable to test because nothing currently implements array_like - "from", (fun _ -> - Eq( - [| 0; 1 |], - [| "a"; "b" |] |. Js.Array2.keys |. Js.Array2.from) - ); - */ - - /* es2015, unable to test because nothing currently implements array_like - "fromMap", (fun _ -> - Eq( - [| (-1); 0 |], - Js.Array2.fromMap - ([| "a"; "b" |] |. Js.Array2.keys) - ((fun x -> x - 1) [@bs])) - ); - */ - - /* es2015 */ - ("isArray_array", _ => Eq(true, []->Js.Array2.isArray)), - ("isArray_int", _ => Eq(false, 34->Js.Array2.isArray)), - ("length", _ => Eq(3, [1, 2, 3]->Js.Array2.length)), - /* es2015 */ - ("copyWithin", _ => Eq([1, 2, 3, 1, 2], [1, 2, 3, 4, 5]->Js.Array2.copyWithin(~to_=-2))), - ( - "copyWithinFrom", - _ => Eq([4, 5, 3, 4, 5], [1, 2, 3, 4, 5]->Js.Array2.copyWithinFrom(~to_=0, ~from=3)), - ), - ( - "copyWithinFromRange", - _ => Eq( - [4, 2, 3, 4, 5], - [1, 2, 3, 4, 5]->Js.Array2.copyWithinFromRange(~to_=0, ~start=3, ~end_=4), - ), - ), - /* es2015 */ - ("fillInPlace", _ => Eq([4, 4, 4], [1, 2, 3]->Js.Array2.fillInPlace(4))), - ("fillFromInPlace", _ => Eq([1, 4, 4], [1, 2, 3]->Js.Array2.fillFromInPlace(4, ~from=1))), - ( - "fillRangeInPlace", - _ => Eq([1, 4, 3], [1, 2, 3]->Js.Array2.fillRangeInPlace(4, ~start=1, ~end_=2)), - ), - ("pop", _ => Eq(Some(3), [1, 2, 3]->Js.Array2.pop)), - ("pop - empty array", _ => Eq(None, []->Js.Array2.pop)), - ("push", _ => Eq(4, [1, 2, 3]->Js.Array2.push(4))), - ("pushMany", _ => Eq(5, [1, 2, 3]->Js.Array2.pushMany([4, 5]))), - ("reverseInPlace", _ => Eq([3, 2, 1], [1, 2, 3]->Js.Array2.reverseInPlace)), - ("shift", _ => Eq(Some(1), [1, 2, 3]->Js.Array2.shift)), - ("shift - empty array", _ => Eq(None, []->Js.Array2.shift)), - ("sortInPlace", _ => Eq([1, 2, 3], [3, 1, 2]->Js.Array2.sortInPlace)), - ("sortInPlaceWith", _ => Eq([3, 2, 1], [3, 1, 2]->Js.Array2.sortInPlaceWith((a, b) => b - a))), - ( - "spliceInPlace", - _ => { - let arr = [1, 2, 3, 4] - let removed = arr->Js.Array2.spliceInPlace(~pos=2, ~remove=0, ~add=[5]) - - Eq(([1, 2, 5, 3, 4], []), (arr, removed)) - }, - ), - ( - "removeFromInPlace", - _ => { - let arr = [1, 2, 3, 4] - let removed = arr->Js.Array2.removeFromInPlace(~pos=2) - - Eq(([1, 2], [3, 4]), (arr, removed)) - }, - ), - ( - "removeCountInPlace", - _ => { - let arr = [1, 2, 3, 4] - let removed = arr->Js.Array2.removeCountInPlace(~pos=2, ~count=1) - - Eq(([1, 2, 4], [3]), (arr, removed)) - }, - ), - ("unshift", _ => Eq(4, [1, 2, 3]->Js.Array2.unshift(4))), - ("unshiftMany", _ => Eq(5, [1, 2, 3]->Js.Array2.unshiftMany([4, 5]))), - ("append", _ => Eq([1, 2, 3, 4], [1, 2, 3]->Js.Array2.concat([4]))), - ("concat", _ => Eq([1, 2, 3, 4, 5], [1, 2, 3]->Js.Array2.concat([4, 5]))), - ( - "concatMany", - _ => Eq([1, 2, 3, 4, 5, 6, 7], [1, 2, 3]->Js.Array2.concatMany([[4, 5], [6, 7]])), - ), - /* es2016 */ - ("includes", _ => Eq(true, [1, 2, 3]->Js.Array2.includes(3))), - ("indexOf", _ => Eq(1, [1, 2, 3]->Js.Array2.indexOf(2))), - ("indexOfFrom", _ => Eq(3, [1, 2, 3, 2]->Js.Array2.indexOfFrom(2, ~from=2))), - ("join", _ => Eq("1,2,3", [1, 2, 3]->Js.Array.join)), - ("joinWith", _ => Eq("1;2;3", [1, 2, 3]->Js.Array2.joinWith(";"))), - ("lastIndexOf", _ => Eq(1, [1, 2, 3]->Js.Array2.lastIndexOf(2))), - ("lastIndexOfFrom", _ => Eq(1, [1, 2, 3, 2]->Js.Array2.lastIndexOfFrom(2, ~from=2))), - ("slice", _ => Eq([2, 3], [1, 2, 3, 4, 5]->Js.Array2.slice(~start=1, ~end_=3))), - ("copy", _ => Eq([1, 2, 3, 4, 5], [1, 2, 3, 4, 5]->Js.Array2.copy)), - ("sliceFrom", _ => Eq([3, 4, 5], [1, 2, 3, 4, 5]->Js.Array2.sliceFrom(2))), - ("toString", _ => Eq("1,2,3", [1, 2, 3]->Js.Array2.toString)), - ("toLocaleString", _ => Eq("1,2,3", [1, 2, 3]->Js.Array2.toLocaleString)), - /* es2015, iterator - "entries", (fun _ -> - Eq([| (0, "a"); (1, "b"); (2, "c") |], - [| "a"; "b"; "c" |] |. Js.Array2.entries |. Js.Array2.from) - ); - */ - - ("every", _ => Eq(true, [1, 2, 3]->Js.Array2.every(n => n > 0))), - ("everyi", _ => Eq(false, [1, 2, 3]->Js.Array2.everyi((_, i) => i > 0))), - ("filter", _ => Eq([2, 4], [1, 2, 3, 4]->Js.Array2.filter(n => mod(n, 2) == 0))), - ("filteri", _ => Eq([1, 3], [1, 2, 3, 4]->Js.Array2.filteri((_, i) => mod(i, 2) == 0))), - /* es2015 */ - ("find", _ => Eq(Some(2), [1, 2, 3, 4]->Js.Array2.find(n => mod(n, 2) == 0))), - ("find - no match", _ => Eq(None, [1, 2, 3, 4]->Js.Array2.find(n => mod(n, 2) == 5))), - ("findi", _ => Eq(Some(1), [1, 2, 3, 4]->Js.Array2.findi((_, i) => mod(i, 2) == 0))), - ("findi - no match", _ => Eq(None, [1, 2, 3, 4]->Js.Array2.findi((_, i) => mod(i, 2) == 5))), - /* es2015 */ - ("findIndex", _ => Eq(1, [1, 2, 3, 4]->Js.Array2.findIndex(n => mod(n, 2) == 0))), - ("findIndexi", _ => Eq(0, [1, 2, 3, 4]->Js.Array2.findIndexi((_, i) => mod(i, 2) == 0))), - ( - "forEach", - _ => { - let sum = ref(0) - let _ = [1, 2, 3]->Js.Array2.forEach(n => sum := sum.contents + n) - - Eq(6, sum.contents) - }, - ), - ( - "forEachi", - _ => { - let sum = ref(0) - let _ = [1, 2, 3]->Js.Array2.forEachi((_, i) => sum := sum.contents + i) - - Eq(3, sum.contents) - }, - ), - /* es2015, iterator - "keys", (fun _ -> - Eq([| 0; 1; 2 |], - [| "a"; "b"; "c" |] |. Js.Array2.keys |. Js.Array2.from) - ); - */ - - ("map", _ => Eq([2, 4, 6, 8], [1, 2, 3, 4]->Js.Array2.map(n => n * 2))), - ("map", _ => Eq([0, 2, 4, 6], [1, 2, 3, 4]->Js.Array2.mapi((_, i) => i * 2))), - ("reduce", _ => Eq(-10, [1, 2, 3, 4]->Js.Array2.reduce((acc, n) => acc - n, 0))), - ("reducei", _ => Eq(-6, [1, 2, 3, 4]->Js.Array2.reducei((acc, _, i) => acc - i, 0))), - ("reduceRight", _ => Eq(-10, [1, 2, 3, 4]->Js.Array2.reduceRight((acc, n) => acc - n, 0))), - ("reduceRighti", _ => Eq(-6, [1, 2, 3, 4]->Js.Array2.reduceRighti((acc, _, i) => acc - i, 0))), - ("some", _ => Eq(false, [1, 2, 3, 4]->Js.Array2.some(n => n <= 0))), - ("somei", _ => Eq(true, [1, 2, 3, 4]->Js.Array2.somei((_, i) => i <= 0))), - - /* es2015, iterator - "values", (fun _ -> - Eq([| "a"; "b"; "c" |], - [| "a"; "b"; "c" |] |. Js.Array2.values |. Js.Array2.from) - ); - */ - } -} - -Mt.from_pair_suites(__MODULE__, suites) diff --git a/tests/tests/src/js_json_test.res b/tests/tests/src/js_json_test.res index 7656d4568d..7fadc0edd9 100644 --- a/tests/tests/src/js_json_test.res +++ b/tests/tests/src/js_json_test.res @@ -32,7 +32,7 @@ let () = { | J.JSONArray(x) => /* compiler infer x : J.t array */ (() => Mt.Ok(true))( - x->Js.Array2.forEach(x => { + x->Stdlib.Array.forEach(x => { let ty3 = J.classify(x) switch ty3 { | J.JSONNumber(_) => () @@ -57,7 +57,7 @@ let () = { switch ty { | J.JSONNull => true_(__LOC__) | _ => - Js.log(ty) + Console.log(ty) false_(__LOC__) } } diff --git a/tests/tests/src/js_nullable_test.res b/tests/tests/src/js_nullable_test.res index f60f58c69c..4c345759bc 100644 --- a/tests/tests/src/js_nullable_test.res +++ b/tests/tests/src/js_nullable_test.res @@ -18,13 +18,13 @@ let test = dom => { switch elem { | None => 1 | Some(ui) => - Js.log(ui) + Console.log(ui) 2 } } let f = (x, y) => { - Js.log("no inline") + Console.log("no inline") Js.Nullable.return(x + y) } diff --git a/tests/tests/src/js_string_test.res b/tests/tests/src/js_string_test.res index f2f46f6767..b441b2e84b 100644 --- a/tests/tests/src/js_string_test.res +++ b/tests/tests/src/js_string_test.res @@ -33,7 +33,7 @@ let suites = { "match - not found capture groups", _ => Eq( Some([Some("hello "), None]), - "hello word"->Js.String2.match_(/hello (world)?/)->Belt.Option.map(Js.Array.copy), + "hello word"->Js.String2.match_(/hello (world)?/)->Belt.Option.map(Array.copy), ), ), /* es2015 */ diff --git a/tests/tests/src/key_word_property_plus_test.mjs b/tests/tests/src/key_word_property_plus_test.mjs index 285af5f0d1..ba953c4498 100644 --- a/tests/tests/src/key_word_property_plus_test.mjs +++ b/tests/tests/src/key_word_property_plus_test.mjs @@ -1,6 +1,7 @@ // Generated by ReScript, PLEASE EDIT WITH CARE import * as Mt from "./mt.mjs"; +import * as Stdlib_Array from "rescript/lib/es6/Stdlib_Array.js"; import * as Ident_mangles from "./ident_mangles.mjs"; let suites = { @@ -26,12 +27,12 @@ function eq(loc, x, y) { }; } -eq("File \"key_word_property_plus_test.res\", line 13, characters 2-9", [ +eq("File \"key_word_property_plus_test.res\", line 13, characters 2-9", Stdlib_Array.reduce([ 1, 2, 3, 4 -].reduce((prim0, prim1) => prim0 + prim1 | 0, 0), ((Ident_mangles.$$__dirname + Ident_mangles.$$__filename | 0) + Ident_mangles.$$exports | 0) + Ident_mangles.$$require | 0); +], 0, (prim0, prim1) => prim0 + prim1 | 0), ((Ident_mangles.$$__dirname + Ident_mangles.$$__filename | 0) + Ident_mangles.$$exports | 0) + Ident_mangles.$$require | 0); Mt.from_pair_suites("Key_word_property_plus_test", suites.contents); diff --git a/tests/tests/src/key_word_property_plus_test.res b/tests/tests/src/key_word_property_plus_test.res index 73f53fd6e3..3b6140c8a0 100644 --- a/tests/tests/src/key_word_property_plus_test.res +++ b/tests/tests/src/key_word_property_plus_test.res @@ -11,7 +11,7 @@ let eq = (loc, x, y) => { let () = eq( __LOC__, - Js.Array2.reduce([1, 2, 3, 4], \"+", 0), + Array.reduce([1, 2, 3, 4], 0, \"+"), { open Ident_mangles __dirname + __filename + exports + require diff --git a/tests/tests/src/label_uncurry.res b/tests/tests/src/label_uncurry.res index a784fac5ec..ae8012ed74 100644 --- a/tests/tests/src/label_uncurry.res +++ b/tests/tests/src/label_uncurry.res @@ -11,8 +11,8 @@ let u: u = (~x, ~y) => } let u1 = (f: u) => { - f(~y="x", ~x=2)->Js.log - f(~x=2, ~y="x")->Js.log + f(~y="x", ~x=2)->Console.log + f(~x=2, ~y="x")->Console.log } let h = (~x: unit) => 3 diff --git a/tests/tests/src/lazy_demo.res b/tests/tests/src/lazy_demo.res index c3e4abc3f1..8b2bc783c9 100644 --- a/tests/tests/src/lazy_demo.res +++ b/tests/tests/src/lazy_demo.res @@ -1,13 +1,13 @@ let lazy1 = Lazy.from_fun(() => { - "Hello, lazy"->Js.log + "Hello, lazy"->Console.log 1 }) let lazy2 = Lazy.from_fun(() => 3) -Js.log2(lazy1, lazy2) +Console.log2(lazy1, lazy2) // can't destructure lazy values let (la, lb) = (Lazy.force(lazy1), Lazy.force(lazy2)) -Js.log2(la, lb) +Console.log2(la, lb) diff --git a/tests/tests/src/lazy_test.res b/tests/tests/src/lazy_test.res index d6c0f23079..1dee2e82b0 100644 --- a/tests/tests/src/lazy_test.res +++ b/tests/tests/src/lazy_test.res @@ -54,7 +54,7 @@ let f006: Lazy.t int> = Lazy.from_fun(() => { let f007 = Lazy.from_fun(() => raise(Not_found)) let f008 = Lazy.from_fun(() => { - Js.log("hi") + Console.log("hi") raise(Not_found) }) diff --git a/tests/tests/src/lib_js_test.res b/tests/tests/src/lib_js_test.res index f237d65dbc..51840180cd 100644 --- a/tests/tests/src/lib_js_test.res +++ b/tests/tests/src/lib_js_test.res @@ -1,8 +1,8 @@ @val external to_json_string: 'a => string = "JSON.stringify" let () = { - Js.log(to_json_string(list{1, 2, 3})) - Js.log("hey") + Console.log(to_json_string(list{1, 2, 3})) + Console.log("hey") } @val external of_any: 'a => string = "String" let suites = { diff --git a/tests/tests/src/mario_game.res b/tests/tests/src/mario_game.res index acc91af352..8691547076 100644 --- a/tests/tests/src/mario_game.res +++ b/tests/tests/src/mario_game.res @@ -1436,7 +1436,7 @@ module Draw: { let (dx, dy) = (posx, posy) let (dw, dh) = sprite.params.frame_size let sx = sx +. float_of_int(sprite.frame.contents) *. sw - /* Js.log(sprite.frame) */ + /* Console.log(sprite.frame) */ /* context##clearRect(0.,0.,sw, sh); */ context["drawImage"](sprite.img, sx, sy, sw, sh, dx, dy, dw, dh) } @@ -2588,7 +2588,7 @@ module Main = { let canvas_id = "canvas" let canvas = switch Dom_html.getElementById(Dom_html.document, canvas_id) { | None => - Js.log("cant find canvas " ++ canvas_id ++ "") + Console.log("cant find canvas " ++ canvas_id ++ "") failwith("fail") | Some(el) => Dom_html.elementToCanvasElement(el) } @@ -2602,7 +2602,7 @@ module Main = { Pg.generate(level_width, level_height, context), (level_width, level_height), ) - Js.log("asd") + Console.log("asd") () } diff --git a/tests/tests/src/method_string_name.res b/tests/tests/src/method_string_name.res index 842317ef82..35c085198d 100644 --- a/tests/tests/src/method_string_name.res +++ b/tests/tests/src/method_string_name.res @@ -1,10 +1,10 @@ let f = {"Content-Type": 3} -Js.log(f["Content-Type"]) +Console.log(f["Content-Type"]) let ff = x => { x["Hi"] // x## "hi#"; x["Content-Type"] = "hello" - Js.log(({"Content-Type": "hello"})["Content-Type"]) + Console.log(({"Content-Type": "hello"})["Content-Type"]) } diff --git a/tests/tests/src/mock_mt.res b/tests/tests/src/mock_mt.res index 83042f8cab..e514cce5a0 100644 --- a/tests/tests/src/mock_mt.res +++ b/tests/tests/src/mock_mt.res @@ -12,19 +12,19 @@ type rec eq = Mt.eq = type pair_suites = list<(string, unit => eq)> let from_pair_suites = (name: string, suites: pair_suites) => { - Js.log((name, "testing")) + Console.log((name, "testing")) suites->Belt.List.forEach(((name, code)) => switch code() { - | Eq(a, b) => Js.log((name, a, "eq?", b)) - | Neq(a, b) => Js.log((name, a, "neq?", b)) - | StrictEq(a, b) => Js.log((name, a, "strict_eq?", b)) - | StrictNeq(a, b) => Js.log((name, a, "strict_neq?", b)) - | Approx(a, b) => Js.log((name, a, "~", b)) - | ApproxThreshold(t, a, b) => Js.log((name, a, "~", b, " (", t, ")")) + | Eq(a, b) => Console.log((name, a, "eq?", b)) + | Neq(a, b) => Console.log((name, a, "neq?", b)) + | StrictEq(a, b) => Console.log((name, a, "strict_eq?", b)) + | StrictNeq(a, b) => Console.log((name, a, "strict_neq?", b)) + | Approx(a, b) => Console.log((name, a, "~", b)) + | ApproxThreshold(t, a, b) => Console.log((name, a, "~", b, " (", t, ")")) | ThrowAny(fn) => () - | Fail(_) => Js.log("failed") - | FailWith(msg) => Js.log("failed: " ++ msg) - | Ok(a) => Js.log((name, a, "ok?")) + | Fail(_) => Console.log("failed") + | FailWith(msg) => Console.log("failed: " ++ msg) + | Ok(a) => Console.log((name, a, "ok?")) } ) } diff --git a/tests/tests/src/module_alias_test.res b/tests/tests/src/module_alias_test.res index 718adc897a..75c83645c4 100644 --- a/tests/tests/src/module_alias_test.res +++ b/tests/tests/src/module_alias_test.res @@ -21,8 +21,8 @@ module type X = module type of List let f = x => { module L = List - Js.log(x) - Js.log(List.length(x)) + Console.log(x) + Console.log(List.length(x)) module(L: X) } diff --git a/tests/tests/src/module_splice_test.res b/tests/tests/src/module_splice_test.res index f76c5f50b0..981d484c44 100644 --- a/tests/tests/src/module_splice_test.res +++ b/tests/tests/src/module_splice_test.res @@ -15,7 +15,7 @@ let a = joinClasses([1, 2, 3]) let () = { let pair = (a, 6) - Js.log(pair) + Console.log(pair) eq(__LOC__, pair) } diff --git a/tests/tests/src/more_poly_variant_test.res b/tests/tests/src/more_poly_variant_test.res index b4f2f9ff4b..e4c54eaf90 100644 --- a/tests/tests/src/more_poly_variant_test.res +++ b/tests/tests/src/more_poly_variant_test.res @@ -46,7 +46,7 @@ type x = [#a | #b | #c] let f2 = x => switch x { | #...myvariant2 as x => - Js.log(x) + Console.log(x) 2 | #hello => 3 | #h => 2 diff --git a/tests/tests/src/mt.res b/tests/tests/src/mt.res index 73f9da5a1b..f8720ff049 100644 --- a/tests/tests/src/mt.res +++ b/tests/tests/src/mt.res @@ -79,19 +79,19 @@ type promise_suites = list<(string, Js.Promise.t)> let close_enough = (~threshold=0.0000001 /* epsilon_float */, a, b) => abs_float(a -. b) < threshold let node_from_pair_suites = (name: string, suites: pair_suites) => { - Js.log((name, "testing")) + Console.log((name, "testing")) suites->Belt.List.forEach(((name, code)) => switch code() { - | Eq(a, b) => Js.log((name, a, "eq?", b)) - | Neq(a, b) => Js.log((name, a, "neq?", b)) - | StrictEq(a, b) => Js.log((name, a, "strict_eq?", b)) - | StrictNeq(a, b) => Js.log((name, a, "strict_neq?", b)) - | Approx(a, b) => Js.log((name, a, "~", b)) - | ApproxThreshold(t, a, b) => Js.log((name, a, "~", b, " (", t, ")")) + | Eq(a, b) => Console.log((name, a, "eq?", b)) + | Neq(a, b) => Console.log((name, a, "neq?", b)) + | StrictEq(a, b) => Console.log((name, a, "strict_eq?", b)) + | StrictNeq(a, b) => Console.log((name, a, "strict_neq?", b)) + | Approx(a, b) => Console.log((name, a, "~", b)) + | ApproxThreshold(t, a, b) => Console.log((name, a, "~", b, " (", t, ")")) | ThrowAny(fn) => () - | Fail(_) => Js.log("failed") - | FailWith(msg) => Js.log("failed: " ++ msg) - | Ok(a) => Js.log((name, a, "ok?")) + | Fail(_) => Console.log("failed") + | FailWith(msg) => Console.log("failed: " ++ msg) + | Ok(a) => Console.log((name, a, "ok?")) } ) } @@ -262,7 +262,7 @@ let old_from_promise_suites_donotuse = (name, suites: list<(string, Js.Promise.t ) ) } else { - Js.log("promise suites") + Console.log("promise suites") } /* TODO */ | _ => () } diff --git a/tests/tests/src/node_path_test.res b/tests/tests/src/node_path_test.res index fcde2aa0b1..76f3997df3 100644 --- a/tests/tests/src/node_path_test.res +++ b/tests/tests/src/node_path_test.res @@ -1,5 +1,5 @@ @module("path") @variadic external join: array => string = "join" -let () = Js.log(join([".", __MODULE__])) +let () = Console.log(join([".", __MODULE__])) /* let f x = join x */ diff --git a/tests/tests/src/option_repr_test.res b/tests/tests/src/option_repr_test.res index 0a40fdbe96..3ced24c4eb 100644 --- a/tests/tests/src/option_repr_test.res +++ b/tests/tests/src/option_repr_test.res @@ -24,7 +24,7 @@ let f1 = u => } let f2 = (~x=?, ~y: option=?, ~z=3, ()) => { - Js.log(x) + Console.log(x) switch y { | None => 0 | Some(y) => y + z diff --git a/tests/tests/src/optional_ffi_test.res b/tests/tests/src/optional_ffi_test.res index 02a766e1c8..2c25b25153 100644 --- a/tests/tests/src/optional_ffi_test.res +++ b/tests/tests/src/optional_ffi_test.res @@ -44,7 +44,7 @@ let () = { let pair = ((v, counter.contents), (4, 1)) let v2 = bug_to_fix2(side_effect2, counter2) let pair2 = ((v2, counter.contents), (4, 1)) - /* Js.log (pair,pair2) */ + /* Console.log (pair,pair2) */ eq(__LOC__, pair) eq(__LOC__, pair2) } @@ -60,7 +60,7 @@ function heystr(x, y) { let () = { let pair = ("name4", kk(~name="name", "4")) - /* Js.log pair ; */ + /* Console.log pair ; */ eq(__LOC__, pair) } diff --git a/tests/tests/src/optional_regression_test.res b/tests/tests/src/optional_regression_test.res index 647aff5bc6..a3aa65d333 100644 --- a/tests/tests/src/optional_regression_test.res +++ b/tests/tests/src/optional_regression_test.res @@ -16,5 +16,5 @@ let hh = make(~s="", ~b=false, ~i=0, ()) eq(__LOC__, hh->sGet, Some("")) eq(__LOC__, hh->bGet, Some(false)) eq(__LOC__, hh->iGet, Some(0)) -Js.log(hh) +Console.log(hh) Mt.from_pair_suites(__MODULE__, suites.contents) diff --git a/tests/tests/src/pipe_send_readline.res b/tests/tests/src/pipe_send_readline.res index b5d8403112..9220df88b4 100644 --- a/tests/tests/src/pipe_send_readline.res +++ b/tests/tests/src/pipe_send_readline.res @@ -10,7 +10,7 @@ external on: ( | #close(unit => unit) ], ) => 'self = "on" -let u = rl => rl->on(#line(x => Js.log(x)))->on(#close(() => Js.log("finished"))) +let u = rl => rl->on(#line(x => Console.log(x)))->on(#close(() => Console.log("finished"))) @send external send: ({"hi": int} as 'self, string) => 'self = "send" diff --git a/tests/tests/src/poly_variant_test.res b/tests/tests/src/poly_variant_test.res index 7aa2887a7b..f60fce6f5d 100644 --- a/tests/tests/src/poly_variant_test.res +++ b/tests/tests/src/poly_variant_test.res @@ -90,8 +90,8 @@ external on: ( ) => unit = "on" let register = readline => { - on(readline, #line(s => Js.log(s))) - on(readline, #close(() => Js.log("finished"))) + on(readline, #line(s => Console.log(s))) + on(readline, #close(() => Console.log("finished"))) } /* external on : */ @@ -121,13 +121,13 @@ module N = { /** let register readline = readline - |> on (`line begin fun [@bs] s -> Js.log s end) - |> on (`close begin fun [@bs] () -> Js.log \"finished\" end) + |> on (`line begin fun [@bs] s -> Console.log s end) + |> on (`close begin fun [@bs] () -> Console.log \"finished\" end) {[ let register readline = - on (`line begin fun [@bs] s -> Js.log s end) readline; - on (`close begin fun [@bs] () -> Js.log \"finished\" end) readline + on (`line begin fun [@bs] s -> Console.log s end) readline; + on (`close begin fun [@bs] () -> Console.log \"finished\" end) readline ]} */ @@ -136,13 +136,13 @@ let readN = N.read /** let register readline = readline - |> on (`line begin fun [@bs] s -> Js.log s end) - |> on (`close begin fun [@bs] () -> Js.log \"finished\" end) + |> on (`line begin fun [@bs] s -> Console.log s end) + |> on (`close begin fun [@bs] () -> Console.log \"finished\" end) {[ let register readline = - on (`line begin fun [@bs] s -> Js.log s end) readline; - on (`close begin fun [@bs] () -> Js.log \"finished\" end) readline + on (`line begin fun [@bs] s -> Console.log s end) readline; + on (`close begin fun [@bs] () -> Console.log \"finished\" end) readline ]} */ @@ -167,14 +167,14 @@ let hey = x => | #b | #d | #c) as u => - Js.log("u") - Js.log(u) + Console.log("u") + Console.log(u) | (#e | #f | #h) as v => - Js.log("v") - Js.log(v) + Console.log("v") + Console.log(v) } let () = Mt.from_pair_suites(__MODULE__, suites.contents) diff --git a/tests/tests/src/polyvar_test.res b/tests/tests/src/polyvar_test.res index ed27d1cc3e..35391c9174 100644 --- a/tests/tests/src/polyvar_test.res +++ b/tests/tests/src/polyvar_test.res @@ -19,4 +19,4 @@ let ff = { "A" } } -let () = Js.log((f(#A), ff, f1(#A))) +let () = Console.log((f(#A), ff, f1(#A))) diff --git a/tests/tests/src/prepend_data_ffi.res b/tests/tests/src/prepend_data_ffi.res index 68aa73e922..956812af57 100644 --- a/tests/tests/src/prepend_data_ffi.res +++ b/tests/tests/src/prepend_data_ffi.res @@ -78,12 +78,12 @@ let f = (x: t) => { @val external process_on_exit: (@as("exit") _, int => unit) => unit = "process.on" -let () = process_on_exit(exit_code => Js.log2("error code: %d", exit_code)) +let () = process_on_exit(exit_code => Console.log2("error code: %d", exit_code)) type process @send external on_exit: (process, @as("exit") _, int => unit) => unit = "on" -let register = (p: process) => p->on_exit(i => Js.log(i)) +let register = (p: process) => p->on_exit(i => Console.log(i)) @obj external io_config: (~stdio: @as("inherit") _, ~cwd: string, unit) => _ = "" diff --git a/tests/tests/src/print_alpha_test.res b/tests/tests/src/print_alpha_test.res index da1bd17a6f..a3c59c3c6e 100644 --- a/tests/tests/src/print_alpha_test.res +++ b/tests/tests/src/print_alpha_test.res @@ -5,7 +5,7 @@ let f = (h, (), x, y) => h(x, y) let f = (h, ()) => { let u = 1 + 2 - Js.log(u) + Console.log(u) (x, y) => h(x, y) } diff --git a/tests/tests/src/raw_output_test.res b/tests/tests/src/raw_output_test.res index 736cb3b17d..356ebb7ee3 100644 --- a/tests/tests/src/raw_output_test.res +++ b/tests/tests/src/raw_output_test.res @@ -11,4 +11,4 @@ let mk = fn => fn() */ mk(%raw(`(_)=> console.log('should works')`)) -Js.log((() => 1)()) +Console.log((() => 1)()) diff --git a/tests/tests/src/reactDOMRe.mjs b/tests/tests/src/reactDOMRe.mjs index 4a02d17a7b..2aea41486a 100644 --- a/tests/tests/src/reactDOMRe.mjs +++ b/tests/tests/src/reactDOMRe.mjs @@ -1,7 +1,6 @@ // Generated by ReScript, PLEASE EDIT WITH CARE import * as React from "react"; -import * as Js_array from "rescript/lib/es6/Js_array.js"; import * as ReactDom from "react-dom"; function renderToElementWithClassName(reactElement, className) { @@ -81,7 +80,7 @@ function hydrateToElementWithId(reactElement, id) { let Ref = {}; function createElementVariadic(domClassName, props, children) { - let variadicArguments = Js_array.concat(children, [ + let variadicArguments = children.concat([ domClassName, props ]); diff --git a/tests/tests/src/reactDOMRe.res b/tests/tests/src/reactDOMRe.res index 334f11c70c..1d9aadc98f 100644 --- a/tests/tests/src/reactDOMRe.res +++ b/tests/tests/src/reactDOMRe.res @@ -2141,7 +2141,7 @@ include ( external apply: ('theFunction, 'theContext, 'arguments) => 'returnTypeOfTheFunction = "apply" let createElementVariadic = (domClassName, ~props=?, children) => { - let variadicArguments = Js.Array.concat(children, [Obj.magic(domClassName), Obj.magic(props)]) + let variadicArguments = Array.concat(children, [Obj.magic(domClassName), Obj.magic(props)]) createElementInternalHack->apply(Js.Nullable.null, variadicArguments) } }: { diff --git a/tests/tests/src/reactTestUtils.res b/tests/tests/src/reactTestUtils.res index 74b7e62450..b3e9b2d913 100644 --- a/tests/tests/src/reactTestUtils.res +++ b/tests/tests/src/reactTestUtils.res @@ -80,7 +80,7 @@ module Simulate = { external querySelector: (Dom.element, string) => option = "querySelector" @send -external querySelectorAll: (Dom.element, string) => Js.Array.array_like = +external querySelectorAll: (Dom.element, string) => Array.arrayLike = "querySelectorAll" @get external textContent: Dom.element => string = "textContent" @@ -91,7 +91,7 @@ external createElement: (Dom.document, string) => Dom.element = "createElement" @send external appendChild: (Dom.element, Dom.element) => Dom.element = "appendChild" -let querySelectorAll = (element, string) => Js.Array.from(querySelectorAll(element, string)) +let querySelectorAll = (element, string) => Array.fromArrayLike(querySelectorAll(element, string)) module DOM = { open Belt diff --git a/tests/tests/src/reasonReact.mjs b/tests/tests/src/reasonReact.mjs index e1f8ab1ec5..69c9001d06 100644 --- a/tests/tests/src/reasonReact.mjs +++ b/tests/tests/src/reasonReact.mjs @@ -1,10 +1,9 @@ // Generated by ReScript, PLEASE EDIT WITH CARE import * as React from "react"; -import * as Js_array from "rescript/lib/es6/Js_array.js"; function createDomElement(s, props, children) { - let vararg = Js_array.concat(children, [ + let vararg = children.concat([ s, props ]); @@ -97,7 +96,7 @@ function wrapJsForReason(reactClass, props, children) { ref: extra$1, key: extra }); - let varargs = Js_array.concat(children, [ + let varargs = children.concat([ reactClass, props$1 ]); diff --git a/tests/tests/src/reasonReact.res b/tests/tests/src/reasonReact.res index 291e60d0fa..8e186e4b25 100644 --- a/tests/tests/src/reasonReact.res +++ b/tests/tests/src/reasonReact.res @@ -30,7 +30,7 @@ external cloneElement: (reactElement, ~props: {..}=?, array) => re external createElementVerbatim: 'a = "createElement" let createDomElement = (s, ~props, children) => { - let vararg = Js.Array.concat(children, [Obj.magic(s), Obj.magic(props)]) + let vararg = Array.concat(children, [Obj.magic(s), Obj.magic(props)]) /* Use varargs to avoid warnings on duplicate keys in children */ Obj.magic(createElementVerbatim)["apply"](Js.Nullable.null, vararg) } @@ -288,7 +288,7 @@ module WrapProps = { Js.Obj.assign(Js.Obj.empty(), Obj.magic(props)), {"ref": ref, "key": key}, ) - let varargs = Js.Array.concat(Obj.magic(children), [Obj.magic(reactClass), Obj.magic(props)]) + let varargs = Array.concat(Obj.magic(children), [Obj.magic(reactClass), Obj.magic(props)]) /* Use varargs under the hood */ Obj.magic(createElementVerbatim)["apply"](Js.Nullable.null, varargs) } diff --git a/tests/tests/src/rec_fun_test.res b/tests/tests/src/rec_fun_test.res index 568e8986ce..fc1a4bfffd 100644 --- a/tests/tests/src/rec_fun_test.res +++ b/tests/tests/src/rec_fun_test.res @@ -21,7 +21,7 @@ let g = () => { i + 1 } - Js.log(Js.Int.toString(next(0, true))) + Console.log(Js.Int.toString(next(0, true))) } g() diff --git a/tests/tests/src/record_debug_test.res b/tests/tests/src/record_debug_test.res index 9695de86e6..b23f41db71 100644 --- a/tests/tests/src/record_debug_test.res +++ b/tests/tests/src/record_debug_test.res @@ -45,10 +45,10 @@ module N0: { external f: int => int = "%identity" } -Js.log2("hei", v) +Console.log2("hei", v) let (a, c) = ((1, 2, 2, 4, 3), [1, 2, 3, 4, 5]) -Js.log2(a, c) +Console.log2(a, c) %%private(let i = 3) %%private(let a = (``, `a`)) diff --git a/tests/tests/src/regression_print.res b/tests/tests/src/regression_print.res index 4ff4f38a4d..7788886f35 100644 --- a/tests/tests/src/regression_print.res +++ b/tests/tests/src/regression_print.res @@ -1,7 +1,7 @@ include ( { @val external to_str: 'a => string = "JSON.stringify" - let debug = x => Js.log(to_str(x)) + let debug = x => Console.log(to_str(x)) let () = { debug(2) diff --git a/tests/tests/src/return_check.res b/tests/tests/src/return_check.res index 78f1b15adb..69c8831614 100644 --- a/tests/tests/src/return_check.res +++ b/tests/tests/src/return_check.res @@ -8,7 +8,7 @@ let test = dom => { switch elem { | None => 1 | Some(ui) => - Js.log(ui) + Console.log(ui) 2 } } @@ -26,7 +26,7 @@ let f_undefined = (xs, i) => let f_escaped_not = (xs, i) => { let x = get_undefined(xs, i) - Js.log("hei") + Console.log("hei") switch x { | Some(k) => k | None => 1 @@ -42,7 +42,7 @@ let f_escaped_1 = (xs, i) => { } } /* still okay */ -let f_escaped_2 = (xs, i) => Js.log(get_undefined(xs, i)) +let f_escaped_2 = (xs, i) => Console.log(get_undefined(xs, i)) @get_index @return(null_to_opt) external get_null: (array, int) => option = "" diff --git a/tests/tests/src/side_effect.res b/tests/tests/src/side_effect.res index 3d4c10ddd7..68a098f5f4 100644 --- a/tests/tests/src/side_effect.res +++ b/tests/tests/src/side_effect.res @@ -1 +1 @@ -Js.log(__MODULE__) +Console.log(__MODULE__) diff --git a/tests/tests/src/submodule.res b/tests/tests/src/submodule.res index ff288465a4..a7f00290db 100644 --- a/tests/tests/src/submodule.res +++ b/tests/tests/src/submodule.res @@ -1,17 +1,17 @@ module A0 = { - let () = Js.log(__LINE__) + let () = Console.log(__LINE__) let a0 = (x, y) => x + y + 1 module A1 = { - let () = Js.log(__LINE__) + let () = Console.log(__LINE__) let a1 = (x, y) => a0(x, y) + 1 module A2 = { - let () = Js.log(__LINE__) + let () = Console.log(__LINE__) let a2 = (x, y) => a1(x, y) + 1 module A3 = { - let () = Js.log(__LINE__) + let () = Console.log(__LINE__) let a3 = (x, y) => a2(x, y) + 1 module A4 = { - let () = Js.log(__LINE__) + let () = Console.log(__LINE__) let a4 = (x, y) => a3(x, y) + 1 } } diff --git a/tests/tests/src/test_bs_this.res b/tests/tests/src/test_bs_this.res index af32b4deb9..90e1eccc70 100644 --- a/tests/tests/src/test_bs_this.res +++ b/tests/tests/src/test_bs_this.res @@ -5,21 +5,21 @@ let even = @this (o, x) => x + o let bark = () => @this (o: 'self, x, y) => { - Js.log((o["length"], o["x"], o["y"], x, y)) + Console.log((o["length"], o["x"], o["y"], x, y)) x + y } let js_obj: 'self = { "bark": @this (o: 'self, x, y) => { - Js.log(o) + Console.log(o) x + y }, } let f = x => { - x["onload"] = @this o => Js.log(o) - x["addEventListener"]("onload", @this o => Js.log(o["response"])) + x["onload"] = @this o => Console.log(o) + x["addEventListener"]("onload", @this o => Console.log(o["response"])) } let u = @this (_: int, x: int) => x diff --git a/tests/tests/src/test_case_opt_collision.res b/tests/tests/src/test_case_opt_collision.res index 9a2599eb17..01975b2436 100644 --- a/tests/tests/src/test_case_opt_collision.res +++ b/tests/tests/src/test_case_opt_collision.res @@ -4,11 +4,11 @@ let eq = (loc, x, y) => Mt.eq_suites(~test_id, ~suites, loc, x, y) let f = (~x=3, y: int) => { let xOpt = x + 2 - Js.log(xOpt) + Console.log(xOpt) xOpt + y } -Js.log(f(2)) +Console.log(f(2)) eq(__LOC__, f(2), 7) diff --git a/tests/tests/src/test_cps.res b/tests/tests/src/test_cps.res index bb9c78d5ca..9a8b97afc0 100644 --- a/tests/tests/src/test_cps.res +++ b/tests/tests/src/test_cps.res @@ -70,7 +70,7 @@ let rec f = (n, acc) => acc() } else { f(n - 1, _ => { - n->Js.Int.toString->Js.log + n->Js.Int.toString->Console.log acc() }) } diff --git a/tests/tests/src/test_demo.res b/tests/tests/src/test_demo.res index 4e728172a2..2783d1a94e 100644 --- a/tests/tests/src/test_demo.res +++ b/tests/tests/src/test_demo.res @@ -52,7 +52,7 @@ let v = (a, ()): unit => ignore(true) a(3) } { - ignore(Js.log(3)) + ignore(Console.log(3)) } type cxt = diff --git a/tests/tests/src/test_for_loop.res b/tests/tests/src/test_for_loop.res index a0e95e4607..7f17eada1f 100644 --- a/tests/tests/src/test_for_loop.res +++ b/tests/tests/src/test_for_loop.res @@ -1,15 +1,15 @@ let for_ = x => for i in 0 to { - Js.log("hi") + Console.log("hi") ignore(3) Belt.Array.length(x) } { - Js.log(x[i]) + Console.log(x[i]) } let for_2 = x => for i in 0 to Belt.Array.length(x) { - Js.log(x[i]) + Console.log(x[i]) } let for_3 = x => { diff --git a/tests/tests/src/test_google_closure.res b/tests/tests/src/test_google_closure.res index 5e016273a9..5e4f5703e5 100644 --- a/tests/tests/src/test_google_closure.res +++ b/tests/tests/src/test_google_closure.res @@ -18,4 +18,4 @@ let (a, b, c) = ( }, ) -let () = Js.log((a, b, c)) +let () = Console.log((a, b, c)) diff --git a/tests/tests/src/test_int_map_find.res b/tests/tests/src/test_int_map_find.res index 8f2da1cb9b..e6d19393ef 100644 --- a/tests/tests/src/test_int_map_find.res +++ b/tests/tests/src/test_int_map_find.res @@ -15,11 +15,11 @@ include ( let assert_test = () => if m->IntMap.get(10) == Some('a') { - Js.log("hi") + Console.log("hi") } else { /* log ('a', "succeed") */ - Js.log("hi") + Console.log("hi") } }: {} ) diff --git a/tests/tests/src/test_let.res b/tests/tests/src/test_let.res index 6eb181c79c..8d8a8f074a 100644 --- a/tests/tests/src/test_let.res +++ b/tests/tests/src/test_let.res @@ -1,5 +1,5 @@ { let a = 3 - Js.log(a) + Console.log(a) } let b = 3 diff --git a/tests/tests/src/test_nullary.res b/tests/tests/src/test_nullary.res index 01388a0306..62c75be04a 100644 --- a/tests/tests/src/test_nullary.res +++ b/tests/tests/src/test_nullary.res @@ -1 +1 @@ -let f = _ => Js.log("hey") +let f = _ => Console.log("hey") diff --git a/tests/tests/src/test_order_tailcall.res b/tests/tests/src/test_order_tailcall.res index b1a76700b8..65b309835b 100644 --- a/tests/tests/src/test_order_tailcall.res +++ b/tests/tests/src/test_order_tailcall.res @@ -1,7 +1,7 @@ let rec f = (x, y) => f(y, x) let rec f1 = (x, y, z) => { - Js.log(z) + Console.log(z) f1(y, z, x) } diff --git a/tests/tests/src/test_primitive.res b/tests/tests/src/test_primitive.res index 0e39ee35a7..96c8d00f6e 100644 --- a/tests/tests/src/test_primitive.res +++ b/tests/tests/src/test_primitive.res @@ -37,7 +37,7 @@ let xxx = "a" let a = String.get(xxx, 0) let u = b => { let a = if b { - Js.log(1) + Console.log(1) 32 } else { 3 + 4 @@ -47,7 +47,7 @@ let u = b => { let f = (h, b, ()) => h( if b { - Js.log(1) + Console.log(1) 32 } else { 3 + 4 diff --git a/tests/tests/src/test_regex.res b/tests/tests/src/test_regex.res index c33b9f4148..d02adb5753 100644 --- a/tests/tests/src/test_regex.res +++ b/tests/tests/src/test_regex.res @@ -1,7 +1,7 @@ let v = /b/ig let r = /Bucklescript是一个程序语言/ -/* Js.log(v);; - Js.log(r);; */ +/* Console.log(v);; + Console.log(r);; */ let c = v diff --git a/tests/tests/src/test_side_effect_functor.res b/tests/tests/src/test_side_effect_functor.res index f078b61346..cff7ebc1d6 100644 --- a/tests/tests/src/test_side_effect_functor.res +++ b/tests/tests/src/test_side_effect_functor.res @@ -4,7 +4,7 @@ include ( let v = ref(0) { incr(v) - v.contents->Js.Int.toString->Js.log + v.contents->Js.Int.toString->Console.log } let u = 3 let use_v = () => v.contents diff --git a/tests/tests/src/test_static_catch_ident.res b/tests/tests/src/test_static_catch_ident.res index b893cb1ee4..196b76e2d7 100644 --- a/tests/tests/src/test_static_catch_ident.res +++ b/tests/tests/src/test_static_catch_ident.res @@ -4,8 +4,8 @@ let scanf_bad_input = (ib, x) => switch x { | Scan_failure(s) | Failure(s) => for i in 0 to 100 { - Js.log(s) /* necessary */ - Js.log("don't inlinie") + Console.log(s) /* necessary */ + Console.log("don't inlinie") } | x => raise(x) } diff --git a/tests/tests/src/test_string_const.res b/tests/tests/src/test_string_const.res index 613e183d58..316e1f6988 100644 --- a/tests/tests/src/test_string_const.res +++ b/tests/tests/src/test_string_const.res @@ -4,6 +4,6 @@ let f = String.get("ghsogh", 3) let hh = try String.get("ghsogh", -3) catch { | Invalid_argument(e) => - Js.log(e) + Console.log(e) 'a' } diff --git a/tests/tests/src/test_while_closure.res b/tests/tests/src/test_while_closure.res index 58fa9ad580..4c48416940 100644 --- a/tests/tests/src/test_while_closure.res +++ b/tests/tests/src/test_while_closure.res @@ -51,6 +51,6 @@ let f = () => { let () = { f() arr->Belt.Array.forEach(x => x()) - v.contents->Js.Int.toString->Js.log + v.contents->Js.Int.toString->Console.log assert(v.contents == 45) } diff --git a/tests/tests/src/test_while_side_effect.res b/tests/tests/src/test_while_side_effect.res index dbc49c3c66..1c175feacd 100644 --- a/tests/tests/src/test_while_side_effect.res +++ b/tests/tests/src/test_while_side_effect.res @@ -1,7 +1,7 @@ let v = ref(0) while { - v.contents->Js.Int.toString->Js.log + v.contents->Js.Int.toString->Console.log incr(v) v.contents < 10 } { @@ -17,10 +17,10 @@ let x = ref(3) while { let y = ref(3) - x.contents->Js.Int.toString->Js.log + x.contents->Js.Int.toString->Console.log incr(y) incr(x) fib(x.contents) + fib(x.contents) < 20 } { - 3->Js.Int.toString->Js.log + 3->Js.Int.toString->Console.log } diff --git a/tests/tests/src/then_mangle_test.res b/tests/tests/src/then_mangle_test.res index 308dd63486..11fcac5186 100644 --- a/tests/tests/src/then_mangle_test.res +++ b/tests/tests/src/then_mangle_test.res @@ -7,7 +7,7 @@ let {eq_suites} = module(Mt) let eq = (loc, x, y) => eq_suites(loc, x, y, ~test_id, ~suites) let then = (a, b) => { - Js.log("no inline") + Console.log("no inline") a * a + b * b } diff --git a/tests/tests/src/ticker.res b/tests/tests/src/ticker.res index 8692cade82..3bf55ab701 100644 --- a/tests/tests/src/ticker.res +++ b/tests/tests/src/ticker.res @@ -79,8 +79,8 @@ let print_all_composite = all_tickers => | {type_: Market, _} => () | {type_: Binary_op(_), ticker_name, value} => switch value { - | Some(v) => Js.log(ticker_name) - | None => Js.log(ticker_name) + | Some(v) => Console.log(ticker_name) + | None => Console.log(ticker_name) } } ) diff --git a/tests/tests/src/topsort_test.res b/tests/tests/src/topsort_test.res index 6877d510d7..4b808f930f 100644 --- a/tests/tests/src/topsort_test.res +++ b/tests/tests/src/topsort_test.res @@ -29,7 +29,7 @@ let rec dfs1 = (nodes, graph, visited) => if visited->List.has(x, \"==") { dfs1(xs, graph, visited) } else { - Js.log(x) + Console.log(x) dfs1(\"@"(nexts(x, graph), xs), graph, list{x, ...visited}) } } @@ -37,7 +37,7 @@ let rec dfs1 = (nodes, graph, visited) => let () = { assert(dfs1(list{"a"}, graph, list{}) == list{"a", "d", "e", "g", "f", "c", "b"}) - Js.log() + Console.log() assert(dfs1(list{"b"}, list{("f", "d"), ...graph}, list{}) == list{"b", "e", "g", "f", "d"}) } diff --git a/tests/tests/src/typeof_test.res b/tests/tests/src/typeof_test.res index 22fb866330..5d6e37d51f 100644 --- a/tests/tests/src/typeof_test.res +++ b/tests/tests/src/typeof_test.res @@ -2,21 +2,21 @@ let string_or_number = (type t, x) => { let ty = Js.Types.classify(x) switch ty { | JSString(v) => - Js.log(v ++ "hei") + Console.log(v ++ "hei") true /* type check */ | JSNumber(v) => - Js.log(v +. 3.) + Console.log(v +. 3.) true /* type check */ | JSUndefined => false | JSNull => false | JSFalse | JSTrue => false | JSFunction(_) => - Js.log("Function") + Console.log("Function") false | JSObject(_) => false | JSSymbol(_) => false | JSBigInt(v) => - v->Js.BigInt.toString->Js.log + v->Js.BigInt.toString->Console.log true } } diff --git a/tests/tests/src/unboxed_use_case.res b/tests/tests/src/unboxed_use_case.res index d05f2af98e..f3e071db3e 100644 --- a/tests/tests/src/unboxed_use_case.res +++ b/tests/tests/src/unboxed_use_case.res @@ -15,7 +15,7 @@ let hi = [Any(3), Any(2), Any("x")] let dump = (any: any) => switch any { - | Any(v) => Js.log(v) + | Any(v) => Console.log(v) } let () = { diff --git a/tests/tests/src/uncurry_test.res b/tests/tests/src/uncurry_test.res index 271e969564..2249de5f66 100644 --- a/tests/tests/src/uncurry_test.res +++ b/tests/tests/src/uncurry_test.res @@ -4,10 +4,10 @@ let f0 = () => 0 let f1 = a0 => a0 let f2 = (a0, a1) => (a0, a1) -f0()->Js.log -f1(0)->Js.log +f0()->Console.log +f1(0)->Console.log -f2(0, 1)->Js.log +f2(0, 1)->Console.log let rec xx = () => xx() diff --git a/tests/tests/src/undef_regression_test.res b/tests/tests/src/undef_regression_test.res index b81e30fc0c..6fa13b8906 100644 --- a/tests/tests/src/undef_regression_test.res +++ b/tests/tests/src/undef_regression_test.res @@ -7,6 +7,6 @@ let f = obj => let size = size_of_t(obj) switch Js.Undefined.toOption(size) { | None => () - | Some(s) => Js.log(s) + | Some(s) => Console.log(s) } } /* TODO: This case should be peepwholed .. */ diff --git a/tests/tests/src/unit_undefined_test.res b/tests/tests/src/unit_undefined_test.res index 45e7d2174d..c8b4e0a0b9 100644 --- a/tests/tests/src/unit_undefined_test.res +++ b/tests/tests/src/unit_undefined_test.res @@ -15,7 +15,7 @@ let eq = (loc, x, y) => Mt.eq_suites(~test_id, ~suites, loc, x, y) let f_01 = () => hi((() as x) => if x == () { - Js.log("x") + Console.log("x") } ) /* FIXME: not inlined */ diff --git a/tests/tests/src/update_record_test.res b/tests/tests/src/update_record_test.res index c1b98992d2..e882a40bea 100644 --- a/tests/tests/src/update_record_test.res +++ b/tests/tests/src/update_record_test.res @@ -1,7 +1,7 @@ let suites: ref = ref(list{}) let test_id = ref(0) let eq = (loc, x, y) => { - Js.log((x, y)) + Console.log((x, y)) incr(test_id) suites := list{ diff --git a/tests/tests/src/variantsMatching.res b/tests/tests/src/variantsMatching.res index a31704cc1b..1c7be9d907 100644 --- a/tests/tests/src/variantsMatching.res +++ b/tests/tests/src/variantsMatching.res @@ -172,7 +172,7 @@ module MyNullable = { } let expectSeven = plus(Present(3), Present(4)) - Js.log2("expect 7:", expectSeven) + Console.log2("expect 7:", expectSeven) } module MyNullableExtended = { @@ -212,7 +212,7 @@ module MyNullableExtended = { } let expectSeven = plus(Present({x: 4., y: 3.}), Present({x: 3., y: 4.})) - Js.log2("expect {x:7, y:7}:", expectSeven) + Console.log2("expect {x:7, y:7}:", expectSeven) } module TaggedUnions = {