Commit Graph
36117 Commits
Author SHA1 Message Date
2ea2f4f9a0 Bigint constructor forbids object null undefined (#43204)
* Update es2020.bigint.d.ts

* Update es2020.bigint.d.ts

* Update package-lock.json

* Update package-lock.json

* Update package-lock.json

* Update package-lock.json

* Update package-lock.json

* Update package-lock.json

* Update package-lock.json

* Update package-lock.json

* Update package-lock.json

* Update package-lock.json

* Update package-lock.json

* Update package-lock.json

* Update package-lock.json

* Update package-lock.json

* Update package-lock.json

* Update package-lock.json

* Update package-lock.json

* Update package-lock.json

* Update package-lock.json

* Update package-lock.json

* Update package-lock.json

* Update package-lock.json

* Update package-lock.json

* Update package-lock.json

* Update package-lock.json

* Update package-lock.json

* add a test

Co-authored-by: 龙腾道 <LongTengDao@LongTengDao.com>
Co-authored-by: TypeScript Bot <typescriptbot@microsoft.com>
2021-03-11 16:51:03 -08:00
e44d39d4eb Updated error message for TS2539 (#39827)
* Updated error message for TS2539

* Switch to multiple error messages

* inline variable

Co-authored-by: Nathan Shively-Sanders <293473+sandersn@users.noreply.github.com>
2021-03-11 15:51:15 -08:00
Sheetal NandiandGitHub 9933c8ac7d Build info baseline improvements (#43200)
* Use ids as 1 based so we can specialize `0` to be some special meaning

* Baseline tsbuildinfo size in the readable baseline

* Baseline fileName and fileNames list as well in readable tsbuildinfo so that new additions are easy to recognize
2021-03-11 13:30:06 -08:00
2643e65da4 Add missing relationship allowing a type to be assignable to a conditional when assignable to both branches (#30639)
* Finally add that missing relationship allowing a type to be assignable to both branches of a conditional

* Explicitly write out Ternary.Maybe

* Add slightly modified example from #25413

* fix sick sentence

* Loosen check to skip false branch constraint check to consider `infer` parameters as always satisfied in the extends clause

* Simplify things a bit, only instantiate once

Co-authored-by: Nathan Shively-Sanders <293473+sandersn@users.noreply.github.com>
2021-03-11 11:56:55 -08:00
b2d1f537f1 Bloomberg computed property name fix (#43197)
* Fix property name bindings for class expr in loops

* Fix block-scope capturing with prop initializers

Co-authored-by: Joey Watts <joey.watts.96@gmail.com>
2021-03-11 10:32:42 -08:00
998ecd9c06 Add a test for JSX namespace lookup with jsx: preserve, jsxImportSource (#41676)
* Add a test for JSX namespace lookup with `jsx: preserve, jsxImportSource`

* updated baselines

Co-authored-by: Nathan Shively-Sanders <293473+sandersn@users.noreply.github.com>
2021-03-11 09:07:33 -08:00
dcaefe732e Accept generics for defineProperty (#42424)
* 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>
2021-03-11 07:57:42 -08:00
Titian Cernicova-DragomirandGitHub 71661b932a Fixed issue where non null assertion caused getFlowTypeOfReference to return the declared type if the type was already narrowed to never. (#35863)
This was caused by the fact that getTypeWithFacts(resultType, TypeFacts.NEUndefinedOrNull) will return never both if resultType was already never and if resultType does not contain undefined or null. In the latter case returning the declaring type is correct, in the former case this causes something narrowed to never to still be typed as the original declared type.
2021-03-11 07:33:33 -08:00
Jack WilliamsandGitHub 3d6650eb4f Fix #38608 (#38610)
* Fix #38608

* Work for narrowed non-unions

* Add comment
2021-03-11 07:32:49 -08:00
Ryan CavanaughandGitHub 79d3058b83 Don't crash when renaming a JS property declared via module.exports (#40297)
Fixes #38070

When the originating definition was of the form
```js
module.exports.foo = expr
```
we were incorrectly trying to call `resolveName` on just the `foo` portion to get the "local" symbol, which simply failed to resolve (or would have resolved to the wrong thing), but for this form, the local symbol is just the containing property access expression
2021-03-11 07:23:19 -08:00
Oleksandr TandGitHub 3c576f108c fix(41027): handle unused static members (#41103) 2021-03-11 06:39:20 -08:00
TypeScript Bot 5053b0b987 Update package-lock.json 2021-03-11 06:24:57 +00:00
f4d0ea6539 Add target: ES2021 (#41239)
* Support `target: es2020`

* use CRLF

* update symbols

Co-authored-by: Nathan Shively-Sanders <293473+sandersn@users.noreply.github.com>
2021-03-10 13:31:25 -08:00
b20331a4db Fix missing func modifier (#40379)
* Fix missing function modifier

* Update src/services/refactors/convertArrowFunctionOrFunctionExpression.ts

Co-authored-by: Ron Buckton <ron.buckton@microsoft.com>

Co-authored-by: Ron Buckton <ron.buckton@microsoft.com>
2021-03-10 09:34:31 -08:00
Oleksandr TandGitHub b1f86eca3e fix(42265): Error accessing abstract property in constructor via destructuring (#42276) 2021-03-10 07:26:50 -08:00
TypeScript Bot 2e49e286ae Update package-lock.json 2021-03-10 06:24:41 +00:00
Sheetal NandiandGitHub acc8f2fb05 Ensure that when new file affecting global scope is added, the signatures are updated (#43084)
* Ensure that when new file affecting global scope is added, the signatures are updated

* Update src/compiler/builder.ts

* Better comment
2021-03-09 17:40:02 -08:00
6e4456b3b4 Optimize the size for tsbuildinfo (#43155)
* Baseline readable buildinfo

* Use file names as index in file name list
This is extension of the idea given by @sokra to optimize size of tsbuildinfo

* Deduplicate reference map lists and use file name index to sort them
Different implementation of #43079 based on idea suggested by @sokra

* Minimal json.stringify for the tsbuildinfo
Again implementaion of suggestion by @sokra

* Update src/testRunner/unittests/tsbuild/helpers.ts

Co-authored-by: Tobias Koppers <tobias.koppers@googlemail.com>

* Readable version of buildinfo all the time

* Some renames for readability as per feedback

Co-authored-by: Tobias Koppers <tobias.koppers@googlemail.com>
2021-03-09 16:15:26 -08:00
Tarik EshaqandGitHub 626e78c959 Clearifies protected error message (#42599) 2021-03-09 15:58:31 -08:00
3d53661605 Don't inherit jsdoc tags from overloaded signatures (#43165)
Previously, when getting jsdoc for signatures, the services layer would
get the jsdoc tags for the base symbol of a signature if it was
present. This is fine except when the base was overloaded. In that case,
the multiple signatures of the overload would all contribute jsdoc,
which is not correct.

A more correct fix would be to resolve overloads to the base, but
the compiler doesn't have this capability and adding it or jury-rigging
it seems like it would be complex, inappropriate for a fix to ship in a
patch version.

Co-authored-by: Orta Therox <git@orta.io>

Co-authored-by: Orta Therox <git@orta.io>
2021-03-09 12:28:36 -08:00
Ron BucktonandGitHub ec4863cc0e Fix37991 (#43166)
* Add failing test

* Fix tslib check errors for commonjs imports
2021-03-09 11:43:19 -08:00
Oleksandr TandGitHub 9610c16cc8 fix(42380): include JSDoc comments in declarations for static/prototype methods (#42454) 2021-03-09 11:37:40 -08:00
TypeScript Bot d9f5a85d5b Update package-lock.json 2021-03-09 06:24:45 +00:00
TypeScript Bot 4d506240de Update package-lock.json 2021-03-08 06:24:47 +00:00
TypeScript Bot f7cd70291c Update package-lock.json 2021-03-07 06:24:13 +00:00
Anders HejlsbergandGitHub f918bd9c76 Exclude enum/number compatibility rule from comparable relation (#42472)
* Exclude old number/enum literal compatibility rule from comparable relation

* Add tests

* Accept new baselines
2021-03-06 06:52:00 -08:00
Anders HejlsbergandGitHub ba56fca0bf Remove undefined from optional properties when inferring to index signatures (#43086)
* Remove undefined from optional properties when inferring to index signatures

* Add tests
2021-03-06 06:51:02 -08:00
TypeScript Bot 7394efc9be Update package-lock.json 2021-03-06 06:24:11 +00:00
SangandGitHub 612a96e161 Update parseInt parameter name and jsdoc (#42756)
* feat(lib): improve parseInt type definition and docstring

* Accepted baselines

* update tests
2021-03-05 11:23:08 -08:00
Jonas HübotterandGitHub 25375a2213 Unnecessary elaboration about not being assignable to type parameters (#42952) 2021-03-05 11:15:05 -08:00
Anders HejlsbergandGitHub 408c804103 Properly instantiate inferred constraints in conditional types (#42747)
* fix combined type mapper in getConditionalType

* Add regression tests
2021-03-05 07:26:27 -08:00
TypeScript Bot f0a72e2450 Update package-lock.json 2021-03-05 06:24:30 +00:00
Daniel RosenwasserandGitHub 9862b031b0 Relax requirements on index signatures to 'any' when a type also contains a string index signature to 'any' (#43065)
* Added test.

* Accepted baselines.

* Allow other index signatures to 'any' if there is a string index signature to 'any'.

* Accepted baselines.
2021-03-04 17:42:00 -08:00
Oleksandr TandGitHub ca8d9e4402 fix(39836): allow type declaration/unknown type in catch arguments in JavaScript files (#42392) 2021-03-04 17:19:35 -08:00
Ron BucktonandGitHub 38fdce9440 Expose 'reservedInNestedScopes' option when creating temp and loop variables (#43083) 2021-03-04 15:37:45 -08:00
Nathan Shively-SandersandGitHub e234f0c094 Update the DOM: March 03, 2021 (#43070)
* Update the DOM: March 03, 2021

Mostly Typescript-DOM-lib-generator#915

* update baselines
2021-03-04 06:28:00 -08:00
Daniel RosenwasserandGitHub 1f6a8d7aee Do a shallow clone for Docker tests. (#42966)
* Do a shallow clone for docker tests.

* Remove the 'pull' step from the Docker files.
2021-03-03 22:35:48 -08:00
TypeScript Bot 3e05aa6f0d Update package-lock.json 2021-03-04 06:23:49 +00:00
Klaus MeinhardtandGitHub 15e69acc20 capture thisArg of optionalChaining in parens (#35494)
Fixes: #35476
2021-03-03 19:35:17 -08:00
Armando AguirreandGitHub 8a81a6722d Merge pull request #43055 from armanio123/FixDefineForClassFields
Filter transient flags to fix useDefineForClassFields
2021-03-03 15:38:41 -08:00
7751ecb544 fix receiver on calls of imported and exported functions (#35877)
* fix receiver of imported and exported functions

fixes: #35420

* Rebase against master and clean up substitution flow

* Add evaluator tests

* Fix evaluator tests

Co-authored-by: Ron Buckton <ron.buckton@microsoft.com>
2021-03-03 10:38:32 -08:00
TypeScript Bot a8742e35cb Update package-lock.json 2021-03-03 06:24:15 +00:00
Armando Aguirre 652199ace6 Added tests 2021-03-02 20:38:37 -08:00
Nathan Shively-SandersandGitHub 6cd87d00b3 Delete old, different-case name of quickInfoJSDocTags.baseline (#43052) 2021-03-02 17:43:20 -08:00
Sheetal NandiandGitHub 0cf834ceec Move fixed chunk size polling as a watch option and move it out of server (#42542)
* Move fixed chunk size polling as a watch option and move it out of server
Fixes #41549

* Feedback
2021-03-02 16:45:53 -08:00
Nathan Shively-SandersandGitHub 5dbb110497 Baseline completions and signature help (#43049)
* Initial implementation+first big transitions

* about 10 more

* Change baseline filename + more baselines

1. Use containing file name instead of first @Filename.
2. Switch the rest of the tests I need for @link over to baselines.

* fix lint

* Remove unused/incorrectly named fourslash baselines

* fix incorrectly updated baselines

* dedupe non-unique filenames

* Add names to marker baselines

Also rename another duped test filename.

* Fix semicolon lint
2021-03-02 16:33:32 -08:00
Oleksandr TandGitHub f1c911b6c6 fix(43006): skip trivia in a function name (#43021) 2021-03-02 16:32:28 -08:00
c497b487a7 Add undefined to Symbol.valueDeclaration (#43033)
* About halfway through the checker

I'm going to merge with master to avoid clashing with the declaration
fix.

* Add undefined to Symbol.valueDeclaration

Also add undefined to a number of utility functions that have always
accepted it, but never added it to their type.

* Fix lint from code review

Co-authored-by: Daniel Rosenwasser <DanielRosenwasser@users.noreply.github.com>

* remove obsoleted fix from inferFromUsage

Co-authored-by: Daniel Rosenwasser <DanielRosenwasser@users.noreply.github.com>
2021-03-02 12:36:26 -08:00
ZenandGitHub 3d1c6e8f2f fix(42765): require should not work in ts files (#42792)
* add failing test

* fix(42765): require should not work in ts files
2021-03-02 06:54:31 -08:00
pushkineandGitHub 0b337f12b5 Update project.ts (#42900) 2021-03-02 06:37:22 -08:00