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` 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,