15157 Commits

Author SHA1 Message Date
Nathan Shively-Sanders
b9fa06f90b Address PR commennts
Update baselines with smaller emit as part of that.
2016-11-15 09:10:55 -08:00
Nathan Shively-Sanders
7c72f3db02 Update baselines 2016-11-14 16:24:02 -08:00
Nathan Shively-Sanders
fe66d9ef9f Add spread tests and update rest tests 2016-11-14 16:23:40 -08:00
Nathan Shively-Sanders
6f274eaabe Spread+rest fixes
1. Rename finds identifiers in spread assignment expressions.
2. Spreads with computed properties of type number or any no longer
crash the compiler.
3. Rest emit uses indexOf === -1 instead of !indexOf to filter properties.
4. Rest emit correctly refers to computed properties' generated temps.
2016-11-14 16:20:43 -08:00
Anders Hejlsberg
f437c8f318 Merge pull request #12114 from Microsoft/mappedTypes
Mapped types
2016-11-13 15:39:32 -08:00
(´・ω・`)
4166eeb284 fix #12137, correct ProxyHandler signatures (#12172)
* fix #12137, correct ProxyHandler signatures

* address PR review
2016-11-13 15:27:07 -08:00
Anders Hejlsberg
cd05c079ce Add comment explaining type alias instantiation strategy 2016-11-13 15:25:16 -08:00
Anders Hejlsberg
db813d5171 Merge pull request #12210 from Microsoft/typePredicateCheck
Fix type predicate check circularity
2016-11-13 14:48:48 -08:00
Vladimir Matveev
56f97e16e3 remove tsd dependency (#12206) 2016-11-13 13:52:25 -08:00
Vladimir Matveev
b15d144955 switch to tslint@next (#12201) 2016-11-13 13:34:18 -08:00
Anders Hejlsberg
85702197b4 Add regression test 2016-11-13 08:35:40 -08:00
Anders Hejlsberg
24567445d6 Add early bail out for call expressions that are never type predicates 2016-11-13 08:29:21 -08:00
Anders Hejlsberg
6ceab7bce7 Accept new baselines 2016-11-12 09:20:30 -08:00
Anders Hejlsberg
9ac7667d5c Address CR feedback 2016-11-12 08:55:23 -08:00
Andy
0e879c0bbf Merge pull request #12103 from Microsoft/path_mapping_exact_extension
Allow a path mapping to provide a file extension
2016-11-11 14:22:05 -08:00
Andy Hanson
43a4b22eba Update baseline 2016-11-11 14:13:09 -08:00
Andy Hanson
1e92a9803b Merge branch 'master' into path_mapping_exact_extension 2016-11-11 14:11:40 -08:00
Andy Hanson
a0e4ab94f1 Allow JS files 2016-11-11 13:59:13 -08:00
Andy Hanson
240b474ba3 Merge branch 'master' into path_mapping_exact_extension 2016-11-11 13:52:10 -08:00
Andy
1510674d47 Merge pull request #12020 from Microsoft/symlink3
Only resolve symlinks in `node_modules`
2016-11-11 13:52:00 -08:00
Andy Hanson
6c7e1b6913 Merge branch 'master' into symlink3 2016-11-11 13:35:47 -08:00
Andy
9a3dd3e81c Merge pull request #11993 from Microsoft/common_source_directory
Leave files from `node_modules` out when calculating `getCommonSourceDirectory`
2016-11-11 13:18:42 -08:00
Andy
382891ff23 Merge pull request #11926 from Microsoft/module_resolution_fixes
When looking up modules in @types, only look for `index.d.ts` and `pa…
2016-11-11 13:17:45 -08:00
Andy Hanson
b65729e5b2 Merge branch 'master' into common_source_directory 2016-11-11 13:10:29 -08:00
Andy Hanson
ce9e5f5227 Fix test 2016-11-11 13:00:40 -08:00
Andy Hanson
823d385322 Add Push interface 2016-11-11 12:49:53 -08:00
Andy Hanson
8308ab34d8 When looking up modules in @types, only look for index.d.ts and package.json. 2016-11-11 12:49:53 -08:00
Anders Hejlsberg
5028a44e56 Accept new baselines 2016-11-11 11:00:24 -08:00
Anders Hejlsberg
ca3f797832 More tests 2016-11-11 11:00:09 -08:00
Nathan Shively-Sanders
1bc4ab0850 Merge pull request #12177 from Microsoft/error-on-non-identifier-rest-in-destructuring-assignment
Error on non identifier rest in destructuring assignment
2016-11-11 09:21:07 -08:00
Nathan Shively-Sanders
de9f59a301 Test non-identifier rest in destructuring assignment 2016-11-11 08:57:11 -08:00
Nathan Shively-Sanders
9b2b2ca19b Error on non-identifier rest in destructuring assignment 2016-11-11 08:56:35 -08:00
Anders Hejlsberg
e9b6ddc9ae Add tests 2016-11-11 07:40:05 -08:00
Anders Hejlsberg
364142c062 Improve type inference for types with same generic type alias 2016-11-11 07:39:51 -08:00
Anders Hejlsberg
1c7ec6b8ce Add missing node visits in forEachChild 2016-11-11 07:38:44 -08:00
Mohamed Hegazy
ea309fe504 Update version (#12162) 2016-11-10 16:30:01 -08:00
Anders Hejlsberg
cd185f2cf6 Add declaration emit support 2016-11-10 15:20:29 -08:00
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
Anders Hejlsberg
64d269885c Merge branch 'master' into mappedTypes
# Conflicts:
#	src/compiler/checker.ts
2016-11-10 11:17:53 -08:00
Anders Hejlsberg
aca1ab3bfe Check mapped type constraint is assignable to string | number 2016-11-10 10:41:17 -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
Anders Hejlsberg
de2da2cb72 Accept new baselines 2016-11-10 10:32:05 -08:00