Skip to content

Use Js.Types.symbol for Core__Symbol.t #145

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 2 commits into from
Jun 30, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -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`
Expand Down
2 changes: 1 addition & 1 deletion src/Core__Symbol.res
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
type t
type t = Js.Types.symbol

@val external make: string => t = "Symbol"
@val external getFor: string => t = "Symbol.for"
Expand Down
5 changes: 5 additions & 0 deletions src/Core__Type.mjs
Original file line number Diff line number Diff line change
Expand Up @@ -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,
Expand Down