Skip to content

[Transforms] Merge master 09/01 #10679

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 351 commits into from
Sep 6, 2016
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
351 commits
Select commit Hold shift + click to select a range
56cb07a
avoid using the global name
Aug 10, 2016
4087808
Fix single-quote lint
sandersn Aug 10, 2016
e16326d
Merge pull request #10260 from zhengbli/fixSession
zhengbli Aug 10, 2016
65e1293
Optimize performance of maps
ahejlsberg Aug 10, 2016
cba2e1a
Update API sample
ahejlsberg Aug 10, 2016
3ff89f7
Fix processDiagnosticMessages script
ahejlsberg Aug 11, 2016
fa991b5
Have travis take shallow clones of the repo (#10275)
weswigham Aug 11, 2016
5b9bd82
Merge branch 'master' into resolve_entity_name
Aug 11, 2016
688e9bc
Merge pull request #10234 from Microsoft/correct-this-in-tuple-type-p…
sandersn Aug 11, 2016
c9f62f3
Add folds to travis log (#10269)
weswigham Aug 11, 2016
e900952
Merge pull request #10013 from Microsoft/resolve_entity_name
Aug 11, 2016
e00ce94
Merge pull request #10240 from Microsoft/optimizeTypeListIds
ahejlsberg Aug 11, 2016
24d8d84
Optimize filterType to only call getUnionType if necessary
ahejlsberg Aug 11, 2016
9ac13ab
Add shorthand types declaration for travis-fold (#10293)
Aug 11, 2016
a3845a9
Optimize getTypeWithFacts
ahejlsberg Aug 11, 2016
c22a54f
Filter out nullable and primitive types in isDiscriminantProperty
ahejlsberg Aug 11, 2016
b336c69
Fix typo
ahejlsberg Aug 11, 2016
29ae2b2
Add regression tests
ahejlsberg Aug 11, 2016
644d655
Optimize core filter function to only allocate when necessary
ahejlsberg Aug 11, 2016
f1ea145
Address CR comments + more optimizations
ahejlsberg Aug 11, 2016
e64675e
Faster path for creating union types from filterType
ahejlsberg Aug 12, 2016
df739fd
Allow an @types direcotry to have a package.json which specifies `"ty…
Aug 11, 2016
b988bc9
Merge pull request #10303 from Microsoft/not_needed_types
Aug 12, 2016
19d89c4
Merge pull request #10296 from Microsoft/fixDiscriminantWithPrimtive
ahejlsberg Aug 12, 2016
87393e0
Merge branch 'master' into optimizeMaps
ahejlsberg Aug 12, 2016
ec49525
Merge pull request #10211 from RyanCavanaugh/fourslashTestPerf
RyanCavanaugh Aug 12, 2016
b0a4e27
Lint
RyanCavanaugh Aug 12, 2016
d206046
Collect timing information for commands running on travis (#10308)
weswigham Aug 12, 2016
c816244
Simplifies performance API
rbuckton Aug 12, 2016
5bdde3b
Merge pull request #10270 from Microsoft/optimizeMaps
ahejlsberg Aug 13, 2016
73d53e8
Use 'MapLike' instead of 'Map' in 'preferConstRule.ts'.
DanielRosenwasser Aug 13, 2016
10d1e02
Merge pull request #10323 from Microsoft/fixLint
DanielRosenwasser Aug 13, 2016
3835302
narrow from 'any' in most situations
yortus Aug 13, 2016
59c09d9
Update instanceof conformance tests
yortus Aug 13, 2016
cc8f326
accept new baselines
yortus Aug 14, 2016
66047c8
add tests
yortus Aug 14, 2016
837688f
accept new baselines
yortus Aug 14, 2016
78cea2a
Merge pull request #10334 from yortus/narrow-from-any
DanielRosenwasser Aug 15, 2016
3de8c22
Merge branch 'master' into no_ts_extension
Aug 15, 2016
54735ed
Use lowercase names for type reference directives
Aug 15, 2016
592805f
Use proper response codes in web tests
Aug 15, 2016
a1eda3c
Merge pull request #10341 from Microsoft/runtests_browser_response_code
Aug 15, 2016
ccf5bab
Treat ambient shorthand declarations as explicit uses of the `any` type
Aug 15, 2016
2eb159e
Rename 'find' functions
Aug 15, 2016
a1dad91
Parallel linting (#10313)
weswigham Aug 15, 2016
2d1b68f
Fix the style fix (#10344)
weswigham Aug 15, 2016
4e04b75
Aligned mark names with values used by ts-perf.
rbuckton Aug 15, 2016
75cb595
Merge pull request #10327 from Microsoft/simplePerformanceAPI
rbuckton Aug 15, 2016
2953c7f
Use an enum in checkClassForDuplicateDeclarations to aid readability
Aug 15, 2016
8f1960f
Rename to Accessor
Aug 15, 2016
5ad7729
Use `removeItem` instead of `copyListRemovingItem`
Aug 15, 2016
7ee05ba
Merge pull request #10345 from Microsoft/meaning
Aug 15, 2016
de6707e
Use removal helpers in more places
Aug 15, 2016
7f0a02f
Migrated more MapLikes to Maps
rbuckton Aug 15, 2016
9c83243
Add ES2015 Date constructor signature that accepts another Date (#10353)
yuit Aug 15, 2016
8f847c5
Parameters with no assignments implicitly considered const
ahejlsberg Aug 15, 2016
15dae3f
Add tests
ahejlsberg Aug 15, 2016
f3c085e
Merge branch 'master' into classPropertyInference
sandersn Aug 15, 2016
11f27e8
Merge pull request #10062 from YuichiNukiyama/fix9601
RyanCavanaugh Aug 15, 2016
80c04f8
Merge pull request #10358 from Microsoft/classPropertyInference
sandersn Aug 15, 2016
1dc495a
Migrate additional MapLikes to Maps.
rbuckton Aug 15, 2016
f7f5007
Fix 10625: JSX Not validating when index signature is present (#10352)
yuit Aug 16, 2016
5770157
Adding more comments
ahejlsberg Aug 16, 2016
889e5ac
Clean up/move some Map helper functions.
rbuckton Aug 16, 2016
c014655
Revert some formatting changes.
rbuckton Aug 16, 2016
ce5e207
Improve ReadonlyArray<T>.concat to match Array<T>
sandersn Aug 16, 2016
dcf3946
Fix link to blog
Aug 16, 2016
a697447
Remove old assertion about when we're allowed to use fileExists
Aug 16, 2016
a66b38a
Set isNewIdentifierLocation to true for JavaScript files
jramsay Aug 16, 2016
a36e155
Update error message for conflicting type definitions
RyanCavanaugh Aug 16, 2016
2a62917
Merge pull request #10377 from RyanCavanaugh/fix10370
RyanCavanaugh Aug 16, 2016
9cc8b2e
Merge pull request #10189 from chancancode/constructor-splat-arguments
DanielRosenwasser Aug 16, 2016
01aaff7
Merge pull request #10009 from Microsoft/null-undefined-allowed-as-in…
sandersn Aug 16, 2016
905957d
Merge pull request #10357 from Microsoft/implicitConstParameters
ahejlsberg Aug 16, 2016
02f908a
Merge branch 'master' into noImplicitAnyDestructuring
sheetalkamat Aug 16, 2016
c4d1f15
Merge pull request #10375 from Microsoft/fix_blog_link
mhegazy Aug 17, 2016
11c5c4e
Merge pull request #10359 from Microsoft/optimizeMoreMaps
rbuckton Aug 17, 2016
ef4fefc
Merge pull request #10340 from Microsoft/lower_case_types
Aug 17, 2016
c9d1f0d
Merge pull request #10376 from Microsoft/remove_file_exists_assertion
Aug 17, 2016
c42f1cb
Explain why we lower-case type reference directives
Aug 17, 2016
0006371
Merge pull request #10374 from Microsoft/readonly-array-type-argument…
sandersn Aug 17, 2016
96840c3
Merge branch 'master' into allow-js-multiple-declaration-of-construct…
sandersn Aug 17, 2016
c218d37
Merge pull request #9995 from Microsoft/jsdoc-string-literal-types
sandersn Aug 17, 2016
09bc2e6
Merge pull request #10387 from Microsoft/comment_process_type_referen…
mhegazy Aug 17, 2016
07a8f31
Correctly merge bindThisPropertyAssignment
sandersn Aug 17, 2016
c73efe2
Fix comment
sandersn Aug 17, 2016
9769718
Merge pull request #10123 from Microsoft/allow-js-multiple-declaratio…
sandersn Aug 17, 2016
271ffc8
Merge branch 'master' into instantiate-this-for-contextually-typed-ty…
sandersn Aug 17, 2016
bf63811
Merge pull request #10213 from RyanCavanaugh/baselinePerf
RyanCavanaugh Aug 17, 2016
2d1639f
Property handle imcomplete control flow types in nested loops
ahejlsberg Aug 17, 2016
44476f1
Update due to CR suggestion
jramsay Aug 17, 2016
b93cdec
Add regression test
ahejlsberg Aug 17, 2016
ef2d6ab
Merge pull request #10342 from Microsoft/ambient_shorthand_is_explici…
mhegazy Aug 17, 2016
7a9f8c8
Merge pull request #10391 from Microsoft/SetIsNewIdentifierLocationTo…
jramsay Aug 17, 2016
4880e7e
Merge pull request #10396 from Microsoft/fixNestedLoopTypeGuards
ahejlsberg Aug 17, 2016
0f483d6
Assign and instantiate contextual this type if not present
sandersn Aug 17, 2016
5843bbb
Merge branch 'noErrorTruncation' of https://github.com/gcnew/TypeScri…
mhegazy Aug 17, 2016
73a6488
Merge branch 'gcnew-noErrorTruncation'
mhegazy Aug 17, 2016
da8fc5d
Fix 10289: correctly generate tsconfig.json with --lib (#10355)
yuit Aug 17, 2016
aa834d7
JSDoc supports null, undefined and never types
sandersn Aug 17, 2016
164beb3
Update baselines in jsDocParsing unit tests
sandersn Aug 17, 2016
73a857b
Restored comments to explain spreading 'arguments' into calls to 'sup…
DanielRosenwasser Aug 18, 2016
111b7c5
Added test.
DanielRosenwasser Aug 18, 2016
c1e70c9
Use the non-nullable type of the contextual type for object completions.
DanielRosenwasser Aug 18, 2016
d24afc2
Return non-JsDocComment children
zhengbli Aug 18, 2016
2e57220
Add more tests for `export = foo.bar`.
Aug 18, 2016
67b6c56
Output test baselines to tests/baselines/local instead of root
Aug 18, 2016
4e40b75
Merge pull request #10413 from Microsoft/export_equals_property_test
Aug 18, 2016
f57b0fb
Merge pull request #10415 from Microsoft/baseline_local_path
RyanCavanaugh Aug 18, 2016
6facbf1
Merge pull request #10403 from Microsoft/completionsForNullableObjects
DanielRosenwasser Aug 18, 2016
d830034
Merge pull request #10404 from Microsoft/addCommentForEmptyCtorEmit
DanielRosenwasser Aug 18, 2016
8fc17af
Move supportedTypescriptExtensionsWithDtsFirst next to supportedTypeS…
Aug 18, 2016
952d2fe
Fix comment
Aug 18, 2016
b8963ba
Fix RWC Runner (#10420)
yuit Aug 18, 2016
a621c09
Merge pull request #8241 from Microsoft/noImplicitAnyDestructuring
mhegazy Aug 18, 2016
03dcdda
Treat special property access symbol differently
Aug 19, 2016
297cb50
Merge branch 'master' into no_ts_extension
Aug 19, 2016
b452469
Fix tests
Aug 19, 2016
b482fa5
Merge branch 'master' into cast_of_await
Aug 19, 2016
19cde06
Merge pull request #9890 from Microsoft/cast_of_await
Aug 19, 2016
d2d5d42
Merge pull request #9646 from Microsoft/no_ts_extension
Aug 19, 2016
949c517
Add `multiMapAdd` helper
Aug 15, 2016
7f6e36c
Update shim version to be 2.1 (#10424)
yuit Aug 19, 2016
0168ab2
Check return code paths on getters (#10102)
weswigham Aug 19, 2016
da6d951
Remove extraneous arguments from harness's runBaseline (#10419)
weswigham Aug 19, 2016
6c60e5b
Remove needless call to basename
RyanCavanaugh Aug 19, 2016
def29f6
Merge pull request #10439 from RyanCavanaugh/fixJakeBaselineAccept
RyanCavanaugh Aug 19, 2016
8ad2744
Refactor baseliners out of compiler runner (#10440)
weswigham Aug 19, 2016
057357b
CR feedback
Aug 19, 2016
a5bb13f
fix broken tests
Aug 19, 2016
a531b87
Pass in baselineOpts into types baselines so that RWC baselines can b…
yuit Aug 20, 2016
d8ab098
Merge pull request #10426 from zhengbli/9518
zhengbli Aug 20, 2016
806e142
Add error message
YuichiNukiyama Aug 20, 2016
37a9e6a
fix linting error
YuichiNukiyama Aug 20, 2016
0c01874
follow advise
YuichiNukiyama Aug 20, 2016
bc0c137
remove extra code
YuichiNukiyama Aug 20, 2016
eeec775
Add more test for 10426
zhengbli Aug 21, 2016
dc7b18e
fix some errors
YuichiNukiyama Aug 21, 2016
794d3e9
routine update of dom libs
zhengbli Aug 21, 2016
66f6f9b
Merge pull request #10458 from zhengbli/betterTestForModuleExportDOc
zhengbli Aug 21, 2016
e445e01
Add test for jsdoc syntactic classification for function declaration
zhengbli Aug 21, 2016
6d2323b
Simplify implementation
zhengbli Aug 21, 2016
84386f9
Tolerate certain errors in tsconfig.json
zhengbli Aug 21, 2016
b207417
Add test for configFile error tolerance
zhengbli Aug 21, 2016
a8ab52f
Use TS parser to tolerate more errors in tsconfig.json
zhengbli Aug 21, 2016
582d8b8
Implement tuple types as type references to synthesized generic types
ahejlsberg Aug 21, 2016
7d82c22
Add comments + minor changes
ahejlsberg Aug 21, 2016
2e8d11e
Accept new baselines
ahejlsberg Aug 22, 2016
d6aa65d
Use unordered removal where possible
Aug 22, 2016
e3a1a98
Remove last external use of `unorderedRemoveFirstItemWhere`
Aug 22, 2016
05fef61
Add .types extension
Aug 22, 2016
4e56fc0
Properly guard for undefined in getTypeReferenceArity
ahejlsberg Aug 22, 2016
2c814f4
Add jsdoc nullable union test case to fourslash
sandersn Aug 22, 2016
bb6c6fd
Merge pull request #10478 from Microsoft/fixtypesRWC
mhegazy Aug 22, 2016
2013058
Fix class/interface merging issue + lint error
ahejlsberg Aug 22, 2016
92eb8df
Allow "typings" in a package.json to be missing its extension (but al…
Aug 22, 2016
ec1f6b1
Merge pull request #10480 from Microsoft/typings_extension_is_optional
Aug 22, 2016
a013759
Merge pull request #10399 from Microsoft/jsdoc-never-undefined-null-t…
sandersn Aug 22, 2016
5aafc2c
Contextually type this in getDeclFromSig, not checkThisExpr
sandersn Aug 22, 2016
4a58e68
Update parser comment with es7 grammar (#10459)
yuit Aug 22, 2016
3fb0840
Merge pull request #10466 from Microsoft/tupleTypeReferences
ahejlsberg Aug 22, 2016
6f722b0
Merge pull request #10441 from zhengbli/routineUpdate819
zhengbli Aug 22, 2016
d133b0e
Merge pull request #10407 from zhengbli/fixJsDocSyntacticClassification
mhegazy Aug 22, 2016
edbeab0
Merge pull request #10418 from zhengbli/tolerateConfigError
zhengbli Aug 22, 2016
046b55e
allowSyntheticDefaultImports resolves to modules instead of variables
sandersn Aug 22, 2016
fc1d6a8
Rename getContextuallyTypedThisParameter to getContextualThisParameter
sandersn Aug 22, 2016
36130ff
Fix 10472: Invalid emitted code for await expression (#10483)
yuit Aug 22, 2016
f028fa3
Merge pull request #9746 from Microsoft/instantiate-this-for-contextu…
sandersn Aug 22, 2016
93de502
Merge pull request #10486 from Microsoft/allowSyntheticDefaultImports…
sandersn Aug 22, 2016
0f83fc1
Added tests.
DanielRosenwasser Aug 23, 2016
e7798c0
Accepted baselines.
DanielRosenwasser Aug 23, 2016
3292631
Added test for untyped tag.
DanielRosenwasser Aug 23, 2016
310e9c3
Accepted baselines.
DanielRosenwasser Aug 23, 2016
590755b
change error message
YuichiNukiyama Aug 23, 2016
ddb5a00
Merge pull request #10446 from YuichiNukiyama/fix10351
sandersn Aug 23, 2016
c21d16a
Added test for decorators.
DanielRosenwasser Aug 23, 2016
d6ec5f2
Accepted baselines.
DanielRosenwasser Aug 23, 2016
7ecbfb2
Unify untyped call checking between decorators and template tags.
DanielRosenwasser Aug 23, 2016
5ce285c
Accepted baselines.
DanielRosenwasser Aug 23, 2016
73c3961
Adding display parts to definition items to support FindAllReferences
riknoll Aug 25, 2016
bab4a52
strip comments when re-emitting tsconfig.json (#10529)
zhengbli Aug 25, 2016
c0309fa
Fix crash when checking module exports for export=
sandersn Aug 25, 2016
751b0a6
Clean up maxNodeModuleJsDepth test
sandersn Aug 25, 2016
6ee749f
Get rid of absolute paths
sandersn Aug 25, 2016
e0a3684
PR feedback
riknoll Aug 25, 2016
15ff0f7
[Release 2.0] fix10179: 2.0 emits optional class properties defined i…
yuit Aug 8, 2016
8d5aaf8
avoid creating syntax nodes for jsdoc comment tags (#10526)
zhengbli Aug 25, 2016
0041d5c
Merge pull request #10538 from Microsoft/find-declarations-of-js-modu…
sandersn Aug 25, 2016
c72f5e2
Merge pull request #10543 from Microsoft/port10212
mhegazy Aug 26, 2016
0116abd
First in UMD global wins
RyanCavanaugh Aug 26, 2016
b0f7f2f
Merge pull request #10354 from RyanCavanaugh/fix9771
RyanCavanaugh Aug 26, 2016
3f126a5
Allow to find all references for constructors
Aug 24, 2016
c1a291d
Get the type of a constructor as the type of the class
Aug 26, 2016
f90d8dd
Reuse code for tryGetClassExtendingIdentifier
Aug 26, 2016
0a985ee
Parse untyped object type members separated by ','
sandersn Aug 26, 2016
3f8cd82
Update other tests and baselines
sandersn Aug 26, 2016
7e6f18d
Don't use constructor symbol for search -- use class symbol and filte…
Aug 26, 2016
0dc976d
Remove unused parameter
Aug 26, 2016
712e7bf
Merge pull request #10568 from Microsoft/parse-untyped-object-type-me…
sandersn Aug 26, 2016
4c847eb
Fixing errors and adding a fourslash test
riknoll Aug 26, 2016
1763db4
Merge remote-tracking branch 'origin/master' into far_display_parts
riknoll Aug 26, 2016
e62f118
fix typo of missing node.kind (#10569)
yuit Aug 26, 2016
d72ed3c
Check for this symbol before getting display parts
riknoll Aug 26, 2016
598ca48
Merge pull request #10542 from Microsoft/far_display_parts
riknoll Aug 27, 2016
0485bb6
Merge pull request #10506 from Microsoft/ctorTag
DanielRosenwasser Aug 29, 2016
5e4465a
Treat variable declaration as top-level if it has an important child.
Aug 29, 2016
6f7f1b6
Merge branch 'master' into remove_item_from_list
Aug 29, 2016
4514f8f
Make goto-definition go to a signature declaration if possible
Aug 29, 2016
5977473
Support decorators and templates
Aug 30, 2016
efc7e9d
Climb past multiple property accesses if necessary
Aug 30, 2016
d47b3e2
Remove useless inserts that used to be required to trigger checks
Aug 30, 2016
0b95731
Fix 10408 : Better error message for set/get with noImplicitAny error…
yuit Aug 30, 2016
707d61d
Fix RWC Runner to report both .types and .symbols errors (#10513)
yuit Aug 31, 2016
ec7e858
fix issue
Salasar Sep 1, 2016
38de65a
Merge pull request #10607 from Microsoft/remove_useless_inserts
Sep 1, 2016
e8e7ec6
Remember to check for existence of `target.parent`
Sep 1, 2016
22ba111
Search for `node_modules` in parent directories when getting type roots.
Sep 1, 2016
db62503
Merge pull request #10661 from Salasar/Fix10618
mhegazy Sep 1, 2016
c5c6acf
Update test baselines: We no longer search in node_modules/@types if …
Sep 1, 2016
5f16a48
Merge pull request #10590 from Microsoft/navbar_fn_in_var
Sep 1, 2016
87e93a1
Fix remaining call to use `unorderedRemoveItem`
Sep 1, 2016
d7b6cc8
Respond to PR comments
Sep 1, 2016
3eadbf6
Rename function
Sep 1, 2016
2961d97
Merge pull request #10349 from Microsoft/remove_item_from_list
Sep 1, 2016
d6d6a4a
Merge branch 'goto_definition_super', remote-tracking branch 'origin'…
Sep 1, 2016
6ddcdcd
Merge pull request #10593 from Microsoft/goto_definition_super
Sep 1, 2016
ab75365
Respond to PR comments
Sep 1, 2016
8038eb9
Merge pull request #10540 from Microsoft/constructor_references
Sep 1, 2016
b5f4c07
Merge branch 'master' into mergeMaster_09/01
Sep 1, 2016
18e7240
Fix error from merging
Sep 1, 2016
95dad14
Update baselines
Sep 2, 2016
6dead9b
Fix linting error
Sep 2, 2016
13b63c5
Merge branch 'master' into multi_map_add
Sep 2, 2016
3bcfb6b
Merge pull request #10434 from Microsoft/multi_map_add
Sep 2, 2016
0e8e5ec
Search up for all node_modules directories available
Sep 2, 2016
74df444
Add `multiMapRemove` helper
Sep 2, 2016
cbd00b9
Use undefined instead of empty array, and check for existence of "nod…
Sep 2, 2016
37f8eac
Simplify go-to-definition tests
Aug 29, 2016
6d79aa6
Factor public type definitions out of services.ts into services/types.ts
Sep 2, 2016
4a8615f
Merge pull request #10687 from Microsoft/services_types
Sep 2, 2016
c75f6d0
Add multiple overloads for `verify.goToDefinition`.
Sep 2, 2016
85a13b8
Merge pull request #10670 from Microsoft/node_modules_parent
Sep 2, 2016
2d60a20
Default type roots when host.directoryExists is not implemented shoul…
Sep 2, 2016
32b6746
Merge pull request #10686 from Microsoft/go_to_definition_tests
Sep 2, 2016
3a1f8fc
Introduce resolvingSignature to ensure caching works for anySignature
ahejlsberg Sep 4, 2016
0536fcc
Add repro from #10697
ahejlsberg Sep 4, 2016
2379000
Merge pull request #10703 from Microsoft/fixSignatureCache
ahejlsberg Sep 4, 2016
d4cad48
Merge pull request #10684 from Microsoft/multi_map_remove
Sep 6, 2016
4a643e5
Merge pull request #10689 from Microsoft/node_modules_at_types
Sep 6, 2016
e1be0bc
Merge branch 'master' into mergeMaster_09/01
Sep 6, 2016
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions Jakefile.js
Original file line number Diff line number Diff line change
Expand Up @@ -128,6 +128,7 @@ var servicesSources = [
"services.ts",
"shims.ts",
"signatureHelp.ts",
"types.ts",
"utilities.ts",
"formatting/formatting.ts",
"formatting/formattingContext.ts",
Expand Down
76 changes: 55 additions & 21 deletions src/compiler/checker.ts
Original file line number Diff line number Diff line change
Expand Up @@ -143,6 +143,7 @@ namespace ts {

const anySignature = createSignature(undefined, undefined, undefined, emptyArray, anyType, /*typePredicate*/ undefined, 0, /*hasRestParameter*/ false, /*hasLiteralTypes*/ false);
const unknownSignature = createSignature(undefined, undefined, undefined, emptyArray, unknownType, /*typePredicate*/ undefined, 0, /*hasRestParameter*/ false, /*hasLiteralTypes*/ false);
const resolvingSignature = createSignature(undefined, undefined, undefined, emptyArray, anyType, /*typePredicate*/ undefined, 0, /*hasRestParameter*/ false, /*hasLiteralTypes*/ false);

const enumNumberIndexInfo = createIndexInfo(stringType, /*isReadonly*/ true);

Expand Down Expand Up @@ -1024,8 +1025,8 @@ namespace ts {
}
}

function getDeclarationOfAliasSymbol(symbol: Symbol): Declaration {
return findMap(symbol.declarations, d => isAliasSymbolDeclaration(d) ? d : undefined);
function getDeclarationOfAliasSymbol(symbol: Symbol): Declaration | undefined {
return forEach(symbol.declarations, d => isAliasSymbolDeclaration(d) ? d : undefined);
}

function getTargetOfImportEqualsDeclaration(node: ImportEqualsDeclaration): Symbol {
Expand Down Expand Up @@ -1192,6 +1193,7 @@ namespace ts {
if (!links.target) {
links.target = resolvingSymbol;
const node = getDeclarationOfAliasSymbol(symbol);
Debug.assert(!!node);
const target = getTargetOfAliasDeclaration(node);
if (links.target === resolvingSymbol) {
links.target = target || unknownSymbol;
Expand Down Expand Up @@ -1227,6 +1229,7 @@ namespace ts {
if (!links.referenced) {
links.referenced = true;
const node = getDeclarationOfAliasSymbol(symbol);
Debug.assert(!!node);
if (node.kind === SyntaxKind.ExportAssignment) {
// export default <symbol>
checkExpressionCached((<ExportAssignment>node).expression);
Expand Down Expand Up @@ -3348,7 +3351,13 @@ namespace ts {
// Otherwise, fall back to 'any'.
else {
if (compilerOptions.noImplicitAny) {
error(setter, Diagnostics.Property_0_implicitly_has_type_any_because_its_set_accessor_lacks_a_type_annotation, symbolToString(symbol));
if (setter) {
error(setter, Diagnostics.Property_0_implicitly_has_type_any_because_its_set_accessor_lacks_a_parameter_type_annotation, symbolToString(symbol));
}
else {
Debug.assert(!!getter, "there must existed getter as we are current checking either setter or getter in this function");
error(getter, Diagnostics.Property_0_implicitly_has_type_any_because_its_get_accessor_lacks_a_return_type_annotation, symbolToString(symbol));
}
}
type = anyType;
}
Expand Down Expand Up @@ -5374,7 +5383,7 @@ namespace ts {
while (i > 0) {
i--;
if (isSubtypeOfAny(types[i], types)) {
types.splice(i, 1);
orderedRemoveItemAt(types, i);
}
}
}
Expand Down Expand Up @@ -8758,7 +8767,7 @@ namespace ts {
// The location isn't a reference to the given symbol, meaning we're being asked
// a hypothetical question of what type the symbol would have if there was a reference
// to it at the given location. Since we have no control flow information for the
// hypotherical reference (control flow information is created and attached by the
// hypothetical reference (control flow information is created and attached by the
// binder), we simply return the declared type of the symbol.
return getTypeOfSymbol(symbol);
}
Expand Down Expand Up @@ -11993,18 +12002,12 @@ namespace ts {
// Function interface, since they have none by default. This is a bit of a leap of faith
// that the user will not add any.
const callSignatures = getSignaturesOfType(apparentType, SignatureKind.Call);

const constructSignatures = getSignaturesOfType(apparentType, SignatureKind.Construct);
// TS 1.0 spec: 4.12
// If FuncExpr is of type Any, or of an object type that has no call or construct signatures
// but is a subtype of the Function interface, the call is an untyped function call. In an
// untyped function call no TypeArgs are permitted, Args can be any argument list, no contextual

// TS 1.0 Spec: 4.12
// In an untyped function call no TypeArgs are permitted, Args can be any argument list, no contextual
// types are provided for the argument expressions, and the result is always of type Any.
// We exclude union types because we may have a union of function types that happen to have
// no common signatures.
if (isTypeAny(funcType) ||
(isTypeAny(apparentType) && funcType.flags & TypeFlags.TypeParameter) ||
(!callSignatures.length && !constructSignatures.length && !(funcType.flags & TypeFlags.Union) && isTypeAssignableTo(funcType, globalFunctionType))) {
if (isUntypedFunctionCall(funcType, apparentType, callSignatures.length, constructSignatures.length)) {
// The unknownType indicates that an error already occurred (and was reported). No
// need to report another error in this case.
if (funcType !== unknownType && node.typeArguments) {
Expand All @@ -12027,6 +12030,29 @@ namespace ts {
return resolveCall(node, callSignatures, candidatesOutArray);
}

/**
* TS 1.0 spec: 4.12
* If FuncExpr is of type Any, or of an object type that has no call or construct signatures
* but is a subtype of the Function interface, the call is an untyped function call.
*/
function isUntypedFunctionCall(funcType: Type, apparentFuncType: Type, numCallSignatures: number, numConstructSignatures: number) {
if (isTypeAny(funcType)) {
return true;
}
if (isTypeAny(apparentFuncType) && funcType.flags & TypeFlags.TypeParameter) {
return true;
}
if (!numCallSignatures && !numConstructSignatures) {
// We exclude union types because we may have a union of function types that happen to have
// no common signatures.
if (funcType.flags & TypeFlags.Union) {
return false;
}
return isTypeAssignableTo(funcType, globalFunctionType);
}
return false;
}

function resolveNewExpression(node: NewExpression, candidatesOutArray: Signature[]): Signature {
if (node.arguments && languageVersion < ScriptTarget.ES5) {
const spreadIndex = getSpreadArgumentIndex(node.arguments);
Expand Down Expand Up @@ -12152,8 +12178,9 @@ namespace ts {
}

const callSignatures = getSignaturesOfType(apparentType, SignatureKind.Call);
const constructSignatures = getSignaturesOfType(apparentType, SignatureKind.Construct);

if (isTypeAny(tagType) || (!callSignatures.length && !(tagType.flags & TypeFlags.Union) && isTypeAssignableTo(tagType, globalFunctionType))) {
if (isUntypedFunctionCall(tagType, apparentType, callSignatures.length, constructSignatures.length)) {
return resolveUntypedCall(node);
}

Expand Down Expand Up @@ -12198,7 +12225,8 @@ namespace ts {
}

const callSignatures = getSignaturesOfType(apparentType, SignatureKind.Call);
if (funcType === anyType || (!callSignatures.length && !(funcType.flags & TypeFlags.Union) && isTypeAssignableTo(funcType, globalFunctionType))) {
const constructSignatures = getSignaturesOfType(apparentType, SignatureKind.Construct);
if (isUntypedFunctionCall(funcType, apparentType, callSignatures.length, constructSignatures.length)) {
return resolveUntypedCall(node);
}

Expand Down Expand Up @@ -12237,10 +12265,10 @@ namespace ts {
// or that a different candidatesOutArray was passed in. Therefore, we need to redo the work
// to correctly fill the candidatesOutArray.
const cached = links.resolvedSignature;
if (cached && cached !== anySignature && !candidatesOutArray) {
if (cached && cached !== resolvingSignature && !candidatesOutArray) {
return cached;
}
links.resolvedSignature = anySignature;
links.resolvedSignature = resolvingSignature;
const result = resolveSignature(node, candidatesOutArray);
// If signature resolution originated in control flow type analysis (for example to compute the
// assigned type in a flow assignment) we don't cache the result as it may be based on temporary
Expand All @@ -12252,7 +12280,7 @@ namespace ts {
function getResolvedOrAnySignature(node: CallLikeExpression) {
// If we're already in the process of resolving the given signature, don't resolve again as
// that could cause infinite recursion. Instead, return anySignature.
return getNodeLinks(node).resolvedSignature === anySignature ? anySignature : getResolvedSignature(node);
return getNodeLinks(node).resolvedSignature === resolvingSignature ? resolvingSignature : getResolvedSignature(node);
}

function getInferredClassType(symbol: Symbol) {
Expand Down Expand Up @@ -18885,7 +18913,13 @@ namespace ts {
(augmentations || (augmentations = [])).push(file.moduleAugmentations);
}
if (file.symbol && file.symbol.globalExports) {
mergeSymbolTable(globals, file.symbol.globalExports);
// Merge in UMD exports with first-in-wins semantics (see #9771)
const source = file.symbol.globalExports;
for (const id in source) {
if (!(id in globals)) {
globals[id] = source[id];
}
}
}
if ((compilerOptions.isolatedModules || isExternalModule(file)) && !file.isDeclarationFile) {
const fileRequestedExternalEmitHelpers = file.flags & NodeFlags.EmitHelperFlags;
Expand Down
2 changes: 1 addition & 1 deletion src/compiler/commandLineParser.ts
Original file line number Diff line number Diff line change
Expand Up @@ -891,7 +891,7 @@ namespace ts {
function convertCompilerOptionsFromJsonWorker(jsonOptions: any,
basePath: string, errors: Diagnostic[], configFileName?: string): CompilerOptions {

const options: CompilerOptions = getBaseFileName(configFileName) === "jsconfig.json" ? { allowJs: true } : {};
const options: CompilerOptions = getBaseFileName(configFileName) === "jsconfig.json" ? { allowJs: true, maxNodeModuleJsDepth: 2 } : {};
convertOptionsFromJson(optionDeclarations, jsonOptions, basePath, options, Diagnostics.Unknown_compiler_option_0, errors);
return options;
}
Expand Down
71 changes: 62 additions & 9 deletions src/compiler/core.ts
Original file line number Diff line number Diff line change
Expand Up @@ -199,6 +199,10 @@ namespace ts {
return count;
}

/**
* Filters an array by a predicate function. Returns the same array instance if the predicate is
* true for all elements, otherwise returns a new array instance containing the filtered subset.
*/
export function filter<T, U extends T>(array: T[], f: (x: T) => x is U): U[];
export function filter<T>(array: T[], f: (x: T) => boolean): T[]
export function filter<T>(array: T[], f: (x: T) => boolean): T[] {
Expand Down Expand Up @@ -746,6 +750,36 @@ namespace ts {
return result;
}

/**
* Adds the value to an array of values associated with the key, and returns the array.
* Creates the array if it does not already exist.
*/
export function multiMapAdd<V>(map: Map<V[]>, key: string, value: V): V[] {
const values = map[key];
if (values) {
values.push(value);
return values;
}
else {
return map[key] = [value];
}
}

/**
* Removes a value from an array of values associated with the key.
* Does not preserve the order of those values.
* Does nothing if `key` is not in `map`, or `value` is not in `map[key]`.
*/
export function multiMapRemove<V>(map: Map<V[]>, key: string, value: V): void {
const values = map[key];
if (values) {
unorderedRemoveItem(values, value);
if (!values.length) {
delete map[key];
}
}
}

/**
* Tests whether a value is an array.
*/
Expand Down Expand Up @@ -1717,20 +1751,39 @@ namespace ts {
return "";
}

export function copyListRemovingItem<T>(item: T, list: T[]) {
const copiedList: T[] = [];
for (const e of list) {
if (e !== item) {
copiedList.push(e);
/** Remove an item from an array, moving everything to its right one space left. */
export function orderedRemoveItemAt<T>(array: T[], index: number): void {
// This seems to be faster than either `array.splice(i, 1)` or `array.copyWithin(i, i+ 1)`.
for (let i = index; i < array.length - 1; i++) {
array[i] = array[i + 1];
}
array.pop();
}

export function unorderedRemoveItemAt<T>(array: T[], index: number): void {
// Fill in the "hole" left at `index`.
array[index] = array[array.length - 1];
array.pop();
}

/** Remove the *first* occurrence of `item` from the array. */
export function unorderedRemoveItem<T>(array: T[], item: T): void {
unorderedRemoveFirstItemWhere(array, element => element === item);
}

/** Remove the *first* element satisfying `predicate`. */
function unorderedRemoveFirstItemWhere<T>(array: T[], predicate: (element: T) => boolean): void {
for (let i = 0; i < array.length; i++) {
if (predicate(array[i])) {
unorderedRemoveItemAt(array, i);
break;
}
}
return copiedList;
}

export function createGetCanonicalFileName(useCaseSensitivefileNames: boolean): (fileName: string) => string {
return useCaseSensitivefileNames
export function createGetCanonicalFileName(useCaseSensitiveFileNames: boolean): (fileName: string) => string {
return useCaseSensitiveFileNames
? ((fileName) => fileName)
: ((fileName) => fileName.toLowerCase());
}

}
6 changes: 4 additions & 2 deletions src/compiler/declarationEmitter.ts
Original file line number Diff line number Diff line change
Expand Up @@ -1133,8 +1133,10 @@ namespace ts {
// it if it's not a well known symbol. In that case, the text of the name will be exactly
// what we want, namely the name expression enclosed in brackets.
writeTextOfNode(currentText, node.name);
// If optional property emit ?
if ((node.kind === SyntaxKind.PropertyDeclaration || node.kind === SyntaxKind.PropertySignature || node.kind === SyntaxKind.Parameter) && hasQuestionToken(node)) {
// If optional property emit ? but in the case of parameterProperty declaration with "?" indicating optional parameter for the constructor
// we don't want to emit property declaration with "?"
if ((node.kind === SyntaxKind.PropertyDeclaration || node.kind === SyntaxKind.PropertySignature ||
(node.kind === SyntaxKind.Parameter && !isParameterPropertyDeclaration(node))) && hasQuestionToken(node)) {
write("?");
}
if ((node.kind === SyntaxKind.PropertyDeclaration || node.kind === SyntaxKind.PropertySignature) && node.parent.kind === SyntaxKind.TypeLiteral) {
Expand Down
14 changes: 9 additions & 5 deletions src/compiler/diagnosticMessages.json
Original file line number Diff line number Diff line change
Expand Up @@ -2871,11 +2871,7 @@
"Element implicitly has an 'any' type because index expression is not of type 'number'.": {
"category": "Error",
"code": 7015
},
"Property '{0}' implicitly has type 'any', because its 'set' accessor lacks a type annotation.": {
"category": "Error",
"code": 7016
},
},
"Index signature of object type implicitly has an 'any' type.": {
"category": "Error",
"code": 7017
Expand Down Expand Up @@ -2932,6 +2928,14 @@
"category": "Error",
"code": 7031
},
"Property '{0}' implicitly has type 'any', because its set accessor lacks a parameter type annotation.": {
"category": "Error",
"code": 7032
},
"Property '{0}' implicitly has type 'any', because its get accessor lacks a return type annotation.": {
"category": "Error",
"code": 7033
},
"You cannot rename this element.": {
"category": "Error",
"code": 8000
Expand Down
1 change: 1 addition & 0 deletions src/compiler/parser.ts
Original file line number Diff line number Diff line change
Expand Up @@ -2338,6 +2338,7 @@ namespace ts {
token() === SyntaxKind.LessThanToken ||
token() === SyntaxKind.QuestionToken ||
token() === SyntaxKind.ColonToken ||
token() === SyntaxKind.CommaToken ||
canParseSemicolon();
}
return false;
Expand Down
Loading