Skip to content

Commit 3532875

Browse files
committed
Merge branch 'master' into completionWithMeaning
2 parents 1f16778 + 9611e58 commit 3532875

File tree

130 files changed

+1959
-803
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

130 files changed

+1959
-803
lines changed

.travis.yml

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -16,9 +16,6 @@ matrix:
1616
branches:
1717
only:
1818
- master
19-
- release-2.1
20-
- release-2.2
21-
- release-2.3
2219

2320
install:
2421
- npm uninstall typescript --no-save

issue_template.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22
<!-- QUESTIONS: This is not a general support forum! Ask Qs at http://stackoverflow.com/questions/tagged/typescript -->
33
<!-- SUGGESTIONS: See https://github.com/Microsoft/TypeScript-wiki/blob/master/Writing-Good-Design-Proposals.md -->
44

5-
**TypeScript Version:** 2.2.1 / nightly (2.2.0-dev.201xxxxx)
5+
**TypeScript Version:** 2.4.0 / nightly (2.5.0-dev.201xxxxx)
66

77
**Code**
88

package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22
"name": "typescript",
33
"author": "Microsoft Corp.",
44
"homepage": "http://typescriptlang.org/",
5-
"version": "2.4.0",
5+
"version": "2.5.0",
66
"license": "Apache-2.0",
77
"description": "TypeScript is a language for application scale JavaScript development",
88
"keywords": [

src/compiler/checker.ts

Lines changed: 72 additions & 180 deletions
Large diffs are not rendered by default.

src/compiler/core.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@
33

44
namespace ts {
55
/** The version of the TypeScript compiler release */
6-
export const version = "2.4.0";
6+
export const version = "2.5.0";
77
}
88

99
/* @internal */

src/compiler/declarationEmitter.ts

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -335,9 +335,12 @@ namespace ts {
335335
write(": ");
336336

337337
// use the checker's type, not the declared type,
338-
// for non-optional initialized parameters that aren't a parameter property
338+
// for optional parameter properties
339+
// and also for non-optional initialized parameters that aren't a parameter property
340+
// these types may need to add `undefined`.
339341
const shouldUseResolverType = declaration.kind === SyntaxKind.Parameter &&
340-
resolver.isRequiredInitializedParameter(declaration as ParameterDeclaration);
342+
(resolver.isRequiredInitializedParameter(declaration as ParameterDeclaration) ||
343+
resolver.isOptionalUninitializedParameterProperty(declaration as ParameterDeclaration));
341344
if (type && !shouldUseResolverType) {
342345
// Write the type
343346
emitType(type);

src/compiler/diagnosticMessages.json

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -3625,6 +3625,10 @@
36253625
"category": "Message",
36263626
"code": 90024
36273627
},
3628+
"Prefix '{0}' with an underscore.": {
3629+
"category": "Message",
3630+
"code": 90025
3631+
},
36283632

36293633
"Convert function to an ES2015 class": {
36303634
"category": "Message",

src/compiler/parser.ts

Lines changed: 1 addition & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -685,7 +685,7 @@ namespace ts {
685685

686686
sourceFile.statements = parseList(ParsingContext.SourceElements, parseStatement);
687687
Debug.assert(token() === SyntaxKind.EndOfFileToken);
688-
sourceFile.endOfFileToken = <EndOfFileToken>parseTokenNode();
688+
sourceFile.endOfFileToken = addJSDocComment(parseTokenNode() as EndOfFileToken);
689689

690690
setExternalModuleIndicator(sourceFile);
691691

@@ -6698,9 +6698,6 @@ namespace ts {
66986698
}
66996699
else {
67006700
preName = name;
6701-
}
6702-
6703-
if (!typeExpression) {
67046701
typeExpression = tryParseTypeExpression();
67056702
}
67066703

src/compiler/transformers/es2015.ts

Lines changed: 10 additions & 19 deletions
Original file line numberDiff line numberDiff line change
@@ -3401,28 +3401,19 @@ namespace ts {
34013401
classBodyStart++;
34023402
}
34033403

3404-
// We reuse the comment and source-map positions from the original variable statement
3405-
// and class alias, while converting the function declaration for the class constructor
3406-
// into an expression.
3404+
// The next statement is the function declaration.
3405+
statements.push(funcStatements[classBodyStart]);
3406+
classBodyStart++;
3407+
3408+
// Add the class alias following the declaration.
34073409
statements.push(
3408-
updateVariableStatement(
3409-
varStatement,
3410-
/*modifiers*/ undefined,
3411-
updateVariableDeclarationList(varStatement.declarationList, [
3412-
updateVariableDeclaration(variable,
3413-
variable.name,
3414-
/*type*/ undefined,
3415-
updateBinary(aliasAssignment,
3416-
aliasAssignment.left,
3417-
convertFunctionDeclarationToExpression(
3418-
cast(funcStatements[classBodyStart], isFunctionDeclaration)
3419-
)
3420-
)
3421-
)
3422-
])
3410+
createStatement(
3411+
createAssignment(
3412+
aliasAssignment.left,
3413+
cast(variable.name, isIdentifier)
3414+
)
34233415
)
34243416
);
3425-
classBodyStart++;
34263417
}
34273418

34283419
// Find the trailing 'return' statement (4)

src/compiler/types.ts

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -2814,6 +2814,7 @@ namespace ts {
28142814
collectLinkedAliases(node: Identifier): Node[];
28152815
isImplementationOfOverload(node: FunctionLikeDeclaration): boolean | undefined;
28162816
isRequiredInitializedParameter(node: ParameterDeclaration): boolean;
2817+
isOptionalUninitializedParameterProperty(node: ParameterDeclaration): boolean;
28172818
writeTypeOfDeclaration(declaration: AccessorDeclaration | VariableLikeDeclaration, enclosingDeclaration: Node, flags: TypeFormatFlags, writer: SymbolWriter): void;
28182819
writeReturnTypeOfSignatureDeclaration(signatureDeclaration: SignatureDeclaration, enclosingDeclaration: Node, flags: TypeFormatFlags, writer: SymbolWriter): void;
28192820
writeTypeOfExpression(expr: Expression, enclosingDeclaration: Node, flags: TypeFormatFlags, writer: SymbolWriter): void;
@@ -3406,8 +3407,6 @@ namespace ts {
34063407
signature: Signature; // Generic signature for which inferences are made
34073408
inferences: InferenceInfo[]; // Inferences made for each type parameter
34083409
flags: InferenceFlags; // Inference flags
3409-
failedTypeParameterIndex?: number; // Index of type parameter for which inference failed
3410-
// It is optional because in contextual signature instantiation, nothing fails
34113410
}
34123411

34133412
/* @internal */

0 commit comments

Comments
 (0)