* Import of Intl.Locale from #39664
* Handle updating es2020.intl and add es2021 for new DateTimeFormatOptions options - re: #39664
* Extends DateTimeFormatOptions for new Intl APIs - re: #45420
* Handle migrating Intl.NumberFormat.formatToParts to es2018 (keeping esnext.intl around)
* Adds Intl.DisplayNames to es2020 - re: #44022
* Remove attributes added in es2021 from es2020 - re: #42944
* Add a reference to es2021 in the command line parser
* Adds some docs about the lib files
* Baselines
* Allow undefined in Intl inputs to allow for ergonomic usage of exactOptionalPropertyTypes - see #45652
* Adds some tests covering the APIs
* Apply suggestions from code review
Co-authored-by: Nathan Shively-Sanders <293473+sandersn@users.noreply.github.com>
* Handle PR feedback
* More review improvements
Co-authored-by: Nathan Shively-Sanders <293473+sandersn@users.noreply.github.com>
* Mark properties defined in Annex B as deprecated
* Tweak
* Update baselines
* Update fourslash tests
* Add completionsStringMethods.ts test
* Fix sortText value in fourslash test for deprecated tags
* Update package-lock.json
* Update package-lock.json
* Mark Non-standard RegExp Constructor properties as deprecated
* Update baselines
Co-authored-by: TypeScript Bot <typescriptbot@microsoft.com>
* Accept generics for defineProperty
Both `Object.defineProperty()` and `Object.defineProperties()` return their
first argument. Use a generic so that typings can be passed through.
* Update baselines
* update missed baseline
Co-authored-by: Nathan Shively-Sanders <293473+sandersn@users.noreply.github.com>
PR #38449 changed the second overload of the constructor for Int8,
Uint8, Int32, Uint32, Int16, Uint16, Float, Float64 -Array so that it no
longer includes `ArrayBufferLike`. It's just `ArrayLike<number>`.
This is fine except in the case that
the caller provides exactly `ArrayLike<number> | ArrayBufferLike`. This
PR adds ArrayBufferLike back so that the union is once again accepted.
This avoids a breaking change, in particular in one Microsoft-internal
codebase.
* Updates Uint8ArrayConstructor to match MDN documentation.
https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Uint8Array/Uint8Array
```
new Uint8Array(); // new in ES2017
new Uint8Array(length);
new Uint8Array(typedArray);
new Uint8Array(object);
new Uint8Array(buffer [, byteOffset [, length]]);
```
While the previous constructors aren't significantly different from the new, it would prevent someone from doing `new Uint8Array(myBuffer, undefined, undefined)` since there was no overload that accepted undefined as a second parameter and buffer as first.
Fixes#38446
* Fixes constructor defenition for all other typed arrays.
* Renames property to `array` since it is no longer an `arrayOrBuffer`.
* Add the 'awaited' type operator
* Add script to manually add reviewers to a PR when GH 'Suggested Reviewers' breaks
* Fix lint error in review script
* Only defer generic awaited type for possible thenable
* Add variance-like behavior for awaited
* Switch awaited type params to 'unreliable' variance
* fix typo in inferTypes
* LKG without syntax in lib
* LKG with new syntax in lib
* Add 'strictAwaitedTypes' flag
* Treat strictAwaitedTypes as strict-mode flag
* Rename TAll, remove duplicate definition of 'race'
* Apply suggestions from code review
Co-Authored-By: ExE Boss <3889017+ExE-Boss@users.noreply.github.com>
* Fix inference priority
* Update comment to isGenericAwaitableType
* Add overloads for then/catch to Promise
* Add inference heuristic for T | PromiseLike<T> (for any PromiseLike)
* Remove strictAwaitedTypes flag
Co-authored-by: ExE Boss <3889017+ExE-Boss@users.noreply.github.com>
* make splice `deleteCount` required in es5.d.ts
In ES5 `deleteCount` is not an optional argument. If it is not provided it defaults to 0 as a side effect of `undefined` being converted to an integer.
In ES6 `deleleteCount` is optional, and it defaults to the length of the array minus the start index.
If you are targeting ES5 but don't provide `deleteCount` the behaviour will be different depending on the environment your build is running in.
fixes#32638
* update baselines
Previously subtypes of Error extended Error, but the matching subtypes
of ErrorConstructor did not extend ErrorConstructor. The members in
es5.d.ts are identical, so there's no need except for allowing interface
merging into ErrorConstructor to affect subtypes as well.
* Add this-parameter workaround to Array.filter
Allows anys.filter(Boolean) to once again return any[], not unknown[].
* Add any constraint to Boolean factory function
I want to test how well this works.
* Remove Boolean factory type guard
* Remove typeGuardBoolean test