Skip to content

Commit

Permalink
Merge master into release branch 06/30 (#9447)
Browse files Browse the repository at this point in the history
* do not format comma/closeparen in jsxelement

* format jsx expression

* make rules optional

* Remove upper boilerplate from issue template

Our issue stats did not improve appreciably when we added the issue template. Reduce upper boilerplate text and try to make it more action-oriented

* Update issue_template.md

* new options should be optional for compatibility

* Add getCurrentDirectory to ServerHost

* Add nullchecks for typeRoots, remove getCurrentDirectory from ServerHost as it is always the installation location

* VarDate interface and relevant Date.prototype members

* Fix 9363: Object destructuring broken-variables are bound to the wrong object (#9383)

* Fix emit incorrect destructuring mapping in var declaration

* Add tests and baselines

* Add additional tests and baselines

* Fix crash in async functions when targetting ES5.

When targetting ES5 and with --noImplicitReturns,
an async function whose return type could not be determined would cause
a compiler crash.

* Add This type to lib

* getVarDate should be on the Date interface

* Don't emit source files found under node_modules

* Destructuring assignment removes undefined from type when default value is given

* Add nullcheck when calculating indentations for implort clause

* Add test

* Dont load JavaScript if types packages are present

* Renamed API

* Use checkExpression, not checkExpressionCached

* Show "<unknown>" if the name of a declaration is unavailable

* Parse `export default async function` as a declaration

* Removed one error to avoid full path issues

* Fix incorrectly-saved quote symbols in ThirdPartyNoticeText.txt
  • Loading branch information
yuit authored Jul 1, 2016
1 parent f7c9a77 commit fc10eb7
Show file tree
Hide file tree
Showing 20 changed files with 2,216 additions and 2,063 deletions.
2 changes: 1 addition & 1 deletion ThirdPartyNoticeText.txt
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@ Third Party Code Components
--------------------------------------------

------------------- DefinitelyTyped --------------------
This file is based on or incorporates material from the projects listed below (collectively ?Third Party Code?). Microsoft is not the original author of the Third Party Code. The original copyright notice and the license, under which Microsoft received such Third Party Code, are set forth below. Such licenses and notices are provided for informational purposes only. Microsoft, not the third party, licenses the Third Party Code to you under the terms set forth in the EULA for the Microsoft Product. Microsoft reserves all other rights not expressly granted under this agreement, whether by implication, estoppel or otherwise.
This file is based on or incorporates material from the projects listed below (collectively "Third Party Code"). Microsoft is not the original author of the Third Party Code. The original copyright notice and the license, under which Microsoft received such Third Party Code, are set forth below. Such licenses and notices are provided for informational purposes only. Microsoft, not the third party, licenses the Third Party Code to you under the terms set forth in the EULA for the Microsoft Product. Microsoft reserves all other rights not expressly granted under this agreement, whether by implication, estoppel or otherwise.
DefinitelyTyped
This project is licensed under the MIT license.
Copyrights are respective of each contributor listed at the beginning of each definition file.
Expand Down
8 changes: 7 additions & 1 deletion src/compiler/checker.ts
Original file line number Diff line number Diff line change
Expand Up @@ -12544,6 +12544,12 @@ namespace ts {
if (exprOrAssignment.kind === SyntaxKind.ShorthandPropertyAssignment) {
const prop = <ShorthandPropertyAssignment>exprOrAssignment;
if (prop.objectAssignmentInitializer) {
// In strict null checking mode, if a default value of a non-undefined type is specified, remove
// undefined from the final type.
if (strictNullChecks &&
!(getCombinedTypeFlags(checkExpression(prop.objectAssignmentInitializer)) & TypeFlags.Undefined)) {
sourceType = getTypeWithFacts(sourceType, TypeFacts.NEUndefined);
}
checkBinaryLikeExpression(prop.name, prop.equalsToken, prop.objectAssignmentInitializer, contextualMapper);
}
target = (<ShorthandPropertyAssignment>exprOrAssignment).name;
Expand Down Expand Up @@ -15450,7 +15456,7 @@ namespace ts {

function isUnwrappedReturnTypeVoidOrAny(func: FunctionLikeDeclaration, returnType: Type): boolean {
const unwrappedReturnType = isAsyncFunctionLike(func) ? getPromisedType(returnType) : returnType;
return maybeTypeOfKind(unwrappedReturnType, TypeFlags.Void | TypeFlags.Any);
return unwrappedReturnType && maybeTypeOfKind(unwrappedReturnType, TypeFlags.Void | TypeFlags.Any);
}

function checkReturnStatement(node: ReturnStatement) {
Expand Down
10 changes: 5 additions & 5 deletions src/compiler/parser.ts
Original file line number Diff line number Diff line change
Expand Up @@ -1155,12 +1155,12 @@ namespace ts {
if (token === SyntaxKind.ExportKeyword) {
nextToken();
if (token === SyntaxKind.DefaultKeyword) {
return lookAhead(nextTokenIsClassOrFunction);
return lookAhead(nextTokenIsClassOrFunctionOrAsync);
}
return token !== SyntaxKind.AsteriskToken && token !== SyntaxKind.AsKeyword && token !== SyntaxKind.OpenBraceToken && canFollowModifier();
}
if (token === SyntaxKind.DefaultKeyword) {
return nextTokenIsClassOrFunction();
return nextTokenIsClassOrFunctionOrAsync();
}
if (token === SyntaxKind.StaticKeyword) {
nextToken();
Expand All @@ -1182,9 +1182,9 @@ namespace ts {
|| isLiteralPropertyName();
}

function nextTokenIsClassOrFunction(): boolean {
function nextTokenIsClassOrFunctionOrAsync(): boolean {
nextToken();
return token === SyntaxKind.ClassKeyword || token === SyntaxKind.FunctionKeyword;
return token === SyntaxKind.ClassKeyword || token === SyntaxKind.FunctionKeyword || token === SyntaxKind.AsyncKeyword;
}

// True if positioned at the start of a list element
Expand Down Expand Up @@ -5070,7 +5070,7 @@ namespace ts {
* In such situations, 'permitInvalidConstAsModifier' should be set to true.
*/
function parseModifiers(permitInvalidConstAsModifier?: boolean): ModifiersArray {
let flags = 0;
let flags: NodeFlags = 0;
let modifiers: ModifiersArray;
while (true) {
const modifierStart = scanner.getStartPos();
Expand Down
2 changes: 1 addition & 1 deletion src/compiler/types.ts
Original file line number Diff line number Diff line change
Expand Up @@ -469,7 +469,7 @@ namespace ts {
}

export interface ModifiersArray extends NodeArray<Modifier> {
flags: number;
flags: NodeFlags;
}

// @kind(SyntaxKind.AbstractKeyword)
Expand Down
Loading

0 comments on commit fc10eb7

Please sign in to comment.