Skip to content

Commit 3c4b033

Browse files
authored
Add @notundefined attribute to more Stdlib abstract types (#7464)
* Add @notundefined attribute to Stdlib_Map.t * Add @notundefined attribute to Stdlib_Set.t * Add @notundefined attribute to Stdlib_WeakMap.t and Stdlib_WeakSet.t * Add @notundefined attribute to Stdlib_TypedArray * Add @notundefined attribute to Stdlib_Symbol * Add @notundefined attribute to Stdlib_JsError * Add @notundefined attribute to Stdlib_ArrayBuffer * Add @notundefined attribute to Stdlib_DataView * Add @notundefined attribute to Stdlib_Iterator * Add @notundefined attribute to Stdlib_AsyncIterator * Remove outdated comment regarding Intl.Segmenter Firefox compatibility * Add @notundefined attribute to Stdlib_Intl_* * Typo * Use throw instead of deprecated raise in internal unused test * Restore trimmed whitespace * Add CHANGELOG entry
1 parent e9bc2c1 commit 3c4b033

33 files changed

+144
-9
lines changed

CHANGELOG.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -45,6 +45,7 @@
4545

4646
- In type errors, recommend stdlib over Belt functions for converting between float/int/string. https://github.com/rescript-lang/rescript/pull/7453
4747
- Remove unused type `Jsx.ref`. https://github.com/rescript-lang/rescript/pull/7459
48+
- Add `@notUndefined` attribute to all relevant abstract types in `Stdlib`. https://github.com/rescript-lang/rescript/pull/7464
4849

4950
# 12.0.0-alpha.12
5051

runtime/Stdlib_ArrayBuffer.res

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,4 @@
1+
@notUndefined
12
type t
23

34
@new external make: int => t = "ArrayBuffer"

runtime/Stdlib_AsyncIterator.res

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,4 @@
1+
@notUndefined
12
type t<'a>
23

34
type value<'a> = {

runtime/Stdlib_AsyncIterator.resi

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -6,6 +6,7 @@ See [async iterator protocols](https://developer.mozilla.org/en-US/docs/Web/Java
66
/**
77
The type representing an async iterator.
88
*/
9+
@notUndefined
910
type t<'a>
1011

1112
type value<'a> = {

runtime/Stdlib_DataView.res

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,4 @@
1+
@notUndefined
12
type t
23

34
@new external fromBuffer: Stdlib_ArrayBuffer.t => t = "DataView"

runtime/Stdlib_Intl_Collator.res

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,4 @@
1+
@notUndefined
12
type t
23

34
type usage = [#sort | #search]

runtime/Stdlib_Intl_DateTimeFormat.res

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,4 @@
1+
@notUndefined
12
type t
23

34
type dateStyle = [#full | #long | #medium | #short]

runtime/Stdlib_Intl_ListFormat.res

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,4 @@
1+
@notUndefined
12
type t
23

34
type listType = [

runtime/Stdlib_Intl_Locale.res

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,4 @@
1+
@notUndefined
12
type t
23

34
type options = {

runtime/Stdlib_Intl_NumberFormat.res

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,6 @@
11
module Grouping = Stdlib_Intl_NumberFormat_Grouping
22

3+
@notUndefined
34
type t
45

56
/**
@@ -211,7 +212,7 @@ external formatBigIntRangeToParts: (t, ~start: bigint, ~end: bigint) => array<nu
211212
external formatStringToParts: (t, string) => array<numberFormatRangePart> = "formatToParts"
212213

213214
/**
214-
`ignore(numberGrouping)` ignores the provided numberGrouping and returns unit.
215+
`ignore(numberFormat)` ignores the provided numberFormat and returns unit.
215216
216217
This helper is useful when you want to discard a value (for example, the result of an operation with side effects)
217218
without having to store or process it further.

0 commit comments

Comments
 (0)