From e537c9fe20c2c4abd86777f428b4cdc3468ab28e Mon Sep 17 00:00:00 2001 From: Dmitry Zakharov Date: Fri, 30 Jun 2023 18:32:00 +0400 Subject: [PATCH 1/2] Use Js.Types.symbol for Core__Symbol.t --- src/Core__Symbol.res | 2 +- src/Core__Type.mjs | 5 +++++ 2 files changed, 6 insertions(+), 1 deletion(-) diff --git a/src/Core__Symbol.res b/src/Core__Symbol.res index 1dc2b9b6..8b4c1b21 100644 --- a/src/Core__Symbol.res +++ b/src/Core__Symbol.res @@ -1,4 +1,4 @@ -type t +type t = Js.Types.symbol @val external make: string => t = "Symbol" @val external getFor: string => t = "Symbol.for" diff --git a/src/Core__Type.mjs b/src/Core__Type.mjs index 8ea2b647..ec38c9ca 100644 --- a/src/Core__Type.mjs +++ b/src/Core__Type.mjs @@ -4,6 +4,11 @@ function classify(value) { var match = Object.prototype.toString.call(value); switch (match) { + case "[object BigInt]" : + return { + TAG: /* BigInt */6, + _0: value + }; case "[object Boolean]" : return { TAG: /* Bool */0, From 1d00d7906f2b6e405e043cb3d7d4197f750e3963 Mon Sep 17 00:00:00 2001 From: Dmitry Zakharov Date: Fri, 30 Jun 2023 20:35:22 +0400 Subject: [PATCH 2/2] Update changelog --- CHANGELOG.md | 1 + 1 file changed, 1 insertion(+) diff --git a/CHANGELOG.md b/CHANGELOG.md index 90ba7c72..66ec2a55 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -5,6 +5,7 @@ ### API changes - Map, Set, WeakMap, WeakSet: use the types defined in the Js namespace. https://github.com/rescript-association/rescript-core/pull/143 +- Symbol: use the types defined in the Js namespace. https://github.com/rescript-association/rescript-core/pull/145 - `Array` mutable & immutable helper name changed to conform to JS' upcoming APIs [such as `toSorted`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Array/toSorted) - `sort` -> `toSorted`, `sortInPlace` -> `sort` - `reverse` -> `toReversed`, `reverseInPlace` -> `reverse`