Commit graph

290 commits

Author SHA1 Message Date
Ron Buckton e8bf9584aa
Improve type checking and inference for Generators and Async Generators (#30790)
* Improve typing for Generators and Async Generators

* Add TReturn and TNext to Iterator, IterableIterator, etc.

* Update ts internal Iterator to be assignable from global Iterator

* Make 'done' optional in IteratorYieldResult

* Revert Iterable and IterableIterator to simpler versions plus other fixes

* Add additional inference tests

* Added additional tests

* PR cleanup and minor async iteration type fix

* Updated diagnostics message and added non-strict tests

* Fix expected arity of Iterator/AsyncIterator
2019-07-03 21:55:59 -07:00
Anders Hejlsberg 340f81035f
Merge pull request #32178 from microsoft/improveTupleDestructuring
Simplify tuple destructuring logic
2019-07-02 17:25:12 -07:00
Anders Hejlsberg 5ad3d1bf08 Add more tests 2019-06-30 08:18:01 -10:00
Andrew Branch 5ff3cda078
Add some negative test cases and accept baselines 2019-06-26 14:01:50 -07:00
Andrew Branch 17f6f77de5
Fix declaration emit for negative number property declarations 2019-06-26 11:49:45 -07:00
Anders Hejlsberg 9223f39f53 Add regression test 2019-06-21 18:07:15 -10:00
Wenlu Wang 454b4280b1 check more case for empty binding patten (#25263)
* check more case for empty binding patten

* refactor binding pattern checking  getWidenedType

* fix spelling

* fix merge and rebase
2019-04-26 14:00:04 -07:00
Klaus Meinhardt b45df892a8 emit error on destructuring of rest property (#29609)
Fixes: #26005
2019-04-25 13:33:49 -07:00
Andrew Branch 9a3149b967
Add failing tests for destructuring void 2019-04-01 13:33:41 -07:00
Wenlu Wang d2476759e2 add related error span for default exports (#25396)
* add related error span for default exports

* accept baseline

* stash

* accept baseline and fix lint

* update testcase

* Add missing semicolon
2019-03-12 13:15:14 -07:00
Anders Hejlsberg 2200d35385 Add tests 2019-01-18 09:34:38 -08:00
Anders Hejlsberg 307a9b66af Add tests 2018-12-16 07:23:28 -08:00
Klaus Meinhardt 8630396d8a update test 2018-08-01 09:59:50 +02:00
Nathan Shively-Sanders 5c2eeb20b1
Destructuring declaration prefers type annotation type (#25282)
* Destructuring declaration prefers type annotation type

Previously, getTypeForBindingElement would always union the declarations type and
the type of the default initializer. Now, if the declaration has a type
annotation, it does not union with the initializer type. The type
annotation's type is the one used.

* Small cleanup in parentDeclarationHasTypeAnnotation

* Refactoring based on PR comments

* Combine getCombined*Flags into a single helper function

Retain the individual functions since they are used a lot.

* Remove unneeded temp
2018-06-28 10:41:38 -07:00
Nathan Shively-Sanders 9025bc7c69
Fix control flow loop in yield expression (#25228)
* Fix control flow loop in yield expression

Yet again, the fix is to stop using checkExpressionCached.

* Update lib in test to reduce number of errors
2018-06-26 12:50:29 -07:00
Anders Hejlsberg c2310009e1 Update tests 2018-06-21 17:02:35 -10:00
王文璐 ad5a4c7097 add prependRange and move more variable declaration 2018-05-10 15:54:51 +08:00
Ron Buckton f67afa098f Unpatch vfs resolver and default lib rename 2018-05-03 14:18:50 -07:00
Daniel Rosenwasser 84b12910e8
Merge pull request #23430 from Microsoft/taggedTemplateTypeArguments
Allow type arguments in generic tagged templates
2018-04-19 15:50:19 -07:00
Daniel Rosenwasser 7f96fec9d9 Added test in case 'super' is ever possibly parsed as a tagged template string. 2018-04-19 15:16:25 -07:00
Daniel Rosenwasser 8e27f4693c Added test for ASI concerns. 2018-04-19 10:34:31 -07:00
Mohamed Hegazy 52192006cf
Merge pull request #20671 from Kingwl/fix-import-not-existed-module
error if import empty object form module not existed
2018-04-17 17:29:07 -07:00
Daniel Rosenwasser 6107e05e8c Added test for tagged templates in new expressions. 2018-04-15 15:57:38 -07:00
Daniel Rosenwasser 60b6d3fbce Fixed up test. Thanks arrow functions... 2018-04-13 23:45:15 -07:00
Daniel Rosenwasser b409888cbc Added tests. 2018-04-13 23:01:24 -07:00
Andy e48bcd60ba
Treat 'yield;' as 'yield undefined;' (#22297)
* Treat 'yield;' as 'yield undefined;'

* Use undefinedWideningType
2018-03-08 15:41:04 -08:00
Wenlu Wang b15157356a add spelling suggestion support for module import (#22283) 2018-03-02 10:24:55 -08:00
kingwl eba4d36739 error if import empty object form module not existed 2018-02-24 18:43:02 +08:00
Ron Buckton 004f18ff0c
Merge pull request #21219 from Microsoft/fix19020
Fix destructuring assignment when assignment target is RHS
2018-01-17 11:22:30 -08:00
Ron Buckton 4aca0c8121 Fix destructuring assignment when assignment target is RHS 2018-01-16 16:58:56 -08:00
Ron Buckton 6c9827725c Fix symbol-named properties incorrectly requiring alignment with string indexer type 2018-01-16 15:45:10 -08:00
wenlu.wang 78250ec58f fix noImplicitReturns check when strictNullChecks is false (#20326) 2017-11-29 15:27:32 -08:00
kingwl 30c51ed324 fix super call from class that has no basetype but with same symbol interface (#19068) 2017-10-16 10:42:22 +08:00
Yui 39e0cc61a7 Fix 16628: "undefined" exception when name of binding element in binding pattern is empty (#17132)
* Handle the case where binding pattern name element is empty

* Update tests and baselines

* Feedback from PR

* Handle empty binding patterns more generally in emitter

* Dont simply handling fo empty binding patterns and stay spec compliant

* PR feedback
2017-08-09 13:47:44 -07:00
Nathan Shively-Sanders 1fb6d349f1 Test:use type param constraints for computed prop types 2017-07-25 09:39:54 -07:00
gcnew 9c2a74c26c Update tests 2017-04-23 19:14:21 +03:00
Ron Buckton 96927379f0 Emit generated name for unnamed default exported class with decorated members 2017-04-19 14:53:32 -07:00
Nathan Shively-Sanders 0292f5867c Merge branch 'allow-export-specifier-reference' of https://github.com/Kovensky/TypeScript into Kovensky-allow-export-specifier-reference 2017-04-17 13:59:58 -07:00
Kanchalai Tanglertsampan 7a66161790 Address code review of PR 14692 2017-03-29 13:57:51 -07:00
Yui 0cb490e2c2 Merge pull request #14692 from Microsoft/master-fixResolveEntityName
[Master] Fix resolve entity name to not dive inside property access expression when the expression is not entity name
2017-03-29 09:55:36 -07:00
Yui 46587c8dca Merge pull request #14235 from Microsoft/master-fix14043
[Master] fix 14043 collect return type from return statement in generator function
2017-03-21 11:06:11 -07:00
Diogo Franco (Kovensky) 61ebcb49c7 Allow exporting a binding before its declaration 2017-03-17 10:25:37 +09:00
Kanchalai Tanglertsampan 1c90ef5aad wip-fix resolveEntityName with parenthesizedExpression 2017-03-15 19:16:37 -07:00
Kanchalai Tanglertsampan 1415cf4ea2 Update tests and baselines to declare class declaration before use 2017-02-24 17:48:06 -08:00
Kanchalai Tanglertsampan 43cb2f5646 Add tests 2017-02-22 10:24:00 -08:00
Ron Buckton 5d415cac52 Merge branch 'master' into asyncGenerators 2017-02-02 12:11:44 -08:00
Ron Buckton 20249e5c4a More exhaustive needsDotDotForPropertyAccess 2017-01-24 13:42:05 -08:00
Ron Buckton 30aff2f6d3 Rename and simplify 'iterationMode' option 2016-12-30 14:39:51 -08:00
Ron Buckton 0d7c9dc4e0 Merge branch 'master' into asyncGenerators 2016-12-30 13:05:01 -08:00
rbuckton 4098058907 Merge branch 'master' into es6-new-target 2016-12-28 13:41:44 -08:00