2118 Commits

Author SHA1 Message Date
Andy
f945b26b54 Forbid type assertions in '.js' files (#17503) 2017-07-29 05:41:08 -07:00
Andy
2efaa7c9e2 Forbid non-null assertion in '.js' files (#17481) 2017-07-28 16:40:20 -07:00
Anders Hejlsberg
06cfe51a45 Merge pull request #17430 from Microsoft/inferenceExcessProperties
Fix inference with excess properties
2017-07-27 17:35:37 -07:00
Anders Hejlsberg
e7e6475440 Merge pull request #17382 from Microsoft/fixPartialTypeRelations
Fix partial type relations
2017-07-27 17:31:55 -07:00
Daniel Rosenwasser
935b895ac1 Added/augmented tests. 2017-07-27 14:55:29 -07:00
Daniel Rosenwasser
c14ff00bcf Added test case. 2017-07-27 11:22:12 -07:00
Andy
cc8399dc41 Escape string literal before looking it up in enum's symbol table (#17441) 2017-07-26 16:00:34 -07:00
Wesley Wigham
b080aa9440 Fix #16778 - use previous type and not declared type (#17381)
* Fix #16778 - use previous type to check discriminable type and not declared type

* Rename prevType -> computedType
2017-07-26 15:27:02 -07:00
Wesley Wigham
5b77ef8b4d Fix infinite loop in jsdoc parsing (#17420)
* Test case

* Move parameter fix to apply to jsdoc (and all lists)

* Inline function, generalize comment
2017-07-26 10:12:59 -07:00
Anders Hejlsberg
a14144be9c Add regression test 2017-07-26 07:16:26 -07:00
Andy
a59db13004 Fix typo: Infered -> inferred (#17417) 2017-07-26 07:16:26 -07:00
Anders Hejlsberg
1d9c3e1c22 Add repro 2017-07-24 17:07:24 -07:00
Wesley Wigham
7040df2094
Tests covering the bug 2017-07-21 17:30:01 -07:00
Wesley Wigham
7cb8ce4346 Fix exceptions on empty tuple errors (#17311)
* Fix exceptions on empty tuple errors

* Remove bonus semicolon

* Invert condition
2017-07-20 10:09:55 -07:00
Andy
cfa94c2d34 Binder: handle JS property assignment that comes after a method declaration with the same name (#16830) 2017-07-19 09:11:50 -07:00
Wesley Wigham
695514290f Fix #17023 (#17180)
* Fix #17023

* Be more general when handling matching references through binding elements

* Better cache key, PR feedback

* Deeper tests, better cache key handling
2017-07-18 09:12:25 -07:00
Nathan Shively-Sanders
50f39102aa Merge pull request #17096 from Microsoft/improve-return-type-parse-error
Improve return type parse error
2017-07-12 07:18:23 -07:00
Nathan Shively-Sanders
3638ff19b3 Test:better error for wrong return token (: vs =>) 2017-07-11 10:16:35 -07:00
Andy
f45ccf541d In getDeclarationSpaces, treat a type alias as a SymbolFlags.Type, not a SymbolFlags.Value (#16624) 2017-07-11 09:54:42 -07:00
Andy
12163cc02e Allow to narrow the type of an import (#16658)
* Allow to narrow the type of an import

* Assume alias is initialized
2017-07-10 09:18:35 -07:00
Wesley Wigham
4e6b2f3c93 Created a branded type for identifier-escaped strings (#16915)
* Created a branded type for escaped strings

Then flowed it throughout the compiler, finding and fixing a handful of
bugs relating to underscore-prefixed identifiers in the process.
Includes a test for two cases noticed - diagnostics from conflicting
symbols from export *'s, and enum with underscore prefixed member emit.

* Correctly double underscores WRT mapped types

* Add fourslash tests for other fixed issues

* use function call over cast

* Update forEachEntry type accuracy

* Just use escaped names for ActiveLabel

* Remove casts from getPropertyNameForPropertyNameNode

* This pattern has occurred a few times, could use a helper function.

* Remove duplicated helper

* Remove unneeded check, use helper

* Identifiers list is no longer escaped strings

* Extract repeated string-getting code into helper

* Rename type and associated functions

* Make getName() return UnderscoreEscapedString, add getUnescapedName()

* Add list of internal symbol names to escaped string type to cut back on casting

* Remove outdated comments

* Reassign interned values to nodes, just in case

* Swap to string enum

* Add deprecated aliases to escapeIdentifier and unescapeIdentifier

* Add temp var

* Remove unsafe casts

* Rename escaped string type as per @sandersn's suggestion, fix string enum usages

* Reorganize double underscore tests

* Remove jfreeman from TODO

* Remove unneeded parenthesis
2017-07-06 14:45:50 -07:00
Daniel Rosenwasser
22f38b720c Merge pull request #16704 from charlespierce/namespace_export_default
Diagnostics for default class / function export in namespace
2017-06-28 17:10:45 -07:00
Nathan Shively-Sanders
c51c2aecca Merge pull request #16736 from DickvdBrink/issue/15208
Also check TypeAlias for unused type parameters
2017-06-28 12:37:04 -07:00
Nathan Shively-Sanders
2f5ecf00a1 Merge pull request #16698 from Microsoft/master-16017
[Master]  Fix 16017 - ordering of promise all method
2017-06-28 10:46:53 -07:00
Charles Pierce
386454a255 #16300 #16301 Diagnostics for default export in namespace 2017-06-22 20:20:41 -07:00
Nathan Shively-Sanders
6a111928b4 Merge pull request #16375 from Microsoft/skip-block-scope-for-global-symbol
Skip block scope check for global symbol
2017-06-22 15:29:35 -07:00
Kanchalai Tanglertsampan
77d69c8c1d Add tests and update baselines 2017-06-22 11:56:49 -07:00
Dick van den Brink
33224747b3 Added test for unused typeparameters in a typealias declaration 2017-06-22 16:45:09 +02:00
Andy
537695c313 In TypeScript code, never bind JSDoc normally, just set parent pointers (#16555) 2017-06-15 10:02:16 -07:00
Daniel Rosenwasser
5b12a04965 Merge pull request #16213 from charlespierce/await_yield_literals
Update special cases for await / yield expression parsing
2017-06-15 00:39:57 -07:00
Ron Buckton
fbe002a595 Merge pull request #16502 from Microsoft/fix16211
Fix 'extends' with type parameter default returned from superclass construct signature
2017-06-13 19:30:27 -07:00
Nathan Shively-Sanders
57f8648b0f Merge pull request #16505 from Microsoft/decl-emit-parenthesize-keyof
Add parentheses around keyof in declaration emit when needed
2017-06-13 14:17:49 -07:00
Nathan Shively-Sanders
2d2ac6794f Test:correct parens around keyof in decl emit 2017-06-13 14:00:26 -07:00
Ron Buckton
696643998a Fix constructor instantiation with defaults 2017-06-13 13:19:54 -07:00
Nathan Shively-Sanders
5780494ddb Test:declaration emit of optional parameter props 2017-06-13 11:50:46 -07:00
Nathan Shively-Sanders
ecc211345a Merge pull request #16465 from Microsoft/skip-non-null-assertion-for-reference-expr
Skip non-null assertion for references
2017-06-12 15:33:36 -07:00
Nathan Shively-Sanders
497d627a02 Test: Allow ++ after non-null assertion 2017-06-12 14:41:10 -07:00
Andy
fbcddb61e2 Don't bind JSDoc namespace in a TS file (#16416) 2017-06-12 14:35:35 -07:00
Anders Hejlsberg
4e9e62d861 Add test 2017-06-12 13:17:24 -07:00
Andy
13b7d17da7 Don't bind JSDoc type parameter in a TS file (#16413)
* Don't bind JSDoc type parameter in a TS file

* Fix tests

* Remove unnecessary non-null assertions
2017-06-09 14:52:01 -07:00
Andy
a2d524252c --isolatedModules: Still allow re-export of type in a declaration file (#16399)
* --isolatedModules: Still allow re-export of type in a declaration file

* Use isInAmbientContext
2017-06-09 09:39:55 -07:00
Nathan Shively-Sanders
cae1286b72 Merge pull request #16343 from Microsoft/weak-types-for-primitives
Weak type errors for primitives
2017-06-09 09:03:48 -07:00
Nathan Shively-Sanders
ffc899ed38 Merge pull request #16377 from Microsoft/fix-synthetic-properties-in-hasExcessProperties
Fix synthetic properties in hasExcessProperties
2017-06-08 15:49:51 -07:00
Nathan Shively-Sanders
d3f2234529 Test synthetic properties w/hasExcessProperties 2017-06-08 14:19:06 -07:00
Ron Buckton
ef86f7da50 Adjust source map offsets for variables in downlevel async funcs and generators 2017-06-08 14:15:40 -07:00
Nathan Shively-Sanders
91f4f3910d Test:Block-scoped definition of Promise works
Previously, a block-scoped definition of Promise like `class Promise<T>` in
a script would cause a crash
2017-06-08 13:46:48 -07:00
Nathan Shively-Sanders
2eea0989ea Merge branch 'master' into delay-signature-return-type-instantiation 2017-06-08 09:42:50 -07:00
Nathan Shively-Sanders
b509e681c1 Test weak type errors with primitives 2017-06-07 16:20:58 -07:00
Nathan Shively-Sanders
40dd8ba18f Merge pull request #16330 from Microsoft/fix-js-infer-rest-args
Fix JS-inferred rest parameters
2017-06-07 14:44:02 -07:00
Nathan Shively-Sanders
c0b8c217b1 Test returning an infinite type in an intersection 2017-06-07 13:27:31 -07:00