Skip to content

Commit c0db41d

Browse files
authored
remove Undefined module. Nullable or option directly (where appropriate) can be used instead (#59)
1 parent 4bbd304 commit c0db41d

8 files changed

+3
-116
lines changed

CHANGELOG.md

+1
Original file line numberDiff line numberDiff line change
@@ -12,6 +12,7 @@
1212
- Fixed type signatures of `Array.fromArrayLikeWithMap` and `Array.fromIteratorWithMap`. https://github.com/rescript-association/rescript-core/pull/50
1313
- Remove internal async/await helpers that do not need to be exposed in `Core`.
1414
- Add locale and formatting options to `localeDateString`, `localeString` and `localTimeString` functions https://github.com/rescript-association/rescript-core/pull/30
15+
- Remove `Undefined` module. `Nullable` or `option` directly (where appropriate) can be used instead. https://github.com/rescript-association/rescript-core/pull/59
1516
- Change `RegExp.source` to return a `string`. Was previously returning a `bool`, which is wrong. https://github.com/rescript-association/rescript-core/pull/47
1617
- Remove `Date.valueOf` as it returns the same as `Date.getTime`. https://github.com/rescript-association/rescript-core/pull/61
1718

src/Core__Undefined.mjs

-15
This file was deleted.

src/Core__Undefined.res

-15
This file was deleted.

src/Core__Undefined.resi

-75
This file was deleted.

src/RescriptCore.mjs

-3
Original file line numberDiff line numberDiff line change
@@ -33,8 +33,6 @@ var $$RegExp;
3333

3434
var $$String;
3535

36-
var Undefined;
37-
3836
var $$Symbol;
3937

4038
var Type;
@@ -112,7 +110,6 @@ export {
112110
$$Promise ,
113111
$$RegExp ,
114112
$$String ,
115-
Undefined ,
116113
$$Symbol ,
117114
Type ,
118115
$$JSON ,

src/RescriptCore.res

+1-2
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,6 @@ module Object = Core__Object
1616
module Promise = Core__Promise
1717
module RegExp = Core__RegExp
1818
module String = Core__String
19-
module Undefined = Core__Undefined
2019
module Symbol = Core__Symbol
2120
module Type = Core__Type
2221
module JSON = Core__JSON
@@ -49,7 +48,7 @@ module Intl = Core__Intl
4948
@val external globalThis: {..} = "globalThis"
5049

5150
external null: Core__Null.t<'a> = "#null"
52-
external undefined: Core__Undefined.t<'a> = "#undefined"
51+
external undefined: Core__Nullable.t<'a> = "#undefined"
5352
external typeof: 'a => Core__Type.t = "#typeof"
5453

5554
type t<'a> = Js.t<'a>

test/TempTests.mjs

+1-4
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,6 @@ import * as Core__Array from "../src/Core__Array.mjs";
88
import * as Core__Float from "../src/Core__Float.mjs";
99
import * as Core__BigInt from "../src/Core__BigInt.mjs";
1010
import * as Core__Option from "../src/Core__Option.mjs";
11-
import * as Core__Undefined from "../src/Core__Undefined.mjs";
1211

1312
console.info("");
1413

@@ -311,8 +310,6 @@ var resolvedOptions = new Intl.DateTimeFormat().resolvedOptions();
311310

312311
var timeZone = resolvedOptions.timeZone;
313312

314-
var x$1 = Core__Undefined.fromOption(1);
315-
316313
var z = 1.2 % 1.4;
317314

318315
var intFromBigInt = Core__BigInt.toInt(BigInt("10000000000"));
@@ -350,11 +347,11 @@ export {
350347
result$1 as result,
351348
set ,
352349
regexp ,
350+
x ,
353351
array$1 as array,
354352
timeout ,
355353
resolvedOptions ,
356354
timeZone ,
357-
x$1 as x,
358355
z ,
359356
intFromBigInt ,
360357
Bugfix ,

test/TempTests.res

-2
Original file line numberDiff line numberDiff line change
@@ -194,8 +194,6 @@ if globalThis["hello"] !== undefined {
194194
let resolvedOptions = Intl.DateTimeFormat.make()->Intl.DateTimeFormat.resolvedOptions
195195
let timeZone = resolvedOptions["timeZone"]
196196

197-
let x = Some(1)->Undefined.fromOption
198-
199197
let z = Float.mod(1.2, 1.4)
200198

201199
let intFromBigInt = BigInt.fromString("10000000000")->BigInt.toInt

0 commit comments

Comments
 (0)