diff --git a/doc/logo.svg b/doc/logo.svg
index fc7e0fadd66..2c0dd017a1b 100644
--- a/doc/logo.svg
+++ b/doc/logo.svg
@@ -1,15 +1,10 @@
-
-
+
\ No newline at end of file
diff --git a/src/compiler/parser.ts b/src/compiler/parser.ts
index 308d3a317f9..5d585e2658a 100644
--- a/src/compiler/parser.ts
+++ b/src/compiler/parser.ts
@@ -1309,7 +1309,7 @@ namespace ts {
case ParsingContext.ObjectBindingElements:
return token() === SyntaxKind.OpenBracketToken || token() === SyntaxKind.DotDotDotToken || isLiteralPropertyName();
case ParsingContext.HeritageClauseElement:
- // If we see { } then only consume it as an expression if it is followed by , or {
+ // If we see `{ ... }` then only consume it as an expression if it is followed by `,` or `{`
// That way we won't consume the body of a class in its heritage clause.
if (token() === SyntaxKind.OpenBraceToken) {
return lookAhead(isValidHeritageClauseObjectLiteral);
@@ -2113,7 +2113,7 @@ namespace ts {
return finishNode(node);
}
- function parseTypeParameters(): NodeArray {
+ function parseTypeParameters(): NodeArray | undefined {
if (token() === SyntaxKind.LessThanToken) {
return parseBracketedList(ParsingContext.TypeParameters, parseTypeParameter, SyntaxKind.LessThanToken, SyntaxKind.GreaterThanToken);
}
@@ -2183,7 +2183,7 @@ namespace ts {
}
function fillSignature(
- returnToken: SyntaxKind,
+ returnToken: SyntaxKind.ColonToken | SyntaxKind.EqualsGreaterThanToken,
yieldContext: boolean,
awaitContext: boolean,
requireCompleteParameterList: boolean,
@@ -2373,14 +2373,14 @@ namespace ts {
}
function isTypeMemberStart(): boolean {
- let idToken: SyntaxKind;
// Return true if we have the start of a signature member
if (token() === SyntaxKind.OpenParenToken || token() === SyntaxKind.LessThanToken) {
return true;
}
+ let idToken: boolean;
// Eat up all modifiers, but hold on to the last one in case it is actually an identifier
while (isModifierKind(token())) {
- idToken = token();
+ idToken = true;
nextToken();
}
// Index signatures and computed property names are type members
@@ -2389,7 +2389,7 @@ namespace ts {
}
// Try to get the first property-like token following all modifiers
if (isLiteralPropertyName()) {
- idToken = token();
+ idToken = true;
nextToken();
}
// If we were able to get any potential identifier, check that it is
@@ -2497,7 +2497,7 @@ namespace ts {
return finishNode(node);
}
- function parseKeywordAndNoDot(): TypeNode {
+ function parseKeywordAndNoDot(): TypeNode | undefined {
const node = parseTokenNode();
return token() === SyntaxKind.DotToken ? undefined : node;
}
@@ -2635,7 +2635,7 @@ namespace ts {
return parseArrayTypeOrHigher();
}
- function parseUnionOrIntersectionType(kind: SyntaxKind, parseConstituentType: () => TypeNode, operator: SyntaxKind): TypeNode {
+ function parseUnionOrIntersectionType(kind: SyntaxKind.UnionType | SyntaxKind.IntersectionType, parseConstituentType: () => TypeNode, operator: SyntaxKind.BarToken | SyntaxKind.AmpersandToken): TypeNode {
parseOptional(operator);
let type = parseConstituentType();
if (token() === operator) {
@@ -5281,8 +5281,8 @@ namespace ts {
*
* In such situations, 'permitInvalidConstAsModifier' should be set to true.
*/
- function parseModifiers(permitInvalidConstAsModifier?: boolean): NodeArray {
- let modifiers: NodeArray;
+ function parseModifiers(permitInvalidConstAsModifier?: boolean): NodeArray | undefined {
+ let modifiers: NodeArray | undefined;
while (true) {
const modifierStart = scanner.getStartPos();
const modifierKind = token();
@@ -5422,7 +5422,7 @@ namespace ts {
return token() === SyntaxKind.ImplementsKeyword && lookAhead(nextTokenIsIdentifierOrKeyword);
}
- function parseHeritageClauses(): NodeArray {
+ function parseHeritageClauses(): NodeArray | undefined {
// ClassTail[Yield,Await] : (Modified) See 14.5
// ClassHeritage[?Yield,?Await]opt { ClassBody[?Yield,?Await]opt }
@@ -5433,7 +5433,7 @@ namespace ts {
return undefined;
}
- function parseHeritageClause() {
+ function parseHeritageClause(): HeritageClause | undefined {
if (token() === SyntaxKind.ExtendsKeyword || token() === SyntaxKind.ImplementsKeyword) {
const node = createNode(SyntaxKind.HeritageClause);
node.token = token();
@@ -5459,7 +5459,7 @@ namespace ts {
return token() === SyntaxKind.ExtendsKeyword || token() === SyntaxKind.ImplementsKeyword;
}
- function parseClassMembers() {
+ function parseClassMembers(): NodeArray {
return parseList(ParsingContext.ClassMembers, parseClassElement);
}
@@ -5618,17 +5618,7 @@ namespace ts {
if (isIdentifier()) {
identifier = parseIdentifier();
if (token() !== SyntaxKind.CommaToken && token() !== SyntaxKind.FromKeyword) {
- // ImportEquals declaration of type:
- // import x = require("mod"); or
- // import x = M.x;
- const importEqualsDeclaration = createNode(SyntaxKind.ImportEqualsDeclaration, fullStart);
- importEqualsDeclaration.decorators = decorators;
- importEqualsDeclaration.modifiers = modifiers;
- importEqualsDeclaration.name = identifier;
- parseExpected(SyntaxKind.EqualsToken);
- importEqualsDeclaration.moduleReference = parseModuleReference();
- parseSemicolon();
- return addJSDocComment(finishNode(importEqualsDeclaration));
+ return parseImportEqualsDeclaration(fullStart, decorators, modifiers, identifier);
}
}
@@ -5652,6 +5642,17 @@ namespace ts {
return finishNode(importDeclaration);
}
+ function parseImportEqualsDeclaration(fullStart: number, decorators: NodeArray, modifiers: NodeArray, identifier: ts.Identifier): ImportEqualsDeclaration {
+ const importEqualsDeclaration = createNode(SyntaxKind.ImportEqualsDeclaration, fullStart);
+ importEqualsDeclaration.decorators = decorators;
+ importEqualsDeclaration.modifiers = modifiers;
+ importEqualsDeclaration.name = identifier;
+ parseExpected(SyntaxKind.EqualsToken);
+ importEqualsDeclaration.moduleReference = parseModuleReference();
+ parseSemicolon();
+ return addJSDocComment(finishNode(importEqualsDeclaration));
+ }
+
function parseImportClause(identifier: Identifier, fullStart: number) {
// ImportClause:
// ImportedDefaultBinding
diff --git a/src/compiler/types.ts b/src/compiler/types.ts
index d802adf67ec..2579ee2eaf3 100644
--- a/src/compiler/types.ts
+++ b/src/compiler/types.ts
@@ -1817,7 +1817,7 @@ namespace ts {
kind: SyntaxKind.ModuleDeclaration;
parent?: ModuleBody | SourceFile;
name: ModuleName;
- body?: ModuleBody | JSDocNamespaceDeclaration | Identifier;
+ body?: ModuleBody | JSDocNamespaceDeclaration;
}
export type NamespaceBody = ModuleBlock | NamespaceDeclaration;
@@ -1842,6 +1842,11 @@ namespace ts {
export type ModuleReference = EntityName | ExternalModuleReference;
+ /**
+ * One of:
+ * - import x = require("mod");
+ * - import x = M.x;
+ */
export interface ImportEqualsDeclaration extends DeclarationStatement {
kind: SyntaxKind.ImportEqualsDeclaration;
parent?: SourceFile | ModuleBlock;
@@ -1893,7 +1898,6 @@ namespace ts {
export interface NamespaceExportDeclaration extends DeclarationStatement {
kind: SyntaxKind.NamespaceExportDeclaration;
name: Identifier;
- moduleReference: LiteralLikeNode;
}
export interface ExportDeclaration extends DeclarationStatement {