15088 Commits

Author SHA1 Message Date
Mohamed Hegazy
d537b79c61 Merge release-2.1 into master (#12157)
* Update LKG

* Update version

* Update LKG

* Skip overloads with too-short function parameters

If the parameter of an overload is a function and the argument is also a
function, skip the overload if the parameter has fewer arguments than
the argument does. That overload cannot possibly apply, and should not
participate in, for example, contextual typing.

Example:

```ts
interface I {
  (a: number): void;
  (b: string, c): void;
}
declare function f(i: I): void;
f((x, y) => {});
```

This code now skips the first overload instead of considering.

This was a longstanding bug but was only uncovered now that more
functions expressions are context sensitive.

* Test skip overloads w/too-short function params

1. Update changed baseline.
2. Add a new test with baseline.

* Minor style improvements

* Ignore optionality when skipping overloads

* Do not use contextual signatures with too few parameters

* isAritySmaller runs later: getNonGenericSignature

* rewrite void-returning statements in constructors that capture result of super call (#11868)

* rewrite void-returning statements in constructors that capture result of super call

* linter

* Update LKG

* Fix emit inferred type which is a generic type-alias both fully and partially fill type parameters

* Add tests and baselines

* Skip trying to use alias if there is target type

* Update baselines

* Add diagnostics to remind adding tsconfig file for certain external project (#11932)

* Add diagnostics for certain external project

* Show tsconfig suggestion

* fix lint error

* Address pr

* fix comment

* Update error message

* Flag for not overwrite js files by default without generating errors (#11980)

* WIP

* Properly naming things

* refactor

* apply the option to all files and check out options

* Fix typo

* Update LKG

* lockLinter

* use local registry to check if typings package exist (#12014) (#12032)

use local registry to check if typings package exist

* Add test for https://github.com/Microsoft/TypeScript/pull/11980 (#12027)

* add test for the fix for overwrite emitting error

* cr feedback

* enable sending telemetry events to tsserver client (#12034) (#12051)

enable sending telemetry events

* Update LKG

* Reuse subtree transform flags for incrementally parsed nodes (#12088)

* Update LKG

* Update version

* Update LKG

* Do not emit "use strict" when targeting es6 or higher or module kind is es2015 and the file is external module

* Add tests and baselines

* [Release 2.1] fix11754 global augmentation (#12133)

* Exclude global augmentation from module resolution logic

* Address PR: check using string literal instead of NodeFlags.globalAugmentation

* Remove comment
2016-11-10 14:28:34 -08:00
Zhengbo Li
4dc58dde38 Exclude js files in non-configured projects compile-on-save emitting (#12118)
* Exclude js files in non-configured projects CoS emitting

* remove unnecessary method
2016-11-10 14:12:24 -08:00
Nathan Shively-Sanders
6e1aac1c42 Merge pull request #12147 from mylesmegyesi/12050-IncompatableAssignementOfIdenticallyNamedTypes
Adds error message for incompatible assignment of identically named type
2016-11-10 13:17:31 -08:00
Cotton Hou
9a8e1bf8a6 Add ES2017 string padding (#12152)
* add es2017.string.d.ts for String.prototype.{padStart,padEnd}

* append es2017.string.d.ts into es2017.d.ts

* add es2017.string into commandLineParser

* append es2017.string into error message for unit tests of commandLineParser

* append es2017.string into Gulpfile

* append es2017.string into Jakefile
2016-11-10 12:43:51 -08:00
Nathan Shively-Sanders
205ce3247f Merge pull request #12154 from Microsoft/import-helpers-reports-errors-for-__rest
Import helpers reports errors for __rest
2016-11-10 12:29:39 -08:00
Vladimir Matveev
3ecb60146b synthesize complete import declaration for tslib (#12151) 2016-11-10 11:57:37 -08:00
Nathan Shively-Sanders
ba6e5a0ffa Test error for import helpers with no __rest 2016-11-10 11:47:03 -08:00
Nathan Shively-Sanders
d6bf27d6b6 Correctly check spread assignments in strict mode
Previously it crashed in the binder.
2016-11-10 11:46:10 -08:00
Nathan Shively-Sanders
0d4ac01574 Report errors for import helpers missing __rest 2016-11-10 11:45:56 -08:00
Sheetal Nandi
c87bce1119 Merge pull request #11978 from Microsoft/errorReportingInJsFile
Report all the js file errors and skip only the nodes that are not allowed in JS file
2016-11-10 10:37:16 -08:00
Sheetal Nandi
c458576553 Merge pull request #12135 from Microsoft/jsxFactory
Support for --jsxFactory option
2016-11-10 09:49:57 -08:00
Sheetal Nandi
2eba10a25b Updated condition for more readability 2016-11-10 09:40:50 -08:00
Myles Megyesi
c05e226c4b
Adds error message for incompatible assignment of identically named type
Fixes issue #12050
2016-11-10 11:32:03 -06:00
Nathan Shively-Sanders
be5e5fb872 Merge pull request #11150 from Microsoft/object-spread
Object spread/rest
2016-11-10 09:28:58 -08:00
Nathan Shively-Sanders
6398e0d6dd Merge pull request #11633 from Microsoft/fix-comparable-in-switch
Fix comparable in switch
2016-11-10 09:20:46 -08:00
Nathan Shively-Sanders
25462c9571 Merge pull request #12028 from Microsoft/object-rest
Object rest
2016-11-10 09:18:13 -08:00
Sheetal Nandi
dd7f00f20b Parse the jsxFactory again in the checker instead of using cached value in the program 2016-11-10 08:54:13 -08:00
Sheetal Nandi
a88c2ae1e4 Add test cases for when jsxFactory cannot be resolved 2016-11-09 16:56:43 -08:00
Sheetal Nandi
c6b1bbe12d Enabled test case for source map 2016-11-09 16:51:10 -08:00
Sheetal Nandi
35e4c459f5 Transpile unit test case 2016-11-09 16:50:40 -08:00
Sheetal Nandi
3d6950d023 When emitting use jsx factory entity expression if provided 2016-11-09 16:40:11 -08:00
Sheetal Nandi
06affa6672 Resolve first identifier of the jsxFactory as part of type check 2016-11-09 15:35:54 -08:00
Sheetal Nandi
f7bac98948 Verify that jsxFactory is either identifier or qualified name 2016-11-09 14:32:42 -08:00
Nathan Shively-Sanders
9b1f43bdda Add strictNullChecks test for object spread 2016-11-09 13:40:21 -08:00
Nathan Shively-Sanders
fcf32c444f Treat | undefined like optionality in spread type 2016-11-09 13:39:42 -08:00
Sheetal Nandi
4b8a55793a Add support for taking in jsxFactory option and report errors for invalid combinations 2016-11-09 12:23:59 -08:00
Sheetal Nandi
78bb276216 Merge branch 'master' into errorReportingInJsFile 2016-11-09 11:38:11 -08:00
Nathan Shively-Sanders
01969475cf Improve nested destructuring test for ESNext emit
Now with object destructuring inside array destructuring inside object
destructuring! Each with their own array/object rest!

Also updates baselines.
2016-11-09 10:51:56 -08:00
Nathan Shively-Sanders
214ce38a6a Downlevel array destructuring to ES6 in object rest
Previously array destructuring inside an object destructuring with an
object rest would downlevel the array destructuring to ES5. This breaks
if the code that targets ES2015 is using iterators instead of arrays
since iterators don't support [0] or .slice that the ES5 emit uses.
2016-11-09 10:47:54 -08:00
Sheetal Nandi
6456325973 Handle abstract and const modifiers 2016-11-09 10:39:46 -08:00
Vladimir Matveev
28cc938503 (signature help) type parameter lists are never variadic (#12112) 2016-11-08 16:10:34 -08:00
Vladimir Matveev
9a9f45f0fb use createHash from ServerHost instead of explicit require (#12043)
* use createHash from ServerHost instead of explicit require

* added missing method in ServerHost stub
2016-11-08 15:32:53 -08:00
Anders Hejlsberg
2282477012 Merge pull request #12068 from Microsoft/fixTypeAliasDisplay
Fix type alias display
2016-11-08 06:43:38 -08:00
Anders Hejlsberg
be0358cc0c Include declaration file emit 2016-11-08 06:09:41 -08:00
Mohamed Hegazy
84f8f8bba8 Update authors for release-2.1 2016-11-07 21:58:53 -08:00
Vladimir Matveev
9e3d6efb19 reduce set of files being watched, increase polling interval (#12054) (#12092) 2016-11-07 21:13:11 -08:00
Mohamed Hegazy
2bf38ab6cd Port fix for https://github.com/Microsoft/TypeScript/issues/12069 (#12095) 2016-11-07 21:09:17 -08:00
Anders Hejlsberg
8f568d4740 Merge pull request #12064 from Microsoft/cacheSignatureInstantiations
Cache generic signature instantiations
2016-11-07 17:16:05 -08:00
Ron Buckton
ddc4ae7eac Reuse subtree transform flags for incrementally parsed nodes (#12088) 2016-11-07 16:03:04 -08:00
Vladimir Matveev
be2e8e85d6 property handle missing config files in external projects (#12094) 2016-11-07 15:49:19 -08:00
Vladimir Matveev
0173a3fa79 return empty file watcher in case if target directory does not exist (#12091)
* return empty file watcher in case if target directory does not exist

* linter
2016-11-07 15:48:46 -08:00
Nathan Shively-Sanders
e1c50e1c40 Address more PR comments 2016-11-07 13:57:26 -08:00
Vladimir Matveev
4ffdea838a Ports #12051 and #12032 into master (#12090)
* use local registry to check if typings package exist (#12014)

use local registry to check if typings package exist

* enable sending telemetry events to tsserver client (#12035)

enable sending telemetry events
2016-11-07 13:36:08 -08:00
Nathan Shively-Sanders
bd5ce284c9 Set spread type symbols in checkObjectLiteral
Instead of getSpreadType.

Also clean up special-case handling inside getSpreadType to be more
readable.
2016-11-07 13:35:36 -08:00
Andy
d16aa3075c Merge pull request #12089 from Microsoft/lshost_realpath
Add `realpath` implementation for lshost
2016-11-07 13:19:50 -08:00
Nathan Shively-Sanders
567f5636e3 Create spread property types eagerly
This avoids the need for a synthetic symbol and later code called from
getTypeOfSymbol.
2016-11-07 13:02:05 -08:00
Andy Hanson
d5c67312f6 Add realpath implementation for lshost 2016-11-07 12:42:12 -08:00
Nathan Shively-Sanders
9977936190 Do not emit __rest for --target esnext 2016-11-07 11:34:37 -08:00
Nathan Shively-Sanders
1866d0580c Rename variable in checkSwitchStatement per PR 2016-11-07 11:16:54 -08:00
Nathan Shively-Sanders
609cd0016b Merge branch 'object-spread' into object-rest 2016-11-07 11:10:29 -08:00