Commit graph

7942 commits

Author SHA1 Message Date
Nathan Shively-Sanders
b0a387aafa Address PR comments
And address bug with contextually typed arguments that the PR changes
exposed.
2016-05-05 15:04:17 -07:00
Nathan Shively-Sanders
aa38cdba56 Contextually type IIFE params by their arguments 2016-05-05 11:58:36 -07:00
Yui
673fa41418 Fix 8407: Allow (weak)map & (weak)set constructor when targeting ES5 using ES6 library (#8451)
* Move iterabl related stuffs off from es2015.collection

* Move symbol.wellknown stuffs off from es2015.collection

* Add map & set constructor support when targeting ES5

* Address PR: move symbol.iterator to es2015.iterable

* Move Symbol.Iterator into es2015.iterable

* Update baselines
2016-05-05 11:10:00 -07:00
Anders Hejlsberg
674e84bd26 Merge pull request #8471 from Microsoft/controlFlowCaching
Improved control flow caching
2016-05-04 17:29:33 -07:00
Yui
7521891760 Fix 8262: allow unparenthesized parameter in async arrow-function (#8444)
* Allow unparenthesize of parameter in async arrow-function

* Add tests and baselines

* Address PR

* Address PR: refactor to use "parseSimpleArrowFunctionExpression"

* Address PR: add comment

* Address PR
2016-05-04 17:00:28 -07:00
Anders Hejlsberg
3a4b56d6b7 Cache visited nodes and types in shared arrays to reduce object allocation 2016-05-04 15:18:57 -07:00
Anders Hejlsberg
9fa5971af0 Skip simple conditional flows in control flow graph 2016-05-04 15:17:39 -07:00
Anders Hejlsberg
e49773a7e9 Local caching of types of shared flow nodes 2016-05-04 13:24:05 -07:00
Anders Hejlsberg
79db146e32 Refactor from FlowKind to FlowFlags 2016-05-04 12:44:27 -07:00
Mohamed Hegazy
e9122a9f34 Merge pull request #8450 from Microsoft/Fix8357
Fix #8357: Remove optionality for the definition of `IteratorResult`
2016-05-03 21:54:44 -07:00
Mohamed Hegazy
24aabecf6c Merge pull request #8449 from Microsoft/Fix8423
Fix #8423: Remove undefined while getting the type of the first argument of then signature
2016-05-03 21:17:06 -07:00
Anders Hejlsberg
ccad31bf24 Equality comparisons for null/undefined in strict null checking mode 2016-05-03 17:05:12 -07:00
Mohamed Hegazy
9ff66fbb5e Code review comments 2016-05-03 16:13:33 -07:00
Anders Hejlsberg
7f82bebb03 Merge pull request #8443 from Microsoft/controlFlowAccessors
Include accessors in control flow type analysis
2016-05-03 16:11:15 -07:00
Mohamed Hegazy
9ad08324d8 Fix #8357: Remove optionality for the definition of IteratorResult 2016-05-03 15:53:17 -07:00
Mohamed Hegazy
b4baee492f Polyfill String.prototyp.fill 2016-05-03 14:52:41 -07:00
Mohamed Hegazy
c5a81edfb1 Fix #8423: Remove undefined while getting the type of the first argument of then signature 2016-05-03 14:51:30 -07:00
Vladimir Matveev
9f8a4c709f reset symbol count in binder 2016-05-03 13:56:02 -07:00
Anders Hejlsberg
c3186a452c Include accessors in control flow type analysis 2016-05-03 11:09:21 -07:00
Anders Hejlsberg
2ff9c915a0 Merge pull request #8429 from Microsoft/declaredTypeAsInitialType
Declared type as initial type in control flow analysis
2016-05-02 21:57:56 -07:00
Anders Hejlsberg
adc860893e Initial type of variable is union of declared type and undefined 2016-05-02 16:24:06 -07:00
Vladimir Matveev
8173ee9ba3 Merge pull request #8425 from Microsoft/use-before-def
check usage before declaration for computed properties in destructuri…
2016-05-02 15:04:02 -07:00
Mohamed Hegazy
4d53a21179 Merge pull request #8362 from Microsoft/Fix8338
Fix #8338: add signatures to RegExp constructor accepting RegExp
2016-05-02 14:38:25 -07:00
Vladimir Matveev
50390bb586 check usage before declaration for computed properties in destructuring inside for-of variable declaration 2016-05-02 13:31:35 -07:00
Anders Hejlsberg
a7e40469ff Merge pull request #8421 from Microsoft/controlFlowNestedLoops
Fix control flow analysis in nested loops
2016-05-02 12:02:57 -07:00
Mohamed Hegazy
afaffb10e5 Merge pull request #8366 from Microsoft/Fix7611-2
Fix #7611: Add support for String Literal Types in find all refs and occurances
2016-05-02 11:29:31 -07:00
Anders Hejlsberg
f183f1ab38 Quicker bail out for type analysis in nested loops 2016-05-02 09:21:54 -07:00
Daniel Rosenwasser
ee4baef51f Applied suggested change. 2016-05-01 21:08:53 -07:00
Daniel Rosenwasser
fa67cb86b3 Merge remote-tracking branch 'origin/master' into thisTypesInBasePropAndContainer 2016-05-01 20:52:51 -07:00
Alex Eagle
be9d8bd67a Include sourcefiles in the WriteFileCallback for .d.ts emit
Fixes #7438
2016-05-01 11:11:09 -07:00
Stanislav Sysoev
9adc42a20c Remove name length limit in navigation bar service for function expression 2016-04-30 21:48:30 +03:00
Nathan Shively-Sanders
d1b60f8bfb Merge pull request #8389 from Microsoft/make-object-literal-this-any-typed
Make `this` in object literal always of type `any`
2016-04-29 19:15:04 -07:00
Mohamed Hegazy
0cd0e0b5ea Code review comments 2016-04-29 17:04:53 -07:00
Anders Hejlsberg
f0e2d817ca Merge pull request #8390 from Microsoft/narrowingOfDottedNames
Fix narrowing of dotted names
2016-04-29 16:58:29 -07:00
Zhengbo Li
8acc88528d Merge pull request #8371 from zhengbli/fixRenameFileCacheIssue
Wipe out the cached script content if failed to read it
2016-04-29 16:31:40 -07:00
Anders Hejlsberg
bd4923a295 Reset dotted name narrowed types when type guards affect base name 2016-04-29 16:20:21 -07:00
Nathan Shively-Sanders
0a2ba0cc15 Make this in object literal always of type any
Previously, `this` was implicitly typed by the shape of its containing object literal.
This is not correct for JavaScript-style inheritance uses of object literals, and the previous fix was not correct either.
So we're going back to `this: any` in object literals for now.
2016-04-29 15:36:29 -07:00
Anders Hejlsberg
798257cdde Merge pull request #8387 from Microsoft/controlFlowDestructuringParameter
Fix control flow analysis for destructuring parameters
2016-04-29 14:40:29 -07:00
Anders Hejlsberg
bd08e882fa Correct handling of destructuring parameters in control flow analysis 2016-04-29 13:57:28 -07:00
Nathan Shively-Sanders
c12cb83fb7 Type 'this' in object literal function properties
Previously, methods of object literals would give a type to 'this'.
Now function properties of object literals also give a type to 'this'.
2016-04-29 10:31:01 -07:00
zhengbli
4d94ae8749 Wipe out the cached script content if failed to read it 2016-04-29 02:13:50 -07:00
Mohamed Hegazy
423503c883 Fix #7611: Add support for String Literal Types in find all refs and occurances 2016-04-28 23:29:10 -07:00
Mohamed Hegazy
b6e98e52c6 Fix #8338: add signatures to RegExp constructor accepting RegExp 2016-04-28 14:48:53 -07:00
Nathan Shively-Sanders
9f7621c7e2 Contextual signatures without thisType return anyType
If a contextual signature is found, if its thisType is undefined, then the contextual type of `this` is now `any`.
Previously `checkThisExpression` would keep looking for a different type for `this`.

Also update tests to show this new behaviour.
2016-04-28 14:17:11 -07:00
Nathan Shively-Sanders
88854d2c0f Address PR comments.
1. Remove intersection code. The any-defaulting code means that it's never hit.
2. Remove some code duplication.
2016-04-28 13:17:06 -07:00
Nathan Shively-Sanders
3a74f483ba this in object literals intersects contextual type and literal type 2016-04-28 10:09:04 -07:00
Nathan Shively-Sanders
465e9c82ff Revert Function.bind/apply/call this-overloads 2016-04-28 08:48:08 -07:00
Anders Hejlsberg
0613ad1963 Merge pull request #8340 from Microsoft/nothingType
Display 'nothing' for the empty union type
2016-04-27 14:58:00 -07:00
Zhengbo Li
70d805a935 Merge pull request #8318 from zhengbli/i7514
Add dirWatcher for "watch" option in tsconfig.json
2016-04-27 14:57:03 -07:00
zhengbli
cff98d5294 Move the dir watcher to parseConfigFile 2016-04-27 14:40:59 -07:00