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.
* Add separate flag serverMode for server mode to allow back compatibility
* Addressed code review feedback.
Co-authored-by: Daniel Rosenwasser <DanielRosenwasser@users.noreply.github.com>
* Limit auto import provider project size
* Add test
* Make option configurable
* Fix test
* Only bail when setting is auto
* Fix other test
* Update API baseline
* added Error 5084 to diagnosticMessages.json
* added test case errorForBareSpecifierWithImplicitModuleResolution1 to tests/cases/compiler
* modified checker.ts to report error 5084 when classic resolution and incorrect path are used
* added baseline changes
* passes all test cases including src/testRunner/unittests/ tests
* Update with feedback
* Make it check whether it is the right module resolution kind
* Use the right diagnostic message in tsserver tests
Co-authored-by: Meera Shivakumar <mshivaku@umich.edu>
Co-authored-by: Orta <git@orta.io>
* 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`.
* Fix this parameter emit for JSDocFunction types
Previously, parameters with names that were not `new` were treated like
rest parameters. This is incorrect: parameters with the name `this`
should emit a `this` parameter.
Fixes#38550
* ❤️ quote style
Use only the relevant declarations (by collecting them in the for loop),
and use `declaration` if `getNameOfDeclaration` didn't work (useful for
`export default` with anonymous functions).
Fixes#39804.
Also, use `nodeIsPresent` once, and a random `?.`.