Commit graph

29233 commits

Author SHA1 Message Date
Klaus Meinhardt
94f85901d7 strip QuestionToken from MethodDeclaration and PropertyDeclaration emit (#34954)
* strip QuestionToken from MethodDeclartion emit

Fixes: #34953

* test property emit
2019-11-12 10:30:46 -08:00
Andrew Casey
5c951635e5
Fix chalk import (#35040) 2019-11-11 11:24:20 -08:00
Anders Hejlsberg
3a5230ab3d
Defer switch exhaustiveness checks (#35000)
* Defer switch exhaustiveness checks until they're actually needed

* Add regression test

* Accept new baselines
2019-11-09 07:52:39 -08:00
Wesley Wigham
165b4bc100
More version sanitization 2019-11-07 17:14:16 -08:00
Andrew Branch
53d2b7ed60
Don’t assume importing some JSON means you want everything imported with .js extensions (#34961) 2019-11-07 14:55:54 -08:00
Andrew Branch
4cbace7110
Add "auto" to importModuleSpecifierPreference (#34981)
* Add "auto" to importModuleSpecifierPreference

* Update APIs
2019-11-07 14:55:13 -08:00
Wesley Wigham
db43be130d
Fix missing semicolon 2019-11-07 14:53:12 -08:00
Wesley Wigham
07d80edb3f
Strip more timestamps and versions from docker logs to better handle the more verbose logging from office-ui-fabric 2019-11-07 14:11:33 -08:00
Andrew Branch
f2146a627c
Fix isInJsxText after JSXOpeningElement with type arguments (#34958)
* Fix `isInJsxText` after JSXOpeningElement with type arguments

* Do the same thing a different way
2019-11-06 15:02:45 -08:00
Orta
b9fe84e591
Fix up some of the ignore files, and removing the create language service script (#33684)
* Fix up some of the ignore files, and removing the create script

* Update .dockerignore
2019-11-06 11:11:29 -05:00
Anders Hejlsberg
1c42c1aaa8
Fix control flow analysis in try-catch-finally (#34880)
* Revise creation of control flow graph for try-catch-finally statements

* Add tests

* Accept new baselines
2019-11-05 12:06:25 -08:00
Anders Hejlsberg
95be956320
Fix switch statement exhaustiveness checking (#34840)
* Don't optimize away CFA nodes representing missing default clauses

* Add regression test

* Accept new baselines
2019-11-05 12:05:41 -08:00
Anders Hejlsberg
966d9864d0
Properly instantiate object types created from rest parameters (#34826)
* Anonymous types of rest variable declarations need instantiation

* Add regression test

* Accept new baselines

* Accept new API baselines
2019-11-05 12:04:45 -08:00
Alexander T
56cad36678 (34894): Wrong information in error message for overridden acc… (#34901) 2019-11-05 00:07:03 -05:00
Ozair Patel
be960fa356 Add related diagnostic to "used before defined" if type is a function that returns a union with undefined (#33171)
* Add "use before defined" diagnostic

* Make "use before defined" diagnostic as related information to TS2454

* Add baseline tests for "use before defined"

* Add test for type alias union with undefined for "use before defined" diagnostic

* Update baselines
2019-11-04 17:53:31 -05:00
Sheetal Nandi
47ec514cf4
Use empty object for invalid package json contents instead of undefined (#34906)
* Use empty object for invalid package json contents instead of undefined
Fixes #34726

* Behave as if package json doesnt exist in case of invalid json in package json
2019-11-04 14:31:45 -08:00
Luka Hartwig
9a3ec5f229 Improve error message when compiling a .js file (#34861)
* Improve error message when compiling a .js file

* Add dedicated error message for .json and .js files

* Update missing baseline tests

* Remove error hint for .json files
2019-11-04 14:59:06 -05:00
Ron Buckton
ba5e86f140
Propagate 'undefined' instead of the optional type marker at an optional chain boundary (#34588)
* Propagate 'undefined' instead of the optional type marker at an optional chain boundary

* Update src/compiler/types.ts

Co-Authored-By: Nathan Shively-Sanders <293473+sandersn@users.noreply.github.com>
2019-11-01 11:36:22 -07:00
Orta
ec367feb58
Remove the ping for playgrounds on TS deploys (#34862) 2019-10-31 18:50:00 -07:00
TypeScript Bot
e228294463 Update user baselines (#34851) 2019-10-31 14:23:55 -07:00
TypeScript Bot
239937df7a Update user baselines (#34845) 2019-10-31 11:00:03 -07:00
Anders Hejlsberg
9ff378aab3
Exclude types originating in literals from recursion depth limiter check (#34742)
* Exclude types originating in literals from recursion depth limiter check

* Add tests

* Accept new baselines

* Remove superfluous test
2019-10-31 06:14:43 -07:00
Wenlu Wang
234680851b add template literal spans (#34699) 2019-10-30 23:54:00 -07:00
TypeScript Bot
9cc0fcd3da Update user baselines (#34838) 2019-10-30 16:58:59 -07:00
TypeScript Bot
0c2e964506 Update user baselines (#34820) 2019-10-30 14:05:20 -07:00
Wesley Wigham
7b02c635b6
Report generic rest parameters as unreliable variance positions (#33020)
* Report generic rest parameters as unreliable variance positions

* Add example from discussion on #30301
2019-10-30 13:54:39 -07:00
Wesley Wigham
5e0fbc677a
Add circularity checking during deferred type argument creation (#34791) 2019-10-30 13:36:43 -07:00
Wesley Wigham
8b7664ae15
Generate more correct property name nodes in declaration emit (#34741)
* Generate more correct property name nodes in declaration emit

* Silly only-on-CI lint rule T.T
2019-10-30 12:40:59 -07:00
Wesley Wigham
d28672d97f
Fix alias naming and structure bugs in js declarations (#34786)
* Fix alias naming and structure bugs in js declarations

* Add another test case and change condition for ns merge to require signature or export content

* Fix typo in comment
2019-10-30 12:40:06 -07:00
Ron Buckton
87cc8c4af8
Evaluate RHS of binding/assignment pattern first (#34806) 2019-10-29 17:42:30 -07:00
Nathan Shively-Sanders
00dd1f0609
Add isIntersectionConstituent to relation key (#34789)
* Add isIntersectionConstituent to relation key

isIntersectionConstituent controls whether relation checking performs
excess property and common property checks. It is possible to fail a
relation check with excess property checks turned on, cache the result,
and then skip a relation check with excess property checks that would
have succeeded. #33133 provides an example of such a program.

Fixes #33133 the right way, so I reverted the fix at #33213
Fixes #34762 (by reverting #33213)
Fixes #33944 -- I added the test from #34646

* Update comments in test
2019-10-29 15:08:59 -07:00
Nathan Shively-Sanders
7635884224
JSDoc type reference understands require with entity name (#34804)
* resolve require with entity name postfix

For example, `require("x").c`. This is the value equivalent of
`import("x").a.b.c`, but the syntax tree is not as nicely designed for
this purpose.

Fixes #34802

* Add bug number to test

* Add optional chain test
2019-10-29 14:56:33 -07:00
TypeScript Bot
f7cb2f2b86 Update user baselines (#34759) 2019-10-29 14:26:50 -07:00
Sheetal Nandi
dbef230eb8
This handles when packages are symbol links in mono repo like scenarios to use source files instead of output d.ts from project reference (#34743)
* Fix incorrect outDir usage instead of out

* Handle symlinks of packages in mono repo like packages
Fixes #34723

* Added clarified comment
2019-10-29 10:49:14 -07:00
Ron Buckton
554bd24734
Fix checker handling for empty type argument lists (#34790) 2019-10-29 08:56:11 -07:00
Martin Probst
ff590b622e Fix a crash when transforming functions in modules. (#34513)
When transforming a module declaration and block, parse tree nodes
contained in the module block have their parent pointers reset due to
`shouldEmitModuleDeclaration` calling into `isInstantiatedModule`, which
needs to set parent pointers to operate.

That causes a crash when later transforming any nodes within the module,
as retrieving their source file in `getSourceFileOfNode` (via
`getOrCreateEmitNode`) fails, due to their new synthesized parent nodes
not being in a source file.

This change avoids the issue by using the parse tree node in `ts.ts` to
decide whether a module declaration should be emitted (i.e. whether the
module contains values).

This means transformers cannot add values to modules that previously did
not contain any.

Fixes #34644.
2019-10-29 08:40:49 -07:00
Sheetal Nandi
cbbbcfa4c5
Fix incorrectly looking for position in call/new expression arguments when looking for indentation of type arguments (#34779)
* Fix incorrectly looking for position in call/new expression arguments when looking for indentation of type arguments
Fixes #32487

* Update src/services/formatting/smartIndenter.ts

Co-Authored-By: Nathan Shively-Sanders <293473+sandersn@users.noreply.github.com>
2019-10-28 14:02:09 -07:00
Ryan Cavanaugh
05cbe5ac8e
Update issue reports agian (#34768)
* Update issue templates

* Add config.yml

* Updates

* Updates
2019-10-28 11:15:31 -07:00
Ryan Cavanaugh
a28fcebff2
Update issue templates (#34767)
* Update issue templates

* Add config.yml
2019-10-28 11:12:20 -07:00
Orta
72b7a6527e Adds accept header to the dispatch request when requesting a playground build of monaco (#34763) 2019-10-28 11:07:36 -07:00
Andrew Branch
634e0ad52b
Fix extract type on JS function params (#34745) 2019-10-28 10:30:59 -07:00
Nathan Shively-Sanders
080e41dc90
Fix type reference to merged prototype property assignment (#34764)
The constructor function code path in the return type checking of
signatures needs to pass the *merged* symbol of the declaration to
getDeclaredTypeOfClassOrInterface. Other callers of
getDeclaredTypeOfClassOrInterface do this, or used an already-merged
symbol.

Fixes #33993
2019-10-28 10:14:04 -07:00
Eli Barzilay
eb0208c589
make globalThis have an empty declarations (#34561)
Fixes #33860 by making it an error.  This is an improvement, but sounds
like it would be better to make it work later.
2019-10-25 22:49:31 -04:00
Andrew Branch
d8840f8a18
Show all matching enum flags in debug flag formatter (#34689)
* Show all matching enum flags in debug formatter

* Revert "Show all matching enum flags in debug formatter"

This reverts commit 073099722a.

* Same thing but simpler

* Lint
2019-10-25 16:27:24 -07:00
Evan Cahill
88f3593742 Fix error when exporting const enums (#33060) (#34721)
* Allow export declaration to reference const enums

* Update baselines

* Add test to verify reexported const enums are elided
2019-10-25 16:04:44 -07:00
Sheetal Nandi
f12eee2e4b
Include *.json in the root files if they are specified as root (#34676)
Fixes #33827
2019-10-25 13:48:38 -07:00
Sangmin Lee
a01c8ef764 Fix typo in watchMode.ts (#34701) 2019-10-25 13:13:00 -07:00
Gorka Hernández Estomba
8e1d228a44 Update inconsistent use of the word multiline/multi-line in test cases (#34733)
The word multi-line and multiline are used interchangeably within the file. Multiline seems to be the most used spelling of the word across the TypeScript repository codebase so a few strings have been updated to keep consistency within a single file. Additionally, corrected a minor capitalization mistake.
2019-10-25 11:28:50 -07:00
Ryan Cavanaugh
5e4cd0594e
Update CONTRIBUTING.md 2019-10-24 16:49:51 -07:00
Anders Hejlsberg
c404c08fde
Fix reachability analysis for ?? operator (#34702)
* Exclude ?? operator from true/false literal check in createFlowCondition

* Accept new API baselines

* Add tests

* Accept new baselines

* Address CR feedback

* Accept new API baselines
2019-10-24 15:57:14 -07:00