merge with master, accept baselines

This commit is contained in:
Vladimir Matveev
2015-03-17 18:23:43 -07:00
4031 changed files with 78799 additions and 62256 deletions
+3 -1
View File
@@ -30,7 +30,9 @@ var Board = (function () {
function Board() {
}
Board.prototype.allShipsSunk = function () {
return this.ships.every(function (val) { return val.isSunk; });
return this.ships.every(function (val) {
return val.isSunk;
});
};
return Board;
})();
+65 -62
View File
@@ -261,27 +261,28 @@ declare module "typescript" {
EnumDeclaration = 199,
ModuleDeclaration = 200,
ModuleBlock = 201,
ImportEqualsDeclaration = 202,
ImportDeclaration = 203,
ImportClause = 204,
NamespaceImport = 205,
NamedImports = 206,
ImportSpecifier = 207,
ExportAssignment = 208,
ExportDeclaration = 209,
NamedExports = 210,
ExportSpecifier = 211,
ExternalModuleReference = 212,
CaseClause = 213,
DefaultClause = 214,
HeritageClause = 215,
CatchClause = 216,
PropertyAssignment = 217,
ShorthandPropertyAssignment = 218,
EnumMember = 219,
SourceFile = 220,
SyntaxList = 221,
Count = 222,
CaseBlock = 202,
ImportEqualsDeclaration = 203,
ImportDeclaration = 204,
ImportClause = 205,
NamespaceImport = 206,
NamedImports = 207,
ImportSpecifier = 208,
ExportAssignment = 209,
ExportDeclaration = 210,
NamedExports = 211,
ExportSpecifier = 212,
ExternalModuleReference = 213,
CaseClause = 214,
DefaultClause = 215,
HeritageClause = 216,
CatchClause = 217,
PropertyAssignment = 218,
ShorthandPropertyAssignment = 219,
EnumMember = 220,
SourceFile = 221,
SyntaxList = 222,
Count = 223,
FirstAssignment = 52,
LastAssignment = 63,
FirstReservedWord = 65,
@@ -313,15 +314,16 @@ declare module "typescript" {
Private = 32,
Protected = 64,
Static = 128,
MultiLine = 256,
Synthetic = 512,
DeclarationFile = 1024,
Let = 2048,
Const = 4096,
OctalLiteral = 8192,
Modifier = 243,
Default = 256,
MultiLine = 512,
Synthetic = 1024,
DeclarationFile = 2048,
Let = 4096,
Const = 8192,
OctalLiteral = 16384,
Modifier = 499,
AccessibilityModifier = 112,
BlockScoped = 6144,
BlockScoped = 12288,
}
const enum ParserContextFlags {
StrictMode = 1,
@@ -449,7 +451,7 @@ declare module "typescript" {
body?: Block | Expression;
}
interface FunctionDeclaration extends FunctionLikeDeclaration, Statement {
name: Identifier;
name?: Identifier;
body?: Block;
}
interface MethodDeclaration extends FunctionLikeDeclaration, ClassElement, ObjectLiteralElement {
@@ -542,13 +544,18 @@ declare module "typescript" {
}
interface ConditionalExpression extends Expression {
condition: Expression;
questionToken: Node;
whenTrue: Expression;
colonToken: Node;
whenFalse: Expression;
}
interface FunctionExpression extends PrimaryExpression, FunctionLikeDeclaration {
name?: Identifier;
body: Block | Expression;
}
interface ArrowFunction extends Expression, FunctionLikeDeclaration {
equalsGreaterThanToken: Node;
}
interface LiteralExpression extends PrimaryExpression {
text: string;
isUnterminated?: boolean;
@@ -579,6 +586,7 @@ declare module "typescript" {
}
interface PropertyAccessExpression extends MemberExpression {
expression: LeftHandSideExpression;
dotToken: Node;
name: Identifier;
}
interface ElementAccessExpression extends MemberExpression {
@@ -652,6 +660,9 @@ declare module "typescript" {
}
interface SwitchStatement extends Statement {
expression: Expression;
caseBlock: CaseBlock;
}
interface CaseBlock extends Node {
clauses: NodeArray<CaseOrDefaultClause>;
}
interface CaseClause extends Node {
@@ -682,7 +693,7 @@ declare module "typescript" {
_moduleElementBrand: any;
}
interface ClassDeclaration extends Declaration, ModuleElement {
name: Identifier;
name?: Identifier;
typeParameters?: NodeArray<TypeParameterDeclaration>;
heritageClauses?: NodeArray<HeritageClause>;
members: NodeArray<ClassElement>;
@@ -712,10 +723,7 @@ declare module "typescript" {
name: Identifier;
members: NodeArray<EnumMember>;
}
interface ExportContainer {
exportStars?: ExportDeclaration[];
}
interface ModuleDeclaration extends Declaration, ModuleElement, ExportContainer {
interface ModuleDeclaration extends Declaration, ModuleElement {
name: Identifier | LiteralExpression;
body: ModuleBlock | ModuleDeclaration;
}
@@ -740,7 +748,7 @@ declare module "typescript" {
interface NamespaceImport extends Declaration {
name: Identifier;
}
interface ExportDeclaration extends Statement, ModuleElement {
interface ExportDeclaration extends Declaration, ModuleElement {
exportClause?: NamedExports;
moduleSpecifier?: Expression;
}
@@ -755,8 +763,10 @@ declare module "typescript" {
}
type ImportSpecifier = ImportOrExportSpecifier;
type ExportSpecifier = ImportOrExportSpecifier;
interface ExportAssignment extends Statement, ModuleElement {
exportName: Identifier;
interface ExportAssignment extends Declaration, ModuleElement {
isExportEquals?: boolean;
expression?: Expression;
type?: TypeNode;
}
interface FileReference extends TextRange {
fileName: string;
@@ -764,7 +774,7 @@ declare module "typescript" {
interface CommentRange extends TextRange {
hasTrailingNewLine?: boolean;
}
interface SourceFile extends Declaration, ExportContainer {
interface SourceFile extends Declaration {
statements: NodeArray<ModuleElement>;
endOfFileToken: Node;
fileName: string;
@@ -927,10 +937,10 @@ declare module "typescript" {
errorModuleName?: string;
}
interface EmitResolver {
getGeneratedNameForNode(node: ModuleDeclaration | EnumDeclaration | ImportDeclaration | ExportDeclaration): string;
getGeneratedNameForNode(node: Node): string;
getExpressionNameSubstitution(node: Identifier): string;
getExportAssignmentName(node: SourceFile): string;
isReferencedImportDeclaration(node: Node): boolean;
hasExportDefaultValue(node: SourceFile): boolean;
isReferencedAliasDeclaration(node: Node): boolean;
isTopLevelValueImportEqualsWithEntityName(node: ImportEqualsDeclaration): boolean;
getNodeCheckFlags(node: Node): NodeCheckFlags;
isDeclarationVisible(node: Declaration): boolean;
@@ -967,13 +977,14 @@ declare module "typescript" {
ExportValue = 1048576,
ExportType = 2097152,
ExportNamespace = 4194304,
Import = 8388608,
Alias = 8388608,
Instantiated = 16777216,
Merged = 33554432,
Transient = 67108864,
Prototype = 134217728,
UnionProperty = 268435456,
Optional = 536870912,
ExportStar = 1073741824,
Enum = 384,
Variable = 3,
Value = 107455,
@@ -998,7 +1009,7 @@ declare module "typescript" {
SetAccessorExcludes = 74687,
TypeParameterExcludes = 530912,
TypeAliasExcludes = 793056,
ImportExcludes = 8388608,
AliasExcludes = 8388608,
ModuleMember = 8914931,
ExportHasLocal = 944,
HasLocals = 255504,
@@ -1027,10 +1038,9 @@ declare module "typescript" {
declaredType?: Type;
mapper?: TypeMapper;
referenced?: boolean;
exportAssignmentChecked?: boolean;
exportAssignmentSymbol?: Symbol;
unionType?: UnionType;
resolvedExports?: SymbolTable;
exportsChecked?: boolean;
}
interface TransientSymbol extends Symbol, SymbolLinks {
}
@@ -1166,17 +1176,6 @@ declare module "typescript" {
interface TypeMapper {
(t: Type): Type;
}
interface TypeInferences {
primary: Type[];
secondary: Type[];
}
interface InferenceContext {
typeParameters: TypeParameter[];
inferUnionTypes: boolean;
inferences: TypeInferences[];
inferredTypes: Type[];
failedTypeParameterIndex?: number;
}
interface DiagnosticMessage {
key: string;
category: DiagnosticCategory;
@@ -1231,7 +1230,6 @@ declare module "typescript" {
target?: ScriptTarget;
version?: boolean;
watch?: boolean;
stripInternal?: boolean;
[option: string]: string | number | boolean;
}
const enum ModuleKind {
@@ -1472,13 +1470,16 @@ declare module "typescript" {
function createTypeChecker(host: TypeCheckerHost, produceDiagnostics: boolean): TypeChecker;
}
declare module "typescript" {
/** The version of the TypeScript compiler release */
let version: string;
function createCompilerHost(options: CompilerOptions): CompilerHost;
function getPreEmitDiagnostics(program: Program): Diagnostic[];
function flattenDiagnosticMessageText(messageText: string | DiagnosticMessageChain, newLine: string): string;
function createProgram(rootNames: string[], options: CompilerOptions, host?: CompilerHost): Program;
}
declare module "typescript" {
var servicesVersion: string;
/** The version of the language service API */
let servicesVersion: string;
interface Node {
getSourceFile(): SourceFile;
getChildCount(sourceFile?: SourceFile): number;
@@ -1965,7 +1966,7 @@ declare module "typescript" {
throwIfCancellationRequested(): void;
}
function createLanguageServiceSourceFile(fileName: string, scriptSnapshot: IScriptSnapshot, scriptTarget: ScriptTarget, version: string, setNodeParents: boolean): SourceFile;
var disableIncrementalParsing: boolean;
let disableIncrementalParsing: boolean;
function updateLanguageServiceSourceFile(sourceFile: SourceFile, scriptSnapshot: IScriptSnapshot, version: string, textChangeRange: TextChangeRange, aggressiveChecks?: boolean): SourceFile;
function createDocumentRegistry(): DocumentRegistry;
function preProcessFile(sourceText: string, readImportFiles?: boolean): PreProcessedFileInfo;
@@ -2001,6 +2002,8 @@ function compile(fileNames, options) {
}
exports.compile = compile;
compile(process.argv.slice(2), {
noEmitOnError: true, noImplicitAny: true,
target: 1 /* ES5 */, module: 1 /* CommonJS */
noEmitOnError: true,
noImplicitAny: true,
target: 1 /* ES5 */,
module: 1 /* CommonJS */
});
+107 -108
View File
@@ -801,67 +801,70 @@ declare module "typescript" {
ModuleBlock = 201,␍
>ModuleBlock : SyntaxKind
ImportEqualsDeclaration = 202,␍
CaseBlock = 202,␍
>CaseBlock : SyntaxKind
ImportEqualsDeclaration = 203,␍
>ImportEqualsDeclaration : SyntaxKind
ImportDeclaration = 203,␍
ImportDeclaration = 204,␍
>ImportDeclaration : SyntaxKind
ImportClause = 204,␍
ImportClause = 205,␍
>ImportClause : SyntaxKind
NamespaceImport = 205,␍
NamespaceImport = 206,␍
>NamespaceImport : SyntaxKind
NamedImports = 206,␍
NamedImports = 207,␍
>NamedImports : SyntaxKind
ImportSpecifier = 207,␍
ImportSpecifier = 208,␍
>ImportSpecifier : SyntaxKind
ExportAssignment = 208,␍
ExportAssignment = 209,␍
>ExportAssignment : SyntaxKind
ExportDeclaration = 209,␍
ExportDeclaration = 210,␍
>ExportDeclaration : SyntaxKind
NamedExports = 210,␍
NamedExports = 211,␍
>NamedExports : SyntaxKind
ExportSpecifier = 211,␍
ExportSpecifier = 212,␍
>ExportSpecifier : SyntaxKind
ExternalModuleReference = 212,␍
ExternalModuleReference = 213,␍
>ExternalModuleReference : SyntaxKind
CaseClause = 213,␍
CaseClause = 214,␍
>CaseClause : SyntaxKind
DefaultClause = 214,␍
DefaultClause = 215,␍
>DefaultClause : SyntaxKind
HeritageClause = 215,␍
HeritageClause = 216,␍
>HeritageClause : SyntaxKind
CatchClause = 216,␍
CatchClause = 217,␍
>CatchClause : SyntaxKind
PropertyAssignment = 217,␍
PropertyAssignment = 218,␍
>PropertyAssignment : SyntaxKind
ShorthandPropertyAssignment = 218,␍
ShorthandPropertyAssignment = 219,␍
>ShorthandPropertyAssignment : SyntaxKind
EnumMember = 219,␍
EnumMember = 220,␍
>EnumMember : SyntaxKind
SourceFile = 220,␍
SourceFile = 221,␍
>SourceFile : SyntaxKind
SyntaxList = 221,␍
SyntaxList = 222,␍
>SyntaxList : SyntaxKind
Count = 222,␍
Count = 223,␍
>Count : SyntaxKind
FirstAssignment = 52,␍
@@ -954,31 +957,34 @@ declare module "typescript" {
Static = 128,␍
>Static : NodeFlags
MultiLine = 256,␍
Default = 256,␍
>Default : NodeFlags
MultiLine = 512,␍
>MultiLine : NodeFlags
Synthetic = 512,␍
Synthetic = 1024,␍
>Synthetic : NodeFlags
DeclarationFile = 1024,␍
DeclarationFile = 2048,␍
>DeclarationFile : NodeFlags
Let = 2048,␍
Let = 4096,␍
>Let : NodeFlags
Const = 4096,␍
Const = 8192,␍
>Const : NodeFlags
OctalLiteral = 8192,␍
OctalLiteral = 16384,␍
>OctalLiteral : NodeFlags
Modifier = 243,␍
Modifier = 499,␍
>Modifier : NodeFlags
AccessibilityModifier = 112,␍
>AccessibilityModifier : NodeFlags
BlockScoped = 6144,␍
BlockScoped = 12288,␍
>BlockScoped : NodeFlags
}␍
const enum ParserContextFlags {␍
@@ -1370,7 +1376,7 @@ declare module "typescript" {
>FunctionLikeDeclaration : FunctionLikeDeclaration
>Statement : Statement
name: Identifier;␍
name?: Identifier;␍
>name : Identifier
>Identifier : Identifier
@@ -1633,10 +1639,18 @@ declare module "typescript" {
>condition : Expression
>Expression : Expression
questionToken: Node;␍
>questionToken : Node
>Node : Node
whenTrue: Expression;␍
>whenTrue : Expression
>Expression : Expression
colonToken: Node;␍
>colonToken : Node
>Node : Node
whenFalse: Expression;␍
>whenFalse : Expression
>Expression : Expression
@@ -1654,6 +1668,15 @@ declare module "typescript" {
>body : Expression | Block
>Block : Block
>Expression : Expression
}␍
interface ArrowFunction extends Expression, FunctionLikeDeclaration {␍
>ArrowFunction : ArrowFunction
>Expression : Expression
>FunctionLikeDeclaration : FunctionLikeDeclaration
equalsGreaterThanToken: Node;␍
>equalsGreaterThanToken : Node
>Node : Node
}␍
interface LiteralExpression extends PrimaryExpression {␍
>LiteralExpression : LiteralExpression
@@ -1743,6 +1766,10 @@ declare module "typescript" {
>expression : LeftHandSideExpression
>LeftHandSideExpression : LeftHandSideExpression
dotToken: Node;␍
>dotToken : Node
>Node : Node
name: Identifier;␍
>name : Identifier
>Identifier : Identifier
@@ -1965,6 +1992,14 @@ declare module "typescript" {
>expression : Expression
>Expression : Expression
caseBlock: CaseBlock;␍
>caseBlock : CaseBlock
>CaseBlock : CaseBlock
}␍
interface CaseBlock extends Node {␍
>CaseBlock : CaseBlock
>Node : Node
clauses: NodeArray<CaseOrDefaultClause>;␍
>clauses : NodeArray<CaseClause | DefaultClause>
>NodeArray : NodeArray<T>
@@ -2057,7 +2092,7 @@ declare module "typescript" {
>Declaration : Declaration
>ModuleElement : ModuleElement
name: Identifier;␍
name?: Identifier;␍
>name : Identifier
>Identifier : Identifier
@@ -2159,18 +2194,10 @@ declare module "typescript" {
>NodeArray : NodeArray<T>
>EnumMember : EnumMember
}␍
interface ExportContainer {␍
>ExportContainer : ExportContainer
exportStars?: ExportDeclaration[];␍
>exportStars : ExportDeclaration[]
>ExportDeclaration : ExportDeclaration
}␍
interface ModuleDeclaration extends Declaration, ModuleElement, ExportContainer {␍
interface ModuleDeclaration extends Declaration, ModuleElement {␍
>ModuleDeclaration : ModuleDeclaration
>Declaration : Declaration
>ModuleElement : ModuleElement
>ExportContainer : ExportContainer
name: Identifier | LiteralExpression;␍
>name : Identifier | LiteralExpression
@@ -2248,9 +2275,9 @@ declare module "typescript" {
>name : Identifier
>Identifier : Identifier
}␍
interface ExportDeclaration extends Statement, ModuleElement {␍
interface ExportDeclaration extends Declaration, ModuleElement {␍
>ExportDeclaration : ExportDeclaration
>Statement : Statement
>Declaration : Declaration
>ModuleElement : ModuleElement
exportClause?: NamedExports;␍
@@ -2298,14 +2325,21 @@ declare module "typescript" {
>ExportSpecifier : ImportOrExportSpecifier
>ImportOrExportSpecifier : ImportOrExportSpecifier
interface ExportAssignment extends Statement, ModuleElement {␍
interface ExportAssignment extends Declaration, ModuleElement {␍
>ExportAssignment : ExportAssignment
>Statement : Statement
>Declaration : Declaration
>ModuleElement : ModuleElement
exportName: Identifier;␍
>exportName : Identifier
>Identifier : Identifier
isExportEquals?: boolean;␍
>isExportEquals : boolean
expression?: Expression;␍
>expression : Expression
>Expression : Expression
type?: TypeNode;␍
>type : TypeNode
>TypeNode : TypeNode
}␍
interface FileReference extends TextRange {␍
>FileReference : FileReference
@@ -2321,10 +2355,9 @@ declare module "typescript" {
hasTrailingNewLine?: boolean;␍
>hasTrailingNewLine : boolean
}␍
interface SourceFile extends Declaration, ExportContainer {␍
interface SourceFile extends Declaration {␍
>SourceFile : SourceFile
>Declaration : Declaration
>ExportContainer : ExportContainer
statements: NodeArray<ModuleElement>;␍
>statements : NodeArray<ModuleElement>
@@ -2965,26 +2998,23 @@ declare module "typescript" {
interface EmitResolver {␍
>EmitResolver : EmitResolver
getGeneratedNameForNode(node: ModuleDeclaration | EnumDeclaration | ImportDeclaration | ExportDeclaration): string;␍
>getGeneratedNameForNode : (node: EnumDeclaration | ExportDeclaration | ModuleDeclaration | ImportDeclaration) => string
>node : EnumDeclaration | ExportDeclaration | ModuleDeclaration | ImportDeclaration
>ModuleDeclaration : ModuleDeclaration
>EnumDeclaration : EnumDeclaration
>ImportDeclaration : ImportDeclaration
>ExportDeclaration : ExportDeclaration
getGeneratedNameForNode(node: Node): string;␍
>getGeneratedNameForNode : (node: Node) => string
>node : Node
>Node : Node
getExpressionNameSubstitution(node: Identifier): string;␍
>getExpressionNameSubstitution : (node: Identifier) => string
>node : Identifier
>Identifier : Identifier
getExportAssignmentName(node: SourceFile): string;␍
>getExportAssignmentName : (node: SourceFile) => string
hasExportDefaultValue(node: SourceFile): boolean;␍
>hasExportDefaultValue : (node: SourceFile) => boolean
>node : SourceFile
>SourceFile : SourceFile
isReferencedImportDeclaration(node: Node): boolean;␍
>isReferencedImportDeclaration : (node: Node) => boolean
isReferencedAliasDeclaration(node: Node): boolean;␍
>isReferencedAliasDeclaration : (node: Node) => boolean
>node : Node
>Node : Node
@@ -3140,8 +3170,8 @@ declare module "typescript" {
ExportNamespace = 4194304,␍
>ExportNamespace : SymbolFlags
Import = 8388608,␍
>Import : SymbolFlags
Alias = 8388608,␍
>Alias : SymbolFlags
Instantiated = 16777216,␍
>Instantiated : SymbolFlags
@@ -3161,6 +3191,9 @@ declare module "typescript" {
Optional = 536870912,␍
>Optional : SymbolFlags
ExportStar = 1073741824,␍
>ExportStar : SymbolFlags
Enum = 384,␍
>Enum : SymbolFlags
@@ -3233,8 +3266,8 @@ declare module "typescript" {
TypeAliasExcludes = 793056,␍
>TypeAliasExcludes : SymbolFlags
ImportExcludes = 8388608,␍
>ImportExcludes : SymbolFlags
AliasExcludes = 8388608,␍
>AliasExcludes : SymbolFlags
ModuleMember = 8914931,␍
>ModuleMember : SymbolFlags
@@ -3325,13 +3358,6 @@ declare module "typescript" {
referenced?: boolean;␍
>referenced : boolean
exportAssignmentChecked?: boolean;␍
>exportAssignmentChecked : boolean
exportAssignmentSymbol?: Symbol;␍
>exportAssignmentSymbol : Symbol
>Symbol : Symbol
unionType?: UnionType;␍
>unionType : UnionType
>UnionType : UnionType
@@ -3339,6 +3365,9 @@ declare module "typescript" {
resolvedExports?: SymbolTable;␍
>resolvedExports : SymbolTable
>SymbolTable : SymbolTable
exportsChecked?: boolean;␍
>exportsChecked : boolean
}␍
interface TransientSymbol extends Symbol, SymbolLinks {␍
>TransientSymbol : TransientSymbol
@@ -3740,38 +3769,6 @@ declare module "typescript" {
>t : Type
>Type : Type
>Type : Type
}␍
interface TypeInferences {␍
>TypeInferences : TypeInferences
primary: Type[];␍
>primary : Type[]
>Type : Type
secondary: Type[];␍
>secondary : Type[]
>Type : Type
}␍
interface InferenceContext {␍
>InferenceContext : InferenceContext
typeParameters: TypeParameter[];␍
>typeParameters : TypeParameter[]
>TypeParameter : TypeParameter
inferUnionTypes: boolean;␍
>inferUnionTypes : boolean
inferences: TypeInferences[];␍
>inferences : TypeInferences[]
>TypeInferences : TypeInferences
inferredTypes: Type[];␍
>inferredTypes : Type[]
>Type : Type
failedTypeParameterIndex?: number;␍
>failedTypeParameterIndex : number
}␍
interface DiagnosticMessage {␍
>DiagnosticMessage : DiagnosticMessage
@@ -3931,9 +3928,6 @@ declare module "typescript" {
watch?: boolean;␍
>watch : boolean
stripInternal?: boolean;␍
>stripInternal : boolean
[option: string]: string | number | boolean;␍
>option : string
}␍
@@ -4716,6 +4710,10 @@ declare module "typescript" {
>TypeChecker : TypeChecker
}␍
declare module "typescript" {␍
/** The version of the TypeScript compiler release */␍
let version: string;␍
>version : string
function createCompilerHost(options: CompilerOptions): CompilerHost;␍
>createCompilerHost : (options: CompilerOptions) => CompilerHost
>options : CompilerOptions
@@ -4744,7 +4742,8 @@ declare module "typescript" {
>Program : Program
}␍
declare module "typescript" {␍
var servicesVersion: string;␍
/** The version of the language service API */␍
let servicesVersion: string;␍
>servicesVersion : string
interface Node {␍
@@ -6094,7 +6093,7 @@ declare module "typescript" {
>setNodeParents : boolean
>SourceFile : SourceFile
var disableIncrementalParsing: boolean;␍
let disableIncrementalParsing: boolean;␍
>disableIncrementalParsing : boolean
function updateLanguageServiceSourceFile(sourceFile: SourceFile, scriptSnapshot: IScriptSnapshot, version: string, textChangeRange: TextChangeRange, aggressiveChecks?: boolean): SourceFile;␍
+62 -62
View File
@@ -292,27 +292,28 @@ declare module "typescript" {
EnumDeclaration = 199,
ModuleDeclaration = 200,
ModuleBlock = 201,
ImportEqualsDeclaration = 202,
ImportDeclaration = 203,
ImportClause = 204,
NamespaceImport = 205,
NamedImports = 206,
ImportSpecifier = 207,
ExportAssignment = 208,
ExportDeclaration = 209,
NamedExports = 210,
ExportSpecifier = 211,
ExternalModuleReference = 212,
CaseClause = 213,
DefaultClause = 214,
HeritageClause = 215,
CatchClause = 216,
PropertyAssignment = 217,
ShorthandPropertyAssignment = 218,
EnumMember = 219,
SourceFile = 220,
SyntaxList = 221,
Count = 222,
CaseBlock = 202,
ImportEqualsDeclaration = 203,
ImportDeclaration = 204,
ImportClause = 205,
NamespaceImport = 206,
NamedImports = 207,
ImportSpecifier = 208,
ExportAssignment = 209,
ExportDeclaration = 210,
NamedExports = 211,
ExportSpecifier = 212,
ExternalModuleReference = 213,
CaseClause = 214,
DefaultClause = 215,
HeritageClause = 216,
CatchClause = 217,
PropertyAssignment = 218,
ShorthandPropertyAssignment = 219,
EnumMember = 220,
SourceFile = 221,
SyntaxList = 222,
Count = 223,
FirstAssignment = 52,
LastAssignment = 63,
FirstReservedWord = 65,
@@ -344,15 +345,16 @@ declare module "typescript" {
Private = 32,
Protected = 64,
Static = 128,
MultiLine = 256,
Synthetic = 512,
DeclarationFile = 1024,
Let = 2048,
Const = 4096,
OctalLiteral = 8192,
Modifier = 243,
Default = 256,
MultiLine = 512,
Synthetic = 1024,
DeclarationFile = 2048,
Let = 4096,
Const = 8192,
OctalLiteral = 16384,
Modifier = 499,
AccessibilityModifier = 112,
BlockScoped = 6144,
BlockScoped = 12288,
}
const enum ParserContextFlags {
StrictMode = 1,
@@ -480,7 +482,7 @@ declare module "typescript" {
body?: Block | Expression;
}
interface FunctionDeclaration extends FunctionLikeDeclaration, Statement {
name: Identifier;
name?: Identifier;
body?: Block;
}
interface MethodDeclaration extends FunctionLikeDeclaration, ClassElement, ObjectLiteralElement {
@@ -573,13 +575,18 @@ declare module "typescript" {
}
interface ConditionalExpression extends Expression {
condition: Expression;
questionToken: Node;
whenTrue: Expression;
colonToken: Node;
whenFalse: Expression;
}
interface FunctionExpression extends PrimaryExpression, FunctionLikeDeclaration {
name?: Identifier;
body: Block | Expression;
}
interface ArrowFunction extends Expression, FunctionLikeDeclaration {
equalsGreaterThanToken: Node;
}
interface LiteralExpression extends PrimaryExpression {
text: string;
isUnterminated?: boolean;
@@ -610,6 +617,7 @@ declare module "typescript" {
}
interface PropertyAccessExpression extends MemberExpression {
expression: LeftHandSideExpression;
dotToken: Node;
name: Identifier;
}
interface ElementAccessExpression extends MemberExpression {
@@ -683,6 +691,9 @@ declare module "typescript" {
}
interface SwitchStatement extends Statement {
expression: Expression;
caseBlock: CaseBlock;
}
interface CaseBlock extends Node {
clauses: NodeArray<CaseOrDefaultClause>;
}
interface CaseClause extends Node {
@@ -713,7 +724,7 @@ declare module "typescript" {
_moduleElementBrand: any;
}
interface ClassDeclaration extends Declaration, ModuleElement {
name: Identifier;
name?: Identifier;
typeParameters?: NodeArray<TypeParameterDeclaration>;
heritageClauses?: NodeArray<HeritageClause>;
members: NodeArray<ClassElement>;
@@ -743,10 +754,7 @@ declare module "typescript" {
name: Identifier;
members: NodeArray<EnumMember>;
}
interface ExportContainer {
exportStars?: ExportDeclaration[];
}
interface ModuleDeclaration extends Declaration, ModuleElement, ExportContainer {
interface ModuleDeclaration extends Declaration, ModuleElement {
name: Identifier | LiteralExpression;
body: ModuleBlock | ModuleDeclaration;
}
@@ -771,7 +779,7 @@ declare module "typescript" {
interface NamespaceImport extends Declaration {
name: Identifier;
}
interface ExportDeclaration extends Statement, ModuleElement {
interface ExportDeclaration extends Declaration, ModuleElement {
exportClause?: NamedExports;
moduleSpecifier?: Expression;
}
@@ -786,8 +794,10 @@ declare module "typescript" {
}
type ImportSpecifier = ImportOrExportSpecifier;
type ExportSpecifier = ImportOrExportSpecifier;
interface ExportAssignment extends Statement, ModuleElement {
exportName: Identifier;
interface ExportAssignment extends Declaration, ModuleElement {
isExportEquals?: boolean;
expression?: Expression;
type?: TypeNode;
}
interface FileReference extends TextRange {
fileName: string;
@@ -795,7 +805,7 @@ declare module "typescript" {
interface CommentRange extends TextRange {
hasTrailingNewLine?: boolean;
}
interface SourceFile extends Declaration, ExportContainer {
interface SourceFile extends Declaration {
statements: NodeArray<ModuleElement>;
endOfFileToken: Node;
fileName: string;
@@ -958,10 +968,10 @@ declare module "typescript" {
errorModuleName?: string;
}
interface EmitResolver {
getGeneratedNameForNode(node: ModuleDeclaration | EnumDeclaration | ImportDeclaration | ExportDeclaration): string;
getGeneratedNameForNode(node: Node): string;
getExpressionNameSubstitution(node: Identifier): string;
getExportAssignmentName(node: SourceFile): string;
isReferencedImportDeclaration(node: Node): boolean;
hasExportDefaultValue(node: SourceFile): boolean;
isReferencedAliasDeclaration(node: Node): boolean;
isTopLevelValueImportEqualsWithEntityName(node: ImportEqualsDeclaration): boolean;
getNodeCheckFlags(node: Node): NodeCheckFlags;
isDeclarationVisible(node: Declaration): boolean;
@@ -998,13 +1008,14 @@ declare module "typescript" {
ExportValue = 1048576,
ExportType = 2097152,
ExportNamespace = 4194304,
Import = 8388608,
Alias = 8388608,
Instantiated = 16777216,
Merged = 33554432,
Transient = 67108864,
Prototype = 134217728,
UnionProperty = 268435456,
Optional = 536870912,
ExportStar = 1073741824,
Enum = 384,
Variable = 3,
Value = 107455,
@@ -1029,7 +1040,7 @@ declare module "typescript" {
SetAccessorExcludes = 74687,
TypeParameterExcludes = 530912,
TypeAliasExcludes = 793056,
ImportExcludes = 8388608,
AliasExcludes = 8388608,
ModuleMember = 8914931,
ExportHasLocal = 944,
HasLocals = 255504,
@@ -1058,10 +1069,9 @@ declare module "typescript" {
declaredType?: Type;
mapper?: TypeMapper;
referenced?: boolean;
exportAssignmentChecked?: boolean;
exportAssignmentSymbol?: Symbol;
unionType?: UnionType;
resolvedExports?: SymbolTable;
exportsChecked?: boolean;
}
interface TransientSymbol extends Symbol, SymbolLinks {
}
@@ -1197,17 +1207,6 @@ declare module "typescript" {
interface TypeMapper {
(t: Type): Type;
}
interface TypeInferences {
primary: Type[];
secondary: Type[];
}
interface InferenceContext {
typeParameters: TypeParameter[];
inferUnionTypes: boolean;
inferences: TypeInferences[];
inferredTypes: Type[];
failedTypeParameterIndex?: number;
}
interface DiagnosticMessage {
key: string;
category: DiagnosticCategory;
@@ -1262,7 +1261,6 @@ declare module "typescript" {
target?: ScriptTarget;
version?: boolean;
watch?: boolean;
stripInternal?: boolean;
[option: string]: string | number | boolean;
}
const enum ModuleKind {
@@ -1503,13 +1501,16 @@ declare module "typescript" {
function createTypeChecker(host: TypeCheckerHost, produceDiagnostics: boolean): TypeChecker;
}
declare module "typescript" {
/** The version of the TypeScript compiler release */
let version: string;
function createCompilerHost(options: CompilerOptions): CompilerHost;
function getPreEmitDiagnostics(program: Program): Diagnostic[];
function flattenDiagnosticMessageText(messageText: string | DiagnosticMessageChain, newLine: string): string;
function createProgram(rootNames: string[], options: CompilerOptions, host?: CompilerHost): Program;
}
declare module "typescript" {
var servicesVersion: string;
/** The version of the language service API */
let servicesVersion: string;
interface Node {
getSourceFile(): SourceFile;
getChildCount(sourceFile?: SourceFile): number;
@@ -1996,7 +1997,7 @@ declare module "typescript" {
throwIfCancellationRequested(): void;
}
function createLanguageServiceSourceFile(fileName: string, scriptSnapshot: IScriptSnapshot, scriptTarget: ScriptTarget, version: string, setNodeParents: boolean): SourceFile;
var disableIncrementalParsing: boolean;
let disableIncrementalParsing: boolean;
function updateLanguageServiceSourceFile(sourceFile: SourceFile, scriptSnapshot: IScriptSnapshot, version: string, textChangeRange: TextChangeRange, aggressiveChecks?: boolean): SourceFile;
function createDocumentRegistry(): DocumentRegistry;
function preProcessFile(sourceText: string, readImportFiles?: boolean): PreProcessedFileInfo;
@@ -2035,8 +2036,7 @@ function delint(sourceFile) {
if (ifStatement.thenStatement.kind !== 174 /* Block */) {
report(ifStatement.thenStatement, "An if statement's contents should be wrapped in a block body.");
}
if (ifStatement.elseStatement &&
ifStatement.elseStatement.kind !== 174 /* Block */ && ifStatement.elseStatement.kind !== 178 /* IfStatement */) {
if (ifStatement.elseStatement && ifStatement.elseStatement.kind !== 174 /* Block */ && ifStatement.elseStatement.kind !== 178 /* IfStatement */) {
report(ifStatement.elseStatement, "An else statement's contents should be wrapped in a block body.");
}
break;
+107 -108
View File
@@ -947,67 +947,70 @@ declare module "typescript" {
ModuleBlock = 201,␍
>ModuleBlock : SyntaxKind
ImportEqualsDeclaration = 202,␍
CaseBlock = 202,␍
>CaseBlock : SyntaxKind
ImportEqualsDeclaration = 203,␍
>ImportEqualsDeclaration : SyntaxKind
ImportDeclaration = 203,␍
ImportDeclaration = 204,␍
>ImportDeclaration : SyntaxKind
ImportClause = 204,␍
ImportClause = 205,␍
>ImportClause : SyntaxKind
NamespaceImport = 205,␍
NamespaceImport = 206,␍
>NamespaceImport : SyntaxKind
NamedImports = 206,␍
NamedImports = 207,␍
>NamedImports : SyntaxKind
ImportSpecifier = 207,␍
ImportSpecifier = 208,␍
>ImportSpecifier : SyntaxKind
ExportAssignment = 208,␍
ExportAssignment = 209,␍
>ExportAssignment : SyntaxKind
ExportDeclaration = 209,␍
ExportDeclaration = 210,␍
>ExportDeclaration : SyntaxKind
NamedExports = 210,␍
NamedExports = 211,␍
>NamedExports : SyntaxKind
ExportSpecifier = 211,␍
ExportSpecifier = 212,␍
>ExportSpecifier : SyntaxKind
ExternalModuleReference = 212,␍
ExternalModuleReference = 213,␍
>ExternalModuleReference : SyntaxKind
CaseClause = 213,␍
CaseClause = 214,␍
>CaseClause : SyntaxKind
DefaultClause = 214,␍
DefaultClause = 215,␍
>DefaultClause : SyntaxKind
HeritageClause = 215,␍
HeritageClause = 216,␍
>HeritageClause : SyntaxKind
CatchClause = 216,␍
CatchClause = 217,␍
>CatchClause : SyntaxKind
PropertyAssignment = 217,␍
PropertyAssignment = 218,␍
>PropertyAssignment : SyntaxKind
ShorthandPropertyAssignment = 218,␍
ShorthandPropertyAssignment = 219,␍
>ShorthandPropertyAssignment : SyntaxKind
EnumMember = 219,␍
EnumMember = 220,␍
>EnumMember : SyntaxKind
SourceFile = 220,␍
SourceFile = 221,␍
>SourceFile : SyntaxKind
SyntaxList = 221,␍
SyntaxList = 222,␍
>SyntaxList : SyntaxKind
Count = 222,␍
Count = 223,␍
>Count : SyntaxKind
FirstAssignment = 52,␍
@@ -1100,31 +1103,34 @@ declare module "typescript" {
Static = 128,␍
>Static : NodeFlags
MultiLine = 256,␍
Default = 256,␍
>Default : NodeFlags
MultiLine = 512,␍
>MultiLine : NodeFlags
Synthetic = 512,␍
Synthetic = 1024,␍
>Synthetic : NodeFlags
DeclarationFile = 1024,␍
DeclarationFile = 2048,␍
>DeclarationFile : NodeFlags
Let = 2048,␍
Let = 4096,␍
>Let : NodeFlags
Const = 4096,␍
Const = 8192,␍
>Const : NodeFlags
OctalLiteral = 8192,␍
OctalLiteral = 16384,␍
>OctalLiteral : NodeFlags
Modifier = 243,␍
Modifier = 499,␍
>Modifier : NodeFlags
AccessibilityModifier = 112,␍
>AccessibilityModifier : NodeFlags
BlockScoped = 6144,␍
BlockScoped = 12288,␍
>BlockScoped : NodeFlags
}␍
const enum ParserContextFlags {␍
@@ -1516,7 +1522,7 @@ declare module "typescript" {
>FunctionLikeDeclaration : FunctionLikeDeclaration
>Statement : Statement
name: Identifier;␍
name?: Identifier;␍
>name : Identifier
>Identifier : Identifier
@@ -1779,10 +1785,18 @@ declare module "typescript" {
>condition : Expression
>Expression : Expression
questionToken: Node;␍
>questionToken : Node
>Node : Node
whenTrue: Expression;␍
>whenTrue : Expression
>Expression : Expression
colonToken: Node;␍
>colonToken : Node
>Node : Node
whenFalse: Expression;␍
>whenFalse : Expression
>Expression : Expression
@@ -1800,6 +1814,15 @@ declare module "typescript" {
>body : Expression | Block
>Block : Block
>Expression : Expression
}␍
interface ArrowFunction extends Expression, FunctionLikeDeclaration {␍
>ArrowFunction : ArrowFunction
>Expression : Expression
>FunctionLikeDeclaration : FunctionLikeDeclaration
equalsGreaterThanToken: Node;␍
>equalsGreaterThanToken : Node
>Node : Node
}␍
interface LiteralExpression extends PrimaryExpression {␍
>LiteralExpression : LiteralExpression
@@ -1889,6 +1912,10 @@ declare module "typescript" {
>expression : LeftHandSideExpression
>LeftHandSideExpression : LeftHandSideExpression
dotToken: Node;␍
>dotToken : Node
>Node : Node
name: Identifier;␍
>name : Identifier
>Identifier : Identifier
@@ -2111,6 +2138,14 @@ declare module "typescript" {
>expression : Expression
>Expression : Expression
caseBlock: CaseBlock;␍
>caseBlock : CaseBlock
>CaseBlock : CaseBlock
}␍
interface CaseBlock extends Node {␍
>CaseBlock : CaseBlock
>Node : Node
clauses: NodeArray<CaseOrDefaultClause>;␍
>clauses : NodeArray<CaseClause | DefaultClause>
>NodeArray : NodeArray<T>
@@ -2203,7 +2238,7 @@ declare module "typescript" {
>Declaration : Declaration
>ModuleElement : ModuleElement
name: Identifier;␍
name?: Identifier;␍
>name : Identifier
>Identifier : Identifier
@@ -2305,18 +2340,10 @@ declare module "typescript" {
>NodeArray : NodeArray<T>
>EnumMember : EnumMember
}␍
interface ExportContainer {␍
>ExportContainer : ExportContainer
exportStars?: ExportDeclaration[];␍
>exportStars : ExportDeclaration[]
>ExportDeclaration : ExportDeclaration
}␍
interface ModuleDeclaration extends Declaration, ModuleElement, ExportContainer {␍
interface ModuleDeclaration extends Declaration, ModuleElement {␍
>ModuleDeclaration : ModuleDeclaration
>Declaration : Declaration
>ModuleElement : ModuleElement
>ExportContainer : ExportContainer
name: Identifier | LiteralExpression;␍
>name : Identifier | LiteralExpression
@@ -2394,9 +2421,9 @@ declare module "typescript" {
>name : Identifier
>Identifier : Identifier
}␍
interface ExportDeclaration extends Statement, ModuleElement {␍
interface ExportDeclaration extends Declaration, ModuleElement {␍
>ExportDeclaration : ExportDeclaration
>Statement : Statement
>Declaration : Declaration
>ModuleElement : ModuleElement
exportClause?: NamedExports;␍
@@ -2444,14 +2471,21 @@ declare module "typescript" {
>ExportSpecifier : ImportOrExportSpecifier
>ImportOrExportSpecifier : ImportOrExportSpecifier
interface ExportAssignment extends Statement, ModuleElement {␍
interface ExportAssignment extends Declaration, ModuleElement {␍
>ExportAssignment : ExportAssignment
>Statement : Statement
>Declaration : Declaration
>ModuleElement : ModuleElement
exportName: Identifier;␍
>exportName : Identifier
>Identifier : Identifier
isExportEquals?: boolean;␍
>isExportEquals : boolean
expression?: Expression;␍
>expression : Expression
>Expression : Expression
type?: TypeNode;␍
>type : TypeNode
>TypeNode : TypeNode
}␍
interface FileReference extends TextRange {␍
>FileReference : FileReference
@@ -2467,10 +2501,9 @@ declare module "typescript" {
hasTrailingNewLine?: boolean;␍
>hasTrailingNewLine : boolean
}␍
interface SourceFile extends Declaration, ExportContainer {␍
interface SourceFile extends Declaration {␍
>SourceFile : SourceFile
>Declaration : Declaration
>ExportContainer : ExportContainer
statements: NodeArray<ModuleElement>;␍
>statements : NodeArray<ModuleElement>
@@ -3111,26 +3144,23 @@ declare module "typescript" {
interface EmitResolver {␍
>EmitResolver : EmitResolver
getGeneratedNameForNode(node: ModuleDeclaration | EnumDeclaration | ImportDeclaration | ExportDeclaration): string;␍
>getGeneratedNameForNode : (node: EnumDeclaration | ExportDeclaration | ModuleDeclaration | ImportDeclaration) => string
>node : EnumDeclaration | ExportDeclaration | ModuleDeclaration | ImportDeclaration
>ModuleDeclaration : ModuleDeclaration
>EnumDeclaration : EnumDeclaration
>ImportDeclaration : ImportDeclaration
>ExportDeclaration : ExportDeclaration
getGeneratedNameForNode(node: Node): string;␍
>getGeneratedNameForNode : (node: Node) => string
>node : Node
>Node : Node
getExpressionNameSubstitution(node: Identifier): string;␍
>getExpressionNameSubstitution : (node: Identifier) => string
>node : Identifier
>Identifier : Identifier
getExportAssignmentName(node: SourceFile): string;␍
>getExportAssignmentName : (node: SourceFile) => string
hasExportDefaultValue(node: SourceFile): boolean;␍
>hasExportDefaultValue : (node: SourceFile) => boolean
>node : SourceFile
>SourceFile : SourceFile
isReferencedImportDeclaration(node: Node): boolean;␍
>isReferencedImportDeclaration : (node: Node) => boolean
isReferencedAliasDeclaration(node: Node): boolean;␍
>isReferencedAliasDeclaration : (node: Node) => boolean
>node : Node
>Node : Node
@@ -3286,8 +3316,8 @@ declare module "typescript" {
ExportNamespace = 4194304,␍
>ExportNamespace : SymbolFlags
Import = 8388608,␍
>Import : SymbolFlags
Alias = 8388608,␍
>Alias : SymbolFlags
Instantiated = 16777216,␍
>Instantiated : SymbolFlags
@@ -3307,6 +3337,9 @@ declare module "typescript" {
Optional = 536870912,␍
>Optional : SymbolFlags
ExportStar = 1073741824,␍
>ExportStar : SymbolFlags
Enum = 384,␍
>Enum : SymbolFlags
@@ -3379,8 +3412,8 @@ declare module "typescript" {
TypeAliasExcludes = 793056,␍
>TypeAliasExcludes : SymbolFlags
ImportExcludes = 8388608,␍
>ImportExcludes : SymbolFlags
AliasExcludes = 8388608,␍
>AliasExcludes : SymbolFlags
ModuleMember = 8914931,␍
>ModuleMember : SymbolFlags
@@ -3471,13 +3504,6 @@ declare module "typescript" {
referenced?: boolean;␍
>referenced : boolean
exportAssignmentChecked?: boolean;␍
>exportAssignmentChecked : boolean
exportAssignmentSymbol?: Symbol;␍
>exportAssignmentSymbol : Symbol
>Symbol : Symbol
unionType?: UnionType;␍
>unionType : UnionType
>UnionType : UnionType
@@ -3485,6 +3511,9 @@ declare module "typescript" {
resolvedExports?: SymbolTable;␍
>resolvedExports : SymbolTable
>SymbolTable : SymbolTable
exportsChecked?: boolean;␍
>exportsChecked : boolean
}␍
interface TransientSymbol extends Symbol, SymbolLinks {␍
>TransientSymbol : TransientSymbol
@@ -3886,38 +3915,6 @@ declare module "typescript" {
>t : Type
>Type : Type
>Type : Type
}␍
interface TypeInferences {␍
>TypeInferences : TypeInferences
primary: Type[];␍
>primary : Type[]
>Type : Type
secondary: Type[];␍
>secondary : Type[]
>Type : Type
}␍
interface InferenceContext {␍
>InferenceContext : InferenceContext
typeParameters: TypeParameter[];␍
>typeParameters : TypeParameter[]
>TypeParameter : TypeParameter
inferUnionTypes: boolean;␍
>inferUnionTypes : boolean
inferences: TypeInferences[];␍
>inferences : TypeInferences[]
>TypeInferences : TypeInferences
inferredTypes: Type[];␍
>inferredTypes : Type[]
>Type : Type
failedTypeParameterIndex?: number;␍
>failedTypeParameterIndex : number
}␍
interface DiagnosticMessage {␍
>DiagnosticMessage : DiagnosticMessage
@@ -4077,9 +4074,6 @@ declare module "typescript" {
watch?: boolean;␍
>watch : boolean
stripInternal?: boolean;␍
>stripInternal : boolean
[option: string]: string | number | boolean;␍
>option : string
}␍
@@ -4862,6 +4856,10 @@ declare module "typescript" {
>TypeChecker : TypeChecker
}␍
declare module "typescript" {␍
/** The version of the TypeScript compiler release */␍
let version: string;␍
>version : string
function createCompilerHost(options: CompilerOptions): CompilerHost;␍
>createCompilerHost : (options: CompilerOptions) => CompilerHost
>options : CompilerOptions
@@ -4890,7 +4888,8 @@ declare module "typescript" {
>Program : Program
}␍
declare module "typescript" {␍
var servicesVersion: string;␍
/** The version of the language service API */␍
let servicesVersion: string;␍
>servicesVersion : string
interface Node {␍
@@ -6240,7 +6239,7 @@ declare module "typescript" {
>setNodeParents : boolean
>SourceFile : SourceFile
var disableIncrementalParsing: boolean;␍
let disableIncrementalParsing: boolean;␍
>disableIncrementalParsing : boolean
function updateLanguageServiceSourceFile(sourceFile: SourceFile, scriptSnapshot: IScriptSnapshot, version: string, textChangeRange: TextChangeRange, aggressiveChecks?: boolean): SourceFile;␍
@@ -293,27 +293,28 @@ declare module "typescript" {
EnumDeclaration = 199,
ModuleDeclaration = 200,
ModuleBlock = 201,
ImportEqualsDeclaration = 202,
ImportDeclaration = 203,
ImportClause = 204,
NamespaceImport = 205,
NamedImports = 206,
ImportSpecifier = 207,
ExportAssignment = 208,
ExportDeclaration = 209,
NamedExports = 210,
ExportSpecifier = 211,
ExternalModuleReference = 212,
CaseClause = 213,
DefaultClause = 214,
HeritageClause = 215,
CatchClause = 216,
PropertyAssignment = 217,
ShorthandPropertyAssignment = 218,
EnumMember = 219,
SourceFile = 220,
SyntaxList = 221,
Count = 222,
CaseBlock = 202,
ImportEqualsDeclaration = 203,
ImportDeclaration = 204,
ImportClause = 205,
NamespaceImport = 206,
NamedImports = 207,
ImportSpecifier = 208,
ExportAssignment = 209,
ExportDeclaration = 210,
NamedExports = 211,
ExportSpecifier = 212,
ExternalModuleReference = 213,
CaseClause = 214,
DefaultClause = 215,
HeritageClause = 216,
CatchClause = 217,
PropertyAssignment = 218,
ShorthandPropertyAssignment = 219,
EnumMember = 220,
SourceFile = 221,
SyntaxList = 222,
Count = 223,
FirstAssignment = 52,
LastAssignment = 63,
FirstReservedWord = 65,
@@ -345,15 +346,16 @@ declare module "typescript" {
Private = 32,
Protected = 64,
Static = 128,
MultiLine = 256,
Synthetic = 512,
DeclarationFile = 1024,
Let = 2048,
Const = 4096,
OctalLiteral = 8192,
Modifier = 243,
Default = 256,
MultiLine = 512,
Synthetic = 1024,
DeclarationFile = 2048,
Let = 4096,
Const = 8192,
OctalLiteral = 16384,
Modifier = 499,
AccessibilityModifier = 112,
BlockScoped = 6144,
BlockScoped = 12288,
}
const enum ParserContextFlags {
StrictMode = 1,
@@ -481,7 +483,7 @@ declare module "typescript" {
body?: Block | Expression;
}
interface FunctionDeclaration extends FunctionLikeDeclaration, Statement {
name: Identifier;
name?: Identifier;
body?: Block;
}
interface MethodDeclaration extends FunctionLikeDeclaration, ClassElement, ObjectLiteralElement {
@@ -574,13 +576,18 @@ declare module "typescript" {
}
interface ConditionalExpression extends Expression {
condition: Expression;
questionToken: Node;
whenTrue: Expression;
colonToken: Node;
whenFalse: Expression;
}
interface FunctionExpression extends PrimaryExpression, FunctionLikeDeclaration {
name?: Identifier;
body: Block | Expression;
}
interface ArrowFunction extends Expression, FunctionLikeDeclaration {
equalsGreaterThanToken: Node;
}
interface LiteralExpression extends PrimaryExpression {
text: string;
isUnterminated?: boolean;
@@ -611,6 +618,7 @@ declare module "typescript" {
}
interface PropertyAccessExpression extends MemberExpression {
expression: LeftHandSideExpression;
dotToken: Node;
name: Identifier;
}
interface ElementAccessExpression extends MemberExpression {
@@ -684,6 +692,9 @@ declare module "typescript" {
}
interface SwitchStatement extends Statement {
expression: Expression;
caseBlock: CaseBlock;
}
interface CaseBlock extends Node {
clauses: NodeArray<CaseOrDefaultClause>;
}
interface CaseClause extends Node {
@@ -714,7 +725,7 @@ declare module "typescript" {
_moduleElementBrand: any;
}
interface ClassDeclaration extends Declaration, ModuleElement {
name: Identifier;
name?: Identifier;
typeParameters?: NodeArray<TypeParameterDeclaration>;
heritageClauses?: NodeArray<HeritageClause>;
members: NodeArray<ClassElement>;
@@ -744,10 +755,7 @@ declare module "typescript" {
name: Identifier;
members: NodeArray<EnumMember>;
}
interface ExportContainer {
exportStars?: ExportDeclaration[];
}
interface ModuleDeclaration extends Declaration, ModuleElement, ExportContainer {
interface ModuleDeclaration extends Declaration, ModuleElement {
name: Identifier | LiteralExpression;
body: ModuleBlock | ModuleDeclaration;
}
@@ -772,7 +780,7 @@ declare module "typescript" {
interface NamespaceImport extends Declaration {
name: Identifier;
}
interface ExportDeclaration extends Statement, ModuleElement {
interface ExportDeclaration extends Declaration, ModuleElement {
exportClause?: NamedExports;
moduleSpecifier?: Expression;
}
@@ -787,8 +795,10 @@ declare module "typescript" {
}
type ImportSpecifier = ImportOrExportSpecifier;
type ExportSpecifier = ImportOrExportSpecifier;
interface ExportAssignment extends Statement, ModuleElement {
exportName: Identifier;
interface ExportAssignment extends Declaration, ModuleElement {
isExportEquals?: boolean;
expression?: Expression;
type?: TypeNode;
}
interface FileReference extends TextRange {
fileName: string;
@@ -796,7 +806,7 @@ declare module "typescript" {
interface CommentRange extends TextRange {
hasTrailingNewLine?: boolean;
}
interface SourceFile extends Declaration, ExportContainer {
interface SourceFile extends Declaration {
statements: NodeArray<ModuleElement>;
endOfFileToken: Node;
fileName: string;
@@ -959,10 +969,10 @@ declare module "typescript" {
errorModuleName?: string;
}
interface EmitResolver {
getGeneratedNameForNode(node: ModuleDeclaration | EnumDeclaration | ImportDeclaration | ExportDeclaration): string;
getGeneratedNameForNode(node: Node): string;
getExpressionNameSubstitution(node: Identifier): string;
getExportAssignmentName(node: SourceFile): string;
isReferencedImportDeclaration(node: Node): boolean;
hasExportDefaultValue(node: SourceFile): boolean;
isReferencedAliasDeclaration(node: Node): boolean;
isTopLevelValueImportEqualsWithEntityName(node: ImportEqualsDeclaration): boolean;
getNodeCheckFlags(node: Node): NodeCheckFlags;
isDeclarationVisible(node: Declaration): boolean;
@@ -999,13 +1009,14 @@ declare module "typescript" {
ExportValue = 1048576,
ExportType = 2097152,
ExportNamespace = 4194304,
Import = 8388608,
Alias = 8388608,
Instantiated = 16777216,
Merged = 33554432,
Transient = 67108864,
Prototype = 134217728,
UnionProperty = 268435456,
Optional = 536870912,
ExportStar = 1073741824,
Enum = 384,
Variable = 3,
Value = 107455,
@@ -1030,7 +1041,7 @@ declare module "typescript" {
SetAccessorExcludes = 74687,
TypeParameterExcludes = 530912,
TypeAliasExcludes = 793056,
ImportExcludes = 8388608,
AliasExcludes = 8388608,
ModuleMember = 8914931,
ExportHasLocal = 944,
HasLocals = 255504,
@@ -1059,10 +1070,9 @@ declare module "typescript" {
declaredType?: Type;
mapper?: TypeMapper;
referenced?: boolean;
exportAssignmentChecked?: boolean;
exportAssignmentSymbol?: Symbol;
unionType?: UnionType;
resolvedExports?: SymbolTable;
exportsChecked?: boolean;
}
interface TransientSymbol extends Symbol, SymbolLinks {
}
@@ -1198,17 +1208,6 @@ declare module "typescript" {
interface TypeMapper {
(t: Type): Type;
}
interface TypeInferences {
primary: Type[];
secondary: Type[];
}
interface InferenceContext {
typeParameters: TypeParameter[];
inferUnionTypes: boolean;
inferences: TypeInferences[];
inferredTypes: Type[];
failedTypeParameterIndex?: number;
}
interface DiagnosticMessage {
key: string;
category: DiagnosticCategory;
@@ -1263,7 +1262,6 @@ declare module "typescript" {
target?: ScriptTarget;
version?: boolean;
watch?: boolean;
stripInternal?: boolean;
[option: string]: string | number | boolean;
}
const enum ModuleKind {
@@ -1504,13 +1502,16 @@ declare module "typescript" {
function createTypeChecker(host: TypeCheckerHost, produceDiagnostics: boolean): TypeChecker;
}
declare module "typescript" {
/** The version of the TypeScript compiler release */
let version: string;
function createCompilerHost(options: CompilerOptions): CompilerHost;
function getPreEmitDiagnostics(program: Program): Diagnostic[];
function flattenDiagnosticMessageText(messageText: string | DiagnosticMessageChain, newLine: string): string;
function createProgram(rootNames: string[], options: CompilerOptions, host?: CompilerHost): Program;
}
declare module "typescript" {
var servicesVersion: string;
/** The version of the language service API */
let servicesVersion: string;
interface Node {
getSourceFile(): SourceFile;
getChildCount(sourceFile?: SourceFile): number;
@@ -1997,7 +1998,7 @@ declare module "typescript" {
throwIfCancellationRequested(): void;
}
function createLanguageServiceSourceFile(fileName: string, scriptSnapshot: IScriptSnapshot, scriptTarget: ScriptTarget, version: string, setNodeParents: boolean): SourceFile;
var disableIncrementalParsing: boolean;
let disableIncrementalParsing: boolean;
function updateLanguageServiceSourceFile(sourceFile: SourceFile, scriptSnapshot: IScriptSnapshot, version: string, textChangeRange: TextChangeRange, aggressiveChecks?: boolean): SourceFile;
function createDocumentRegistry(): DocumentRegistry;
function preProcessFile(sourceText: string, readImportFiles?: boolean): PreProcessedFileInfo;
@@ -2034,16 +2035,32 @@ function transform(contents, compilerOptions) {
return files[fileName] !== undefined ? ts.createSourceFile(fileName, files[fileName], target) : undefined;
},
writeFile: function (name, text, writeByteOrderMark) {
outputs.push({ name: name, text: text, writeByteOrderMark: writeByteOrderMark });
outputs.push({
name: name,
text: text,
writeByteOrderMark: writeByteOrderMark
});
},
getDefaultLibFileName: function () { return "lib.d.ts"; },
useCaseSensitiveFileNames: function () { return false; },
getCanonicalFileName: function (fileName) { return fileName; },
getCurrentDirectory: function () { return ""; },
getNewLine: function () { return "\n"; }
getDefaultLibFileName: function () {
return "lib.d.ts";
},
useCaseSensitiveFileNames: function () {
return false;
},
getCanonicalFileName: function (fileName) {
return fileName;
},
getCurrentDirectory: function () {
return "";
},
getNewLine: function () {
return "\n";
}
};
// Create a program from inputs
var program = ts.createProgram(["file.ts"], compilerOptions, compilerHost);
var program = ts.createProgram([
"file.ts"
], compilerOptions, compilerHost);
// Query for early errors
var errors = ts.getPreEmitDiagnostics(program);
var emitResult = program.emit();
@@ -897,67 +897,70 @@ declare module "typescript" {
ModuleBlock = 201,␍
>ModuleBlock : SyntaxKind
ImportEqualsDeclaration = 202,␍
CaseBlock = 202,␍
>CaseBlock : SyntaxKind
ImportEqualsDeclaration = 203,␍
>ImportEqualsDeclaration : SyntaxKind
ImportDeclaration = 203,␍
ImportDeclaration = 204,␍
>ImportDeclaration : SyntaxKind
ImportClause = 204,␍
ImportClause = 205,␍
>ImportClause : SyntaxKind
NamespaceImport = 205,␍
NamespaceImport = 206,␍
>NamespaceImport : SyntaxKind
NamedImports = 206,␍
NamedImports = 207,␍
>NamedImports : SyntaxKind
ImportSpecifier = 207,␍
ImportSpecifier = 208,␍
>ImportSpecifier : SyntaxKind
ExportAssignment = 208,␍
ExportAssignment = 209,␍
>ExportAssignment : SyntaxKind
ExportDeclaration = 209,␍
ExportDeclaration = 210,␍
>ExportDeclaration : SyntaxKind
NamedExports = 210,␍
NamedExports = 211,␍
>NamedExports : SyntaxKind
ExportSpecifier = 211,␍
ExportSpecifier = 212,␍
>ExportSpecifier : SyntaxKind
ExternalModuleReference = 212,␍
ExternalModuleReference = 213,␍
>ExternalModuleReference : SyntaxKind
CaseClause = 213,␍
CaseClause = 214,␍
>CaseClause : SyntaxKind
DefaultClause = 214,␍
DefaultClause = 215,␍
>DefaultClause : SyntaxKind
HeritageClause = 215,␍
HeritageClause = 216,␍
>HeritageClause : SyntaxKind
CatchClause = 216,␍
CatchClause = 217,␍
>CatchClause : SyntaxKind
PropertyAssignment = 217,␍
PropertyAssignment = 218,␍
>PropertyAssignment : SyntaxKind
ShorthandPropertyAssignment = 218,␍
ShorthandPropertyAssignment = 219,␍
>ShorthandPropertyAssignment : SyntaxKind
EnumMember = 219,␍
EnumMember = 220,␍
>EnumMember : SyntaxKind
SourceFile = 220,␍
SourceFile = 221,␍
>SourceFile : SyntaxKind
SyntaxList = 221,␍
SyntaxList = 222,␍
>SyntaxList : SyntaxKind
Count = 222,␍
Count = 223,␍
>Count : SyntaxKind
FirstAssignment = 52,␍
@@ -1050,31 +1053,34 @@ declare module "typescript" {
Static = 128,␍
>Static : NodeFlags
MultiLine = 256,␍
Default = 256,␍
>Default : NodeFlags
MultiLine = 512,␍
>MultiLine : NodeFlags
Synthetic = 512,␍
Synthetic = 1024,␍
>Synthetic : NodeFlags
DeclarationFile = 1024,␍
DeclarationFile = 2048,␍
>DeclarationFile : NodeFlags
Let = 2048,␍
Let = 4096,␍
>Let : NodeFlags
Const = 4096,␍
Const = 8192,␍
>Const : NodeFlags
OctalLiteral = 8192,␍
OctalLiteral = 16384,␍
>OctalLiteral : NodeFlags
Modifier = 243,␍
Modifier = 499,␍
>Modifier : NodeFlags
AccessibilityModifier = 112,␍
>AccessibilityModifier : NodeFlags
BlockScoped = 6144,␍
BlockScoped = 12288,␍
>BlockScoped : NodeFlags
}␍
const enum ParserContextFlags {␍
@@ -1466,7 +1472,7 @@ declare module "typescript" {
>FunctionLikeDeclaration : FunctionLikeDeclaration
>Statement : Statement
name: Identifier;␍
name?: Identifier;␍
>name : Identifier
>Identifier : Identifier
@@ -1729,10 +1735,18 @@ declare module "typescript" {
>condition : Expression
>Expression : Expression
questionToken: Node;␍
>questionToken : Node
>Node : Node
whenTrue: Expression;␍
>whenTrue : Expression
>Expression : Expression
colonToken: Node;␍
>colonToken : Node
>Node : Node
whenFalse: Expression;␍
>whenFalse : Expression
>Expression : Expression
@@ -1750,6 +1764,15 @@ declare module "typescript" {
>body : Expression | Block
>Block : Block
>Expression : Expression
}␍
interface ArrowFunction extends Expression, FunctionLikeDeclaration {␍
>ArrowFunction : ArrowFunction
>Expression : Expression
>FunctionLikeDeclaration : FunctionLikeDeclaration
equalsGreaterThanToken: Node;␍
>equalsGreaterThanToken : Node
>Node : Node
}␍
interface LiteralExpression extends PrimaryExpression {␍
>LiteralExpression : LiteralExpression
@@ -1839,6 +1862,10 @@ declare module "typescript" {
>expression : LeftHandSideExpression
>LeftHandSideExpression : LeftHandSideExpression
dotToken: Node;␍
>dotToken : Node
>Node : Node
name: Identifier;␍
>name : Identifier
>Identifier : Identifier
@@ -2061,6 +2088,14 @@ declare module "typescript" {
>expression : Expression
>Expression : Expression
caseBlock: CaseBlock;␍
>caseBlock : CaseBlock
>CaseBlock : CaseBlock
}␍
interface CaseBlock extends Node {␍
>CaseBlock : CaseBlock
>Node : Node
clauses: NodeArray<CaseOrDefaultClause>;␍
>clauses : NodeArray<CaseClause | DefaultClause>
>NodeArray : NodeArray<T>
@@ -2153,7 +2188,7 @@ declare module "typescript" {
>Declaration : Declaration
>ModuleElement : ModuleElement
name: Identifier;␍
name?: Identifier;␍
>name : Identifier
>Identifier : Identifier
@@ -2255,18 +2290,10 @@ declare module "typescript" {
>NodeArray : NodeArray<T>
>EnumMember : EnumMember
}␍
interface ExportContainer {␍
>ExportContainer : ExportContainer
exportStars?: ExportDeclaration[];␍
>exportStars : ExportDeclaration[]
>ExportDeclaration : ExportDeclaration
}␍
interface ModuleDeclaration extends Declaration, ModuleElement, ExportContainer {␍
interface ModuleDeclaration extends Declaration, ModuleElement {␍
>ModuleDeclaration : ModuleDeclaration
>Declaration : Declaration
>ModuleElement : ModuleElement
>ExportContainer : ExportContainer
name: Identifier | LiteralExpression;␍
>name : Identifier | LiteralExpression
@@ -2344,9 +2371,9 @@ declare module "typescript" {
>name : Identifier
>Identifier : Identifier
}␍
interface ExportDeclaration extends Statement, ModuleElement {␍
interface ExportDeclaration extends Declaration, ModuleElement {␍
>ExportDeclaration : ExportDeclaration
>Statement : Statement
>Declaration : Declaration
>ModuleElement : ModuleElement
exportClause?: NamedExports;␍
@@ -2394,14 +2421,21 @@ declare module "typescript" {
>ExportSpecifier : ImportOrExportSpecifier
>ImportOrExportSpecifier : ImportOrExportSpecifier
interface ExportAssignment extends Statement, ModuleElement {␍
interface ExportAssignment extends Declaration, ModuleElement {␍
>ExportAssignment : ExportAssignment
>Statement : Statement
>Declaration : Declaration
>ModuleElement : ModuleElement
exportName: Identifier;␍
>exportName : Identifier
>Identifier : Identifier
isExportEquals?: boolean;␍
>isExportEquals : boolean
expression?: Expression;␍
>expression : Expression
>Expression : Expression
type?: TypeNode;␍
>type : TypeNode
>TypeNode : TypeNode
}␍
interface FileReference extends TextRange {␍
>FileReference : FileReference
@@ -2417,10 +2451,9 @@ declare module "typescript" {
hasTrailingNewLine?: boolean;␍
>hasTrailingNewLine : boolean
}␍
interface SourceFile extends Declaration, ExportContainer {␍
interface SourceFile extends Declaration {␍
>SourceFile : SourceFile
>Declaration : Declaration
>ExportContainer : ExportContainer
statements: NodeArray<ModuleElement>;␍
>statements : NodeArray<ModuleElement>
@@ -3061,26 +3094,23 @@ declare module "typescript" {
interface EmitResolver {␍
>EmitResolver : EmitResolver
getGeneratedNameForNode(node: ModuleDeclaration | EnumDeclaration | ImportDeclaration | ExportDeclaration): string;␍
>getGeneratedNameForNode : (node: EnumDeclaration | ExportDeclaration | ModuleDeclaration | ImportDeclaration) => string
>node : EnumDeclaration | ExportDeclaration | ModuleDeclaration | ImportDeclaration
>ModuleDeclaration : ModuleDeclaration
>EnumDeclaration : EnumDeclaration
>ImportDeclaration : ImportDeclaration
>ExportDeclaration : ExportDeclaration
getGeneratedNameForNode(node: Node): string;␍
>getGeneratedNameForNode : (node: Node) => string
>node : Node
>Node : Node
getExpressionNameSubstitution(node: Identifier): string;␍
>getExpressionNameSubstitution : (node: Identifier) => string
>node : Identifier
>Identifier : Identifier
getExportAssignmentName(node: SourceFile): string;␍
>getExportAssignmentName : (node: SourceFile) => string
hasExportDefaultValue(node: SourceFile): boolean;␍
>hasExportDefaultValue : (node: SourceFile) => boolean
>node : SourceFile
>SourceFile : SourceFile
isReferencedImportDeclaration(node: Node): boolean;␍
>isReferencedImportDeclaration : (node: Node) => boolean
isReferencedAliasDeclaration(node: Node): boolean;␍
>isReferencedAliasDeclaration : (node: Node) => boolean
>node : Node
>Node : Node
@@ -3236,8 +3266,8 @@ declare module "typescript" {
ExportNamespace = 4194304,␍
>ExportNamespace : SymbolFlags
Import = 8388608,␍
>Import : SymbolFlags
Alias = 8388608,␍
>Alias : SymbolFlags
Instantiated = 16777216,␍
>Instantiated : SymbolFlags
@@ -3257,6 +3287,9 @@ declare module "typescript" {
Optional = 536870912,␍
>Optional : SymbolFlags
ExportStar = 1073741824,␍
>ExportStar : SymbolFlags
Enum = 384,␍
>Enum : SymbolFlags
@@ -3329,8 +3362,8 @@ declare module "typescript" {
TypeAliasExcludes = 793056,␍
>TypeAliasExcludes : SymbolFlags
ImportExcludes = 8388608,␍
>ImportExcludes : SymbolFlags
AliasExcludes = 8388608,␍
>AliasExcludes : SymbolFlags
ModuleMember = 8914931,␍
>ModuleMember : SymbolFlags
@@ -3421,13 +3454,6 @@ declare module "typescript" {
referenced?: boolean;␍
>referenced : boolean
exportAssignmentChecked?: boolean;␍
>exportAssignmentChecked : boolean
exportAssignmentSymbol?: Symbol;␍
>exportAssignmentSymbol : Symbol
>Symbol : Symbol
unionType?: UnionType;␍
>unionType : UnionType
>UnionType : UnionType
@@ -3435,6 +3461,9 @@ declare module "typescript" {
resolvedExports?: SymbolTable;␍
>resolvedExports : SymbolTable
>SymbolTable : SymbolTable
exportsChecked?: boolean;␍
>exportsChecked : boolean
}␍
interface TransientSymbol extends Symbol, SymbolLinks {␍
>TransientSymbol : TransientSymbol
@@ -3836,38 +3865,6 @@ declare module "typescript" {
>t : Type
>Type : Type
>Type : Type
}␍
interface TypeInferences {␍
>TypeInferences : TypeInferences
primary: Type[];␍
>primary : Type[]
>Type : Type
secondary: Type[];␍
>secondary : Type[]
>Type : Type
}␍
interface InferenceContext {␍
>InferenceContext : InferenceContext
typeParameters: TypeParameter[];␍
>typeParameters : TypeParameter[]
>TypeParameter : TypeParameter
inferUnionTypes: boolean;␍
>inferUnionTypes : boolean
inferences: TypeInferences[];␍
>inferences : TypeInferences[]
>TypeInferences : TypeInferences
inferredTypes: Type[];␍
>inferredTypes : Type[]
>Type : Type
failedTypeParameterIndex?: number;␍
>failedTypeParameterIndex : number
}␍
interface DiagnosticMessage {␍
>DiagnosticMessage : DiagnosticMessage
@@ -4027,9 +4024,6 @@ declare module "typescript" {
watch?: boolean;␍
>watch : boolean
stripInternal?: boolean;␍
>stripInternal : boolean
[option: string]: string | number | boolean;␍
>option : string
}␍
@@ -4812,6 +4806,10 @@ declare module "typescript" {
>TypeChecker : TypeChecker
}␍
declare module "typescript" {␍
/** The version of the TypeScript compiler release */␍
let version: string;␍
>version : string
function createCompilerHost(options: CompilerOptions): CompilerHost;␍
>createCompilerHost : (options: CompilerOptions) => CompilerHost
>options : CompilerOptions
@@ -4840,7 +4838,8 @@ declare module "typescript" {
>Program : Program
}␍
declare module "typescript" {␍
var servicesVersion: string;␍
/** The version of the language service API */␍
let servicesVersion: string;␍
>servicesVersion : string
interface Node {␍
@@ -6190,7 +6189,7 @@ declare module "typescript" {
>setNodeParents : boolean
>SourceFile : SourceFile
var disableIncrementalParsing: boolean;␍
let disableIncrementalParsing: boolean;␍
>disableIncrementalParsing : boolean
function updateLanguageServiceSourceFile(sourceFile: SourceFile, scriptSnapshot: IScriptSnapshot, version: string, textChangeRange: TextChangeRange, aggressiveChecks?: boolean): SourceFile;␍
+89 -69
View File
@@ -330,27 +330,28 @@ declare module "typescript" {
EnumDeclaration = 199,
ModuleDeclaration = 200,
ModuleBlock = 201,
ImportEqualsDeclaration = 202,
ImportDeclaration = 203,
ImportClause = 204,
NamespaceImport = 205,
NamedImports = 206,
ImportSpecifier = 207,
ExportAssignment = 208,
ExportDeclaration = 209,
NamedExports = 210,
ExportSpecifier = 211,
ExternalModuleReference = 212,
CaseClause = 213,
DefaultClause = 214,
HeritageClause = 215,
CatchClause = 216,
PropertyAssignment = 217,
ShorthandPropertyAssignment = 218,
EnumMember = 219,
SourceFile = 220,
SyntaxList = 221,
Count = 222,
CaseBlock = 202,
ImportEqualsDeclaration = 203,
ImportDeclaration = 204,
ImportClause = 205,
NamespaceImport = 206,
NamedImports = 207,
ImportSpecifier = 208,
ExportAssignment = 209,
ExportDeclaration = 210,
NamedExports = 211,
ExportSpecifier = 212,
ExternalModuleReference = 213,
CaseClause = 214,
DefaultClause = 215,
HeritageClause = 216,
CatchClause = 217,
PropertyAssignment = 218,
ShorthandPropertyAssignment = 219,
EnumMember = 220,
SourceFile = 221,
SyntaxList = 222,
Count = 223,
FirstAssignment = 52,
LastAssignment = 63,
FirstReservedWord = 65,
@@ -382,15 +383,16 @@ declare module "typescript" {
Private = 32,
Protected = 64,
Static = 128,
MultiLine = 256,
Synthetic = 512,
DeclarationFile = 1024,
Let = 2048,
Const = 4096,
OctalLiteral = 8192,
Modifier = 243,
Default = 256,
MultiLine = 512,
Synthetic = 1024,
DeclarationFile = 2048,
Let = 4096,
Const = 8192,
OctalLiteral = 16384,
Modifier = 499,
AccessibilityModifier = 112,
BlockScoped = 6144,
BlockScoped = 12288,
}
const enum ParserContextFlags {
StrictMode = 1,
@@ -518,7 +520,7 @@ declare module "typescript" {
body?: Block | Expression;
}
interface FunctionDeclaration extends FunctionLikeDeclaration, Statement {
name: Identifier;
name?: Identifier;
body?: Block;
}
interface MethodDeclaration extends FunctionLikeDeclaration, ClassElement, ObjectLiteralElement {
@@ -611,13 +613,18 @@ declare module "typescript" {
}
interface ConditionalExpression extends Expression {
condition: Expression;
questionToken: Node;
whenTrue: Expression;
colonToken: Node;
whenFalse: Expression;
}
interface FunctionExpression extends PrimaryExpression, FunctionLikeDeclaration {
name?: Identifier;
body: Block | Expression;
}
interface ArrowFunction extends Expression, FunctionLikeDeclaration {
equalsGreaterThanToken: Node;
}
interface LiteralExpression extends PrimaryExpression {
text: string;
isUnterminated?: boolean;
@@ -648,6 +655,7 @@ declare module "typescript" {
}
interface PropertyAccessExpression extends MemberExpression {
expression: LeftHandSideExpression;
dotToken: Node;
name: Identifier;
}
interface ElementAccessExpression extends MemberExpression {
@@ -721,6 +729,9 @@ declare module "typescript" {
}
interface SwitchStatement extends Statement {
expression: Expression;
caseBlock: CaseBlock;
}
interface CaseBlock extends Node {
clauses: NodeArray<CaseOrDefaultClause>;
}
interface CaseClause extends Node {
@@ -751,7 +762,7 @@ declare module "typescript" {
_moduleElementBrand: any;
}
interface ClassDeclaration extends Declaration, ModuleElement {
name: Identifier;
name?: Identifier;
typeParameters?: NodeArray<TypeParameterDeclaration>;
heritageClauses?: NodeArray<HeritageClause>;
members: NodeArray<ClassElement>;
@@ -781,10 +792,7 @@ declare module "typescript" {
name: Identifier;
members: NodeArray<EnumMember>;
}
interface ExportContainer {
exportStars?: ExportDeclaration[];
}
interface ModuleDeclaration extends Declaration, ModuleElement, ExportContainer {
interface ModuleDeclaration extends Declaration, ModuleElement {
name: Identifier | LiteralExpression;
body: ModuleBlock | ModuleDeclaration;
}
@@ -809,7 +817,7 @@ declare module "typescript" {
interface NamespaceImport extends Declaration {
name: Identifier;
}
interface ExportDeclaration extends Statement, ModuleElement {
interface ExportDeclaration extends Declaration, ModuleElement {
exportClause?: NamedExports;
moduleSpecifier?: Expression;
}
@@ -824,8 +832,10 @@ declare module "typescript" {
}
type ImportSpecifier = ImportOrExportSpecifier;
type ExportSpecifier = ImportOrExportSpecifier;
interface ExportAssignment extends Statement, ModuleElement {
exportName: Identifier;
interface ExportAssignment extends Declaration, ModuleElement {
isExportEquals?: boolean;
expression?: Expression;
type?: TypeNode;
}
interface FileReference extends TextRange {
fileName: string;
@@ -833,7 +843,7 @@ declare module "typescript" {
interface CommentRange extends TextRange {
hasTrailingNewLine?: boolean;
}
interface SourceFile extends Declaration, ExportContainer {
interface SourceFile extends Declaration {
statements: NodeArray<ModuleElement>;
endOfFileToken: Node;
fileName: string;
@@ -996,10 +1006,10 @@ declare module "typescript" {
errorModuleName?: string;
}
interface EmitResolver {
getGeneratedNameForNode(node: ModuleDeclaration | EnumDeclaration | ImportDeclaration | ExportDeclaration): string;
getGeneratedNameForNode(node: Node): string;
getExpressionNameSubstitution(node: Identifier): string;
getExportAssignmentName(node: SourceFile): string;
isReferencedImportDeclaration(node: Node): boolean;
hasExportDefaultValue(node: SourceFile): boolean;
isReferencedAliasDeclaration(node: Node): boolean;
isTopLevelValueImportEqualsWithEntityName(node: ImportEqualsDeclaration): boolean;
getNodeCheckFlags(node: Node): NodeCheckFlags;
isDeclarationVisible(node: Declaration): boolean;
@@ -1036,13 +1046,14 @@ declare module "typescript" {
ExportValue = 1048576,
ExportType = 2097152,
ExportNamespace = 4194304,
Import = 8388608,
Alias = 8388608,
Instantiated = 16777216,
Merged = 33554432,
Transient = 67108864,
Prototype = 134217728,
UnionProperty = 268435456,
Optional = 536870912,
ExportStar = 1073741824,
Enum = 384,
Variable = 3,
Value = 107455,
@@ -1067,7 +1078,7 @@ declare module "typescript" {
SetAccessorExcludes = 74687,
TypeParameterExcludes = 530912,
TypeAliasExcludes = 793056,
ImportExcludes = 8388608,
AliasExcludes = 8388608,
ModuleMember = 8914931,
ExportHasLocal = 944,
HasLocals = 255504,
@@ -1096,10 +1107,9 @@ declare module "typescript" {
declaredType?: Type;
mapper?: TypeMapper;
referenced?: boolean;
exportAssignmentChecked?: boolean;
exportAssignmentSymbol?: Symbol;
unionType?: UnionType;
resolvedExports?: SymbolTable;
exportsChecked?: boolean;
}
interface TransientSymbol extends Symbol, SymbolLinks {
}
@@ -1235,17 +1245,6 @@ declare module "typescript" {
interface TypeMapper {
(t: Type): Type;
}
interface TypeInferences {
primary: Type[];
secondary: Type[];
}
interface InferenceContext {
typeParameters: TypeParameter[];
inferUnionTypes: boolean;
inferences: TypeInferences[];
inferredTypes: Type[];
failedTypeParameterIndex?: number;
}
interface DiagnosticMessage {
key: string;
category: DiagnosticCategory;
@@ -1300,7 +1299,6 @@ declare module "typescript" {
target?: ScriptTarget;
version?: boolean;
watch?: boolean;
stripInternal?: boolean;
[option: string]: string | number | boolean;
}
const enum ModuleKind {
@@ -1541,13 +1539,16 @@ declare module "typescript" {
function createTypeChecker(host: TypeCheckerHost, produceDiagnostics: boolean): TypeChecker;
}
declare module "typescript" {
/** The version of the TypeScript compiler release */
let version: string;
function createCompilerHost(options: CompilerOptions): CompilerHost;
function getPreEmitDiagnostics(program: Program): Diagnostic[];
function flattenDiagnosticMessageText(messageText: string | DiagnosticMessageChain, newLine: string): string;
function createProgram(rootNames: string[], options: CompilerOptions, host?: CompilerHost): Program;
}
declare module "typescript" {
var servicesVersion: string;
/** The version of the language service API */
let servicesVersion: string;
interface Node {
getSourceFile(): SourceFile;
getChildCount(sourceFile?: SourceFile): number;
@@ -2034,7 +2035,7 @@ declare module "typescript" {
throwIfCancellationRequested(): void;
}
function createLanguageServiceSourceFile(fileName: string, scriptSnapshot: IScriptSnapshot, scriptTarget: ScriptTarget, version: string, setNodeParents: boolean): SourceFile;
var disableIncrementalParsing: boolean;
let disableIncrementalParsing: boolean;
function updateLanguageServiceSourceFile(sourceFile: SourceFile, scriptSnapshot: IScriptSnapshot, version: string, textChangeRange: TextChangeRange, aggressiveChecks?: boolean): SourceFile;
function createDocumentRegistry(): DocumentRegistry;
function preProcessFile(sourceText: string, readImportFiles?: boolean): PreProcessedFileInfo;
@@ -2060,21 +2061,33 @@ function watch(rootFileNames, options) {
var files = {};
// initialize the list of files
rootFileNames.forEach(function (fileName) {
files[fileName] = { version: 0 };
files[fileName] = {
version: 0
};
});
// Create the language service host to allow the LS to communicate with the host
var servicesHost = {
getScriptFileNames: function () { return rootFileNames; },
getScriptVersion: function (fileName) { return files[fileName] && files[fileName].version.toString(); },
getScriptFileNames: function () {
return rootFileNames;
},
getScriptVersion: function (fileName) {
return files[fileName] && files[fileName].version.toString();
},
getScriptSnapshot: function (fileName) {
if (!fs.existsSync(fileName)) {
return undefined;
}
return ts.ScriptSnapshot.fromString(fs.readFileSync(fileName).toString());
},
getCurrentDirectory: function () { return process.cwd(); },
getCompilationSettings: function () { return options; },
getDefaultLibFileName: function (options) { return ts.getDefaultLibFilePath(options); }
getCurrentDirectory: function () {
return process.cwd();
},
getCompilationSettings: function () {
return options;
},
getDefaultLibFileName: function (options) {
return ts.getDefaultLibFilePath(options);
}
};
// Create the language service files
var services = ts.createLanguageService(servicesHost, ts.createDocumentRegistry());
@@ -2083,7 +2096,10 @@ function watch(rootFileNames, options) {
// First time around, emit all files
emitFile(fileName);
// Add a watch on the file to handle next change
fs.watchFile(fileName, { persistent: true, interval: 250 }, function (curr, prev) {
fs.watchFile(fileName, {
persistent: true,
interval: 250
}, function (curr, prev) {
// Check timestamp
if (+curr.mtime <= +prev.mtime) {
return;
@@ -2121,6 +2137,10 @@ function watch(rootFileNames, options) {
}
}
// Initialize files constituting the program as all .ts files in the current directory
var currentDirectoryFiles = fs.readdirSync(process.cwd()).filter(function (fileName) { return fileName.length >= 3 && fileName.substr(fileName.length - 3, 3) === ".ts"; });
var currentDirectoryFiles = fs.readdirSync(process.cwd()).filter(function (fileName) {
return fileName.length >= 3 && fileName.substr(fileName.length - 3, 3) === ".ts";
});
// Start the watcher
watch(currentDirectoryFiles, { module: 1 /* CommonJS */ });
watch(currentDirectoryFiles, {
module: 1 /* CommonJS */
});
+107 -108
View File
@@ -1070,67 +1070,70 @@ declare module "typescript" {
ModuleBlock = 201,␍
>ModuleBlock : SyntaxKind
ImportEqualsDeclaration = 202,␍
CaseBlock = 202,␍
>CaseBlock : SyntaxKind
ImportEqualsDeclaration = 203,␍
>ImportEqualsDeclaration : SyntaxKind
ImportDeclaration = 203,␍
ImportDeclaration = 204,␍
>ImportDeclaration : SyntaxKind
ImportClause = 204,␍
ImportClause = 205,␍
>ImportClause : SyntaxKind
NamespaceImport = 205,␍
NamespaceImport = 206,␍
>NamespaceImport : SyntaxKind
NamedImports = 206,␍
NamedImports = 207,␍
>NamedImports : SyntaxKind
ImportSpecifier = 207,␍
ImportSpecifier = 208,␍
>ImportSpecifier : SyntaxKind
ExportAssignment = 208,␍
ExportAssignment = 209,␍
>ExportAssignment : SyntaxKind
ExportDeclaration = 209,␍
ExportDeclaration = 210,␍
>ExportDeclaration : SyntaxKind
NamedExports = 210,␍
NamedExports = 211,␍
>NamedExports : SyntaxKind
ExportSpecifier = 211,␍
ExportSpecifier = 212,␍
>ExportSpecifier : SyntaxKind
ExternalModuleReference = 212,␍
ExternalModuleReference = 213,␍
>ExternalModuleReference : SyntaxKind
CaseClause = 213,␍
CaseClause = 214,␍
>CaseClause : SyntaxKind
DefaultClause = 214,␍
DefaultClause = 215,␍
>DefaultClause : SyntaxKind
HeritageClause = 215,␍
HeritageClause = 216,␍
>HeritageClause : SyntaxKind
CatchClause = 216,␍
CatchClause = 217,␍
>CatchClause : SyntaxKind
PropertyAssignment = 217,␍
PropertyAssignment = 218,␍
>PropertyAssignment : SyntaxKind
ShorthandPropertyAssignment = 218,␍
ShorthandPropertyAssignment = 219,␍
>ShorthandPropertyAssignment : SyntaxKind
EnumMember = 219,␍
EnumMember = 220,␍
>EnumMember : SyntaxKind
SourceFile = 220,␍
SourceFile = 221,␍
>SourceFile : SyntaxKind
SyntaxList = 221,␍
SyntaxList = 222,␍
>SyntaxList : SyntaxKind
Count = 222,␍
Count = 223,␍
>Count : SyntaxKind
FirstAssignment = 52,␍
@@ -1223,31 +1226,34 @@ declare module "typescript" {
Static = 128,␍
>Static : NodeFlags
MultiLine = 256,␍
Default = 256,␍
>Default : NodeFlags
MultiLine = 512,␍
>MultiLine : NodeFlags
Synthetic = 512,␍
Synthetic = 1024,␍
>Synthetic : NodeFlags
DeclarationFile = 1024,␍
DeclarationFile = 2048,␍
>DeclarationFile : NodeFlags
Let = 2048,␍
Let = 4096,␍
>Let : NodeFlags
Const = 4096,␍
Const = 8192,␍
>Const : NodeFlags
OctalLiteral = 8192,␍
OctalLiteral = 16384,␍
>OctalLiteral : NodeFlags
Modifier = 243,␍
Modifier = 499,␍
>Modifier : NodeFlags
AccessibilityModifier = 112,␍
>AccessibilityModifier : NodeFlags
BlockScoped = 6144,␍
BlockScoped = 12288,␍
>BlockScoped : NodeFlags
}␍
const enum ParserContextFlags {␍
@@ -1639,7 +1645,7 @@ declare module "typescript" {
>FunctionLikeDeclaration : FunctionLikeDeclaration
>Statement : Statement
name: Identifier;␍
name?: Identifier;␍
>name : Identifier
>Identifier : Identifier
@@ -1902,10 +1908,18 @@ declare module "typescript" {
>condition : Expression
>Expression : Expression
questionToken: Node;␍
>questionToken : Node
>Node : Node
whenTrue: Expression;␍
>whenTrue : Expression
>Expression : Expression
colonToken: Node;␍
>colonToken : Node
>Node : Node
whenFalse: Expression;␍
>whenFalse : Expression
>Expression : Expression
@@ -1923,6 +1937,15 @@ declare module "typescript" {
>body : Expression | Block
>Block : Block
>Expression : Expression
}␍
interface ArrowFunction extends Expression, FunctionLikeDeclaration {␍
>ArrowFunction : ArrowFunction
>Expression : Expression
>FunctionLikeDeclaration : FunctionLikeDeclaration
equalsGreaterThanToken: Node;␍
>equalsGreaterThanToken : Node
>Node : Node
}␍
interface LiteralExpression extends PrimaryExpression {␍
>LiteralExpression : LiteralExpression
@@ -2012,6 +2035,10 @@ declare module "typescript" {
>expression : LeftHandSideExpression
>LeftHandSideExpression : LeftHandSideExpression
dotToken: Node;␍
>dotToken : Node
>Node : Node
name: Identifier;␍
>name : Identifier
>Identifier : Identifier
@@ -2234,6 +2261,14 @@ declare module "typescript" {
>expression : Expression
>Expression : Expression
caseBlock: CaseBlock;␍
>caseBlock : CaseBlock
>CaseBlock : CaseBlock
}␍
interface CaseBlock extends Node {␍
>CaseBlock : CaseBlock
>Node : Node
clauses: NodeArray<CaseOrDefaultClause>;␍
>clauses : NodeArray<CaseClause | DefaultClause>
>NodeArray : NodeArray<T>
@@ -2326,7 +2361,7 @@ declare module "typescript" {
>Declaration : Declaration
>ModuleElement : ModuleElement
name: Identifier;␍
name?: Identifier;␍
>name : Identifier
>Identifier : Identifier
@@ -2428,18 +2463,10 @@ declare module "typescript" {
>NodeArray : NodeArray<T>
>EnumMember : EnumMember
}␍
interface ExportContainer {␍
>ExportContainer : ExportContainer
exportStars?: ExportDeclaration[];␍
>exportStars : ExportDeclaration[]
>ExportDeclaration : ExportDeclaration
}␍
interface ModuleDeclaration extends Declaration, ModuleElement, ExportContainer {␍
interface ModuleDeclaration extends Declaration, ModuleElement {␍
>ModuleDeclaration : ModuleDeclaration
>Declaration : Declaration
>ModuleElement : ModuleElement
>ExportContainer : ExportContainer
name: Identifier | LiteralExpression;␍
>name : Identifier | LiteralExpression
@@ -2517,9 +2544,9 @@ declare module "typescript" {
>name : Identifier
>Identifier : Identifier
}␍
interface ExportDeclaration extends Statement, ModuleElement {␍
interface ExportDeclaration extends Declaration, ModuleElement {␍
>ExportDeclaration : ExportDeclaration
>Statement : Statement
>Declaration : Declaration
>ModuleElement : ModuleElement
exportClause?: NamedExports;␍
@@ -2567,14 +2594,21 @@ declare module "typescript" {
>ExportSpecifier : ImportOrExportSpecifier
>ImportOrExportSpecifier : ImportOrExportSpecifier
interface ExportAssignment extends Statement, ModuleElement {␍
interface ExportAssignment extends Declaration, ModuleElement {␍
>ExportAssignment : ExportAssignment
>Statement : Statement
>Declaration : Declaration
>ModuleElement : ModuleElement
exportName: Identifier;␍
>exportName : Identifier
>Identifier : Identifier
isExportEquals?: boolean;␍
>isExportEquals : boolean
expression?: Expression;␍
>expression : Expression
>Expression : Expression
type?: TypeNode;␍
>type : TypeNode
>TypeNode : TypeNode
}␍
interface FileReference extends TextRange {␍
>FileReference : FileReference
@@ -2590,10 +2624,9 @@ declare module "typescript" {
hasTrailingNewLine?: boolean;␍
>hasTrailingNewLine : boolean
}␍
interface SourceFile extends Declaration, ExportContainer {␍
interface SourceFile extends Declaration {␍
>SourceFile : SourceFile
>Declaration : Declaration
>ExportContainer : ExportContainer
statements: NodeArray<ModuleElement>;␍
>statements : NodeArray<ModuleElement>
@@ -3234,26 +3267,23 @@ declare module "typescript" {
interface EmitResolver {␍
>EmitResolver : EmitResolver
getGeneratedNameForNode(node: ModuleDeclaration | EnumDeclaration | ImportDeclaration | ExportDeclaration): string;␍
>getGeneratedNameForNode : (node: EnumDeclaration | ExportDeclaration | ModuleDeclaration | ImportDeclaration) => string
>node : EnumDeclaration | ExportDeclaration | ModuleDeclaration | ImportDeclaration
>ModuleDeclaration : ModuleDeclaration
>EnumDeclaration : EnumDeclaration
>ImportDeclaration : ImportDeclaration
>ExportDeclaration : ExportDeclaration
getGeneratedNameForNode(node: Node): string;␍
>getGeneratedNameForNode : (node: Node) => string
>node : Node
>Node : Node
getExpressionNameSubstitution(node: Identifier): string;␍
>getExpressionNameSubstitution : (node: Identifier) => string
>node : Identifier
>Identifier : Identifier
getExportAssignmentName(node: SourceFile): string;␍
>getExportAssignmentName : (node: SourceFile) => string
hasExportDefaultValue(node: SourceFile): boolean;␍
>hasExportDefaultValue : (node: SourceFile) => boolean
>node : SourceFile
>SourceFile : SourceFile
isReferencedImportDeclaration(node: Node): boolean;␍
>isReferencedImportDeclaration : (node: Node) => boolean
isReferencedAliasDeclaration(node: Node): boolean;␍
>isReferencedAliasDeclaration : (node: Node) => boolean
>node : Node
>Node : Node
@@ -3409,8 +3439,8 @@ declare module "typescript" {
ExportNamespace = 4194304,␍
>ExportNamespace : SymbolFlags
Import = 8388608,␍
>Import : SymbolFlags
Alias = 8388608,␍
>Alias : SymbolFlags
Instantiated = 16777216,␍
>Instantiated : SymbolFlags
@@ -3430,6 +3460,9 @@ declare module "typescript" {
Optional = 536870912,␍
>Optional : SymbolFlags
ExportStar = 1073741824,␍
>ExportStar : SymbolFlags
Enum = 384,␍
>Enum : SymbolFlags
@@ -3502,8 +3535,8 @@ declare module "typescript" {
TypeAliasExcludes = 793056,␍
>TypeAliasExcludes : SymbolFlags
ImportExcludes = 8388608,␍
>ImportExcludes : SymbolFlags
AliasExcludes = 8388608,␍
>AliasExcludes : SymbolFlags
ModuleMember = 8914931,␍
>ModuleMember : SymbolFlags
@@ -3594,13 +3627,6 @@ declare module "typescript" {
referenced?: boolean;␍
>referenced : boolean
exportAssignmentChecked?: boolean;␍
>exportAssignmentChecked : boolean
exportAssignmentSymbol?: Symbol;␍
>exportAssignmentSymbol : Symbol
>Symbol : Symbol
unionType?: UnionType;␍
>unionType : UnionType
>UnionType : UnionType
@@ -3608,6 +3634,9 @@ declare module "typescript" {
resolvedExports?: SymbolTable;␍
>resolvedExports : SymbolTable
>SymbolTable : SymbolTable
exportsChecked?: boolean;␍
>exportsChecked : boolean
}␍
interface TransientSymbol extends Symbol, SymbolLinks {␍
>TransientSymbol : TransientSymbol
@@ -4009,38 +4038,6 @@ declare module "typescript" {
>t : Type
>Type : Type
>Type : Type
}␍
interface TypeInferences {␍
>TypeInferences : TypeInferences
primary: Type[];␍
>primary : Type[]
>Type : Type
secondary: Type[];␍
>secondary : Type[]
>Type : Type
}␍
interface InferenceContext {␍
>InferenceContext : InferenceContext
typeParameters: TypeParameter[];␍
>typeParameters : TypeParameter[]
>TypeParameter : TypeParameter
inferUnionTypes: boolean;␍
>inferUnionTypes : boolean
inferences: TypeInferences[];␍
>inferences : TypeInferences[]
>TypeInferences : TypeInferences
inferredTypes: Type[];␍
>inferredTypes : Type[]
>Type : Type
failedTypeParameterIndex?: number;␍
>failedTypeParameterIndex : number
}␍
interface DiagnosticMessage {␍
>DiagnosticMessage : DiagnosticMessage
@@ -4200,9 +4197,6 @@ declare module "typescript" {
watch?: boolean;␍
>watch : boolean
stripInternal?: boolean;␍
>stripInternal : boolean
[option: string]: string | number | boolean;␍
>option : string
}␍
@@ -4985,6 +4979,10 @@ declare module "typescript" {
>TypeChecker : TypeChecker
}␍
declare module "typescript" {␍
/** The version of the TypeScript compiler release */␍
let version: string;␍
>version : string
function createCompilerHost(options: CompilerOptions): CompilerHost;␍
>createCompilerHost : (options: CompilerOptions) => CompilerHost
>options : CompilerOptions
@@ -5013,7 +5011,8 @@ declare module "typescript" {
>Program : Program
}␍
declare module "typescript" {␍
var servicesVersion: string;␍
/** The version of the language service API */␍
let servicesVersion: string;␍
>servicesVersion : string
interface Node {␍
@@ -6363,7 +6362,7 @@ declare module "typescript" {
>setNodeParents : boolean
>SourceFile : SourceFile
var disableIncrementalParsing: boolean;␍
let disableIncrementalParsing: boolean;␍
>disableIncrementalParsing : boolean
function updateLanguageServiceSourceFile(sourceFile: SourceFile, scriptSnapshot: IScriptSnapshot, version: string, textChangeRange: TextChangeRange, aggressiveChecks?: boolean): SourceFile;␍
@@ -17,7 +17,10 @@ var cl = Point.Origin;
//// [function.js]
function Point() {
return { x: 0, y: 0 };
return {
x: 0,
y: 0
};
}
//// [test.js]
var cl;
@@ -2,4 +2,5 @@
var v = (public x: string) => { };
//// [ArrowFunctionExpression1.js]
var v = function (x) { };
var v = function (x) {
};
@@ -58,7 +58,8 @@ var clodule1 = (function () {
})();
var clodule1;
(function (clodule1) {
function f(x) { }
function f(x) {
}
})(clodule1 || (clodule1 = {}));
var clodule2 = (function () {
function clodule2() {
@@ -81,7 +82,9 @@ var clodule3 = (function () {
})();
var clodule3;
(function (clodule3) {
clodule3.y = { id: T };
clodule3.y = {
id: T
};
})(clodule3 || (clodule3 = {}));
var clodule4 = (function () {
function clodule4() {
@@ -19,7 +19,8 @@ module clodule {
var clodule = (function () {
function clodule() {
}
clodule.fn = function (id) { };
clodule.fn = function (id) {
};
return clodule;
})();
var clodule;
@@ -19,7 +19,8 @@ module clodule {
var clodule = (function () {
function clodule() {
}
clodule.fn = function (id) { };
clodule.fn = function (id) {
};
return clodule;
})();
var clodule;
@@ -19,7 +19,9 @@ module clodule {
var clodule = (function () {
function clodule() {
}
clodule.sfn = function (id) { return 42; };
clodule.sfn = function (id) {
return 42;
};
return clodule;
})();
var clodule;
@@ -28,12 +28,19 @@ var Point = (function () {
this.x = x;
this.y = y;
}
Point.Origin = function () { return { x: 0, y: 0 }; }; // unexpected error here bug 840246
Point.Origin = function () {
return {
x: 0,
y: 0
};
}; // unexpected error here bug 840246
return Point;
})();
var Point;
(function (Point) {
function Origin() { return null; }
function Origin() {
return null;
}
Point.Origin = Origin; //expected duplicate identifier error
})(Point || (Point = {}));
var A;
@@ -43,13 +50,20 @@ var A;
this.x = x;
this.y = y;
}
Point.Origin = function () { return { x: 0, y: 0 }; }; // unexpected error here bug 840246
Point.Origin = function () {
return {
x: 0,
y: 0
};
}; // unexpected error here bug 840246
return Point;
})();
A.Point = Point;
var Point;
(function (Point) {
function Origin() { return ""; }
function Origin() {
return "";
}
Point.Origin = Origin; //expected duplicate identifier error
})(Point = A.Point || (A.Point = {}));
})(A || (A = {}));
@@ -28,12 +28,19 @@ var Point = (function () {
this.x = x;
this.y = y;
}
Point.Origin = function () { return { x: 0, y: 0 }; };
Point.Origin = function () {
return {
x: 0,
y: 0
};
};
return Point;
})();
var Point;
(function (Point) {
function Origin() { return ""; } // not an error, since not exported
function Origin() {
return "";
} // not an error, since not exported
})(Point || (Point = {}));
var A;
(function (A) {
@@ -42,12 +49,19 @@ var A;
this.x = x;
this.y = y;
}
Point.Origin = function () { return { x: 0, y: 0 }; };
Point.Origin = function () {
return {
x: 0,
y: 0
};
};
return Point;
})();
A.Point = Point;
var Point;
(function (Point) {
function Origin() { return ""; } // not an error since not exported
function Origin() {
return "";
} // not an error since not exported
})(Point = A.Point || (A.Point = {}));
})(A || (A = {}));
@@ -28,7 +28,10 @@ var Point = (function () {
this.x = x;
this.y = y;
}
Point.Origin = { x: 0, y: 0 };
Point.Origin = {
x: 0,
y: 0
};
return Point;
})();
var Point;
@@ -42,7 +45,10 @@ var A;
this.x = x;
this.y = y;
}
Point.Origin = { x: 0, y: 0 };
Point.Origin = {
x: 0,
y: 0
};
return Point;
})();
A.Point = Point;
@@ -28,7 +28,10 @@ var Point = (function () {
this.x = x;
this.y = y;
}
Point.Origin = { x: 0, y: 0 };
Point.Origin = {
x: 0,
y: 0
};
return Point;
})();
var Point;
@@ -42,7 +45,10 @@ var A;
this.x = x;
this.y = y;
}
Point.Origin = { x: 0, y: 0 };
Point.Origin = {
x: 0,
y: 0
};
return Point;
})();
A.Point = Point;
@@ -8,6 +8,7 @@ class C {
var C = (function () {
function C() {
}
C.prototype.foo = function () { };
C.prototype.foo = function () {
};
return C;
})();
@@ -8,6 +8,7 @@ class C {
var C = (function () {
function C() {
}
C.prototype.bar = function () { };
C.prototype.bar = function () {
};
return C;
})();
@@ -8,6 +8,7 @@ class C {
var C = (function () {
function C() {
}
C.prototype[1] = function () { };
C.prototype[1] = function () {
};
return C;
})();
@@ -8,6 +8,7 @@ class C {
var C = (function () {
function C() {
}
C.prototype["bar"] = function () { };
C.prototype["bar"] = function () {
};
return C;
})();
@@ -0,0 +1,7 @@
tests/cases/conformance/statements/for-ofStatements/ES3For-ofTypeCheck1.ts(1,15): error TS2494: Using a string in a 'for...of' statement is only supported in ECMAScript 5 and higher.
==== tests/cases/conformance/statements/for-ofStatements/ES3For-ofTypeCheck1.ts (1 errors) ====
for (var v of "") { }
~~
!!! error TS2494: Using a string in a 'for...of' statement is only supported in ECMAScript 5 and higher.
@@ -0,0 +1,7 @@
//// [ES3For-ofTypeCheck1.ts]
for (var v of "") { }
//// [ES3For-ofTypeCheck1.js]
for (var _i = 0, _a = ""; _i < _a.length; _i++) {
var v = _a[_i];
}
@@ -0,0 +1,9 @@
//// [ES3For-ofTypeCheck2.ts]
for (var v of [true]) { }
//// [ES3For-ofTypeCheck2.js]
for (var _i = 0, _a = [
true
]; _i < _a.length; _i++) {
var v = _a[_i];
}
@@ -0,0 +1,5 @@
=== tests/cases/conformance/statements/for-ofStatements/ES3For-ofTypeCheck2.ts ===
for (var v of [true]) { }
>v : boolean
>[true] : boolean[]
@@ -0,0 +1,8 @@
tests/cases/conformance/statements/for-ofStatements/ES3For-ofTypeCheck4.ts(2,17): error TS2494: Using a string in a 'for...of' statement is only supported in ECMAScript 5 and higher.
==== tests/cases/conformance/statements/for-ofStatements/ES3For-ofTypeCheck4.ts (1 errors) ====
var union: string | string[];
for (const v of union) { }
~~~~~
!!! error TS2494: Using a string in a 'for...of' statement is only supported in ECMAScript 5 and higher.
@@ -0,0 +1,9 @@
//// [ES3For-ofTypeCheck4.ts]
var union: string | string[];
for (const v of union) { }
//// [ES3For-ofTypeCheck4.js]
var union;
for (var _i = 0; _i < union.length; _i++) {
var v = union[_i];
}
@@ -0,0 +1,9 @@
//// [ES3For-ofTypeCheck6.ts]
var union: string[] | number[];
for (var v of union) { }
//// [ES3For-ofTypeCheck6.js]
var union;
for (var _i = 0; _i < union.length; _i++) {
var v = union[_i];
}
@@ -0,0 +1,8 @@
=== tests/cases/conformance/statements/for-ofStatements/ES3For-ofTypeCheck6.ts ===
var union: string[] | number[];
>union : string[] | number[]
for (var v of union) { }
>v : string | number
>union : string[] | number[]
@@ -0,0 +1,9 @@
tests/cases/conformance/statements/for-ofStatements/ES5For-of1.ts(2,5): error TS2304: Cannot find name 'console'.
==== tests/cases/conformance/statements/for-ofStatements/ES5For-of1.ts (1 errors) ====
for (var v of ['a', 'b', 'c']) {
console.log(v);
~~~~~~~
!!! error TS2304: Cannot find name 'console'.
}
+15
View File
@@ -0,0 +1,15 @@
//// [ES5For-of1.ts]
for (var v of ['a', 'b', 'c']) {
console.log(v);
}
//// [ES5For-of1.js]
for (var _i = 0, _a = [
'a',
'b',
'c'
]; _i < _a.length; _i++) {
var v = _a[_i];
console.log(v);
}
//# sourceMappingURL=ES5For-of1.js.map
@@ -0,0 +1,2 @@
//// [ES5For-of1.js.map]
{"version":3,"file":"ES5For-of1.js","sourceRoot":"","sources":["ES5For-of1.ts"],"names":[],"mappings":"AAAA,GAAG,CAAC,CAAU,UAAe,EAAf;IAAC,GAAG;IAAE,GAAG;IAAE,GAAG;CAAC,EAAxB,cAAK,EAAL,IAAwB,CAAC;IAAzB,IAAI,CAAC,SAAA;IACN,OAAO,CAAC,GAAG,CAAC,CAAC,CAAC,CAAC;CAClB"}
@@ -0,0 +1,127 @@
===================================================================
JsFile: ES5For-of1.js
mapUrl: ES5For-of1.js.map
sourceRoot:
sources: ES5For-of1.ts
===================================================================
-------------------------------------------------------------------
emittedFile:tests/cases/conformance/statements/for-ofStatements/ES5For-of1.js
sourceFile:ES5For-of1.ts
-------------------------------------------------------------------
>>>for (var _i = 0, _a = [
1 >
2 >^^^
3 > ^
4 > ^
5 > ^^^^^^^^^^
6 > ^^
1 >
2 >for
3 >
4 > (var v of
5 > ['a', 'b', 'c']
6 >
1 >Emitted(1, 1) Source(1, 1) + SourceIndex(0)
2 >Emitted(1, 4) Source(1, 4) + SourceIndex(0)
3 >Emitted(1, 5) Source(1, 5) + SourceIndex(0)
4 >Emitted(1, 6) Source(1, 15) + SourceIndex(0)
5 >Emitted(1, 16) Source(1, 30) + SourceIndex(0)
6 >Emitted(1, 18) Source(1, 15) + SourceIndex(0)
---
>>> 'a',
1 >^^^^
2 > ^^^
3 > ^^->
1 >[
2 > 'a'
1 >Emitted(2, 5) Source(1, 16) + SourceIndex(0)
2 >Emitted(2, 8) Source(1, 19) + SourceIndex(0)
---
>>> 'b',
1->^^^^
2 > ^^^
3 > ^->
1->,
2 > 'b'
1->Emitted(3, 5) Source(1, 21) + SourceIndex(0)
2 >Emitted(3, 8) Source(1, 24) + SourceIndex(0)
---
>>> 'c'
1->^^^^
2 > ^^^
3 > ^^^^^^^^^^^^^^^^^^^^->
1->,
2 > 'c'
1->Emitted(4, 5) Source(1, 26) + SourceIndex(0)
2 >Emitted(4, 8) Source(1, 29) + SourceIndex(0)
---
>>>]; _i < _a.length; _i++) {
1->^
2 > ^^
3 > ^^^^^^^^^^^^^^
4 > ^^
5 > ^^^^
6 > ^
1->]
2 >
3 > var v
4 >
5 > var v of ['a', 'b', 'c']
6 > )
1->Emitted(5, 2) Source(1, 30) + SourceIndex(0)
2 >Emitted(5, 4) Source(1, 6) + SourceIndex(0)
3 >Emitted(5, 18) Source(1, 11) + SourceIndex(0)
4 >Emitted(5, 20) Source(1, 6) + SourceIndex(0)
5 >Emitted(5, 24) Source(1, 30) + SourceIndex(0)
6 >Emitted(5, 25) Source(1, 31) + SourceIndex(0)
---
>>> var v = _a[_i];
1 >^^^^
2 > ^^^^
3 > ^
4 > ^^^^^^^^^
5 > ^^->
1 >
2 > var
3 > v
4 >
1 >Emitted(6, 5) Source(1, 6) + SourceIndex(0)
2 >Emitted(6, 9) Source(1, 10) + SourceIndex(0)
3 >Emitted(6, 10) Source(1, 11) + SourceIndex(0)
4 >Emitted(6, 19) Source(1, 11) + SourceIndex(0)
---
>>> console.log(v);
1->^^^^
2 > ^^^^^^^
3 > ^
4 > ^^^
5 > ^
6 > ^
7 > ^
8 > ^
1-> of ['a', 'b', 'c']) {
>
2 > console
3 > .
4 > log
5 > (
6 > v
7 > )
8 > ;
1->Emitted(7, 5) Source(2, 5) + SourceIndex(0)
2 >Emitted(7, 12) Source(2, 12) + SourceIndex(0)
3 >Emitted(7, 13) Source(2, 13) + SourceIndex(0)
4 >Emitted(7, 16) Source(2, 16) + SourceIndex(0)
5 >Emitted(7, 17) Source(2, 17) + SourceIndex(0)
6 >Emitted(7, 18) Source(2, 18) + SourceIndex(0)
7 >Emitted(7, 19) Source(2, 19) + SourceIndex(0)
8 >Emitted(7, 20) Source(2, 20) + SourceIndex(0)
---
>>>}
1 >^
2 > ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^->
1 >
>}
1 >Emitted(8, 2) Source(3, 2) + SourceIndex(0)
---
>>>//# sourceMappingURL=ES5For-of1.js.map
+22
View File
@@ -0,0 +1,22 @@
//// [ES5For-of10.ts]
function foo() {
return { x: 0 };
}
for (foo().x of []) {
for (foo().x of [])
var p = foo().x;
}
//// [ES5For-of10.js]
function foo() {
return {
x: 0
};
}
for (var _i = 0, _a = []; _i < _a.length; _i++) {
foo().x = _a[_i];
for (var _b = 0, _c = []; _b < _c.length; _b++) {
foo().x = _c[_b];
var p = foo().x;
}
}
@@ -0,0 +1,29 @@
=== tests/cases/conformance/statements/for-ofStatements/ES5For-of10.ts ===
function foo() {
>foo : () => { x: number; }
return { x: 0 };
>{ x: 0 } : { x: number; }
>x : number
}
for (foo().x of []) {
>foo().x : number
>foo() : { x: number; }
>foo : () => { x: number; }
>x : number
>[] : undefined[]
for (foo().x of [])
>foo().x : number
>foo() : { x: number; }
>foo : () => { x: number; }
>x : number
>[] : undefined[]
var p = foo().x;
>p : number
>foo().x : number
>foo() : { x: number; }
>foo : () => { x: number; }
>x : number
}
+9
View File
@@ -0,0 +1,9 @@
//// [ES5For-of11.ts]
var v;
for (v of []) { }
//// [ES5For-of11.js]
var v;
for (var _i = 0, _a = []; _i < _a.length; _i++) {
v = _a[_i];
}
@@ -0,0 +1,8 @@
=== tests/cases/conformance/statements/for-ofStatements/ES5For-of11.ts ===
var v;
>v : any
for (v of []) { }
>v : any
>[] : undefined[]
@@ -0,0 +1,7 @@
tests/cases/conformance/statements/for-ofStatements/ES5For-of12.ts(1,7): error TS2364: Invalid left-hand side of assignment expression.
==== tests/cases/conformance/statements/for-ofStatements/ES5For-of12.ts (1 errors) ====
for ([""] of [[""]]) { }
~~
!!! error TS2364: Invalid left-hand side of assignment expression.
+11
View File
@@ -0,0 +1,11 @@
//// [ES5For-of12.ts]
for ([""] of [[""]]) { }
//// [ES5For-of12.js]
for (var _i = 0, _a = [
[
""
]
]; _i < _a.length; _i++) {
"" = _a[_i][0];
}
+15
View File
@@ -0,0 +1,15 @@
//// [ES5For-of13.ts]
for (let v of ['a', 'b', 'c']) {
var x = v;
}
//// [ES5For-of13.js]
for (var _i = 0, _a = [
'a',
'b',
'c'
]; _i < _a.length; _i++) {
var v = _a[_i];
var x = v;
}
//# sourceMappingURL=ES5For-of13.js.map
@@ -0,0 +1,2 @@
//// [ES5For-of13.js.map]
{"version":3,"file":"ES5For-of13.js","sourceRoot":"","sources":["ES5For-of13.ts"],"names":[],"mappings":"AAAA,GAAG,CAAC,CAAU,UAAe,EAAf;IAAC,GAAG;IAAE,GAAG;IAAE,GAAG;CAAC,EAAxB,cAAK,EAAL,IAAwB,CAAC;IAAzB,IAAI,CAAC,SAAA;IACN,IAAI,CAAC,GAAG,CAAC,CAAC;CACb"}
@@ -0,0 +1,120 @@
===================================================================
JsFile: ES5For-of13.js
mapUrl: ES5For-of13.js.map
sourceRoot:
sources: ES5For-of13.ts
===================================================================
-------------------------------------------------------------------
emittedFile:tests/cases/conformance/statements/for-ofStatements/ES5For-of13.js
sourceFile:ES5For-of13.ts
-------------------------------------------------------------------
>>>for (var _i = 0, _a = [
1 >
2 >^^^
3 > ^
4 > ^
5 > ^^^^^^^^^^
6 > ^^
1 >
2 >for
3 >
4 > (let v of
5 > ['a', 'b', 'c']
6 >
1 >Emitted(1, 1) Source(1, 1) + SourceIndex(0)
2 >Emitted(1, 4) Source(1, 4) + SourceIndex(0)
3 >Emitted(1, 5) Source(1, 5) + SourceIndex(0)
4 >Emitted(1, 6) Source(1, 15) + SourceIndex(0)
5 >Emitted(1, 16) Source(1, 30) + SourceIndex(0)
6 >Emitted(1, 18) Source(1, 15) + SourceIndex(0)
---
>>> 'a',
1 >^^^^
2 > ^^^
3 > ^^->
1 >[
2 > 'a'
1 >Emitted(2, 5) Source(1, 16) + SourceIndex(0)
2 >Emitted(2, 8) Source(1, 19) + SourceIndex(0)
---
>>> 'b',
1->^^^^
2 > ^^^
3 > ^->
1->,
2 > 'b'
1->Emitted(3, 5) Source(1, 21) + SourceIndex(0)
2 >Emitted(3, 8) Source(1, 24) + SourceIndex(0)
---
>>> 'c'
1->^^^^
2 > ^^^
3 > ^^^^^^^^^^^^^^^^^^^^->
1->,
2 > 'c'
1->Emitted(4, 5) Source(1, 26) + SourceIndex(0)
2 >Emitted(4, 8) Source(1, 29) + SourceIndex(0)
---
>>>]; _i < _a.length; _i++) {
1->^
2 > ^^
3 > ^^^^^^^^^^^^^^
4 > ^^
5 > ^^^^
6 > ^
1->]
2 >
3 > let v
4 >
5 > let v of ['a', 'b', 'c']
6 > )
1->Emitted(5, 2) Source(1, 30) + SourceIndex(0)
2 >Emitted(5, 4) Source(1, 6) + SourceIndex(0)
3 >Emitted(5, 18) Source(1, 11) + SourceIndex(0)
4 >Emitted(5, 20) Source(1, 6) + SourceIndex(0)
5 >Emitted(5, 24) Source(1, 30) + SourceIndex(0)
6 >Emitted(5, 25) Source(1, 31) + SourceIndex(0)
---
>>> var v = _a[_i];
1 >^^^^
2 > ^^^^
3 > ^
4 > ^^^^^^^^^
1 >
2 > let
3 > v
4 >
1 >Emitted(6, 5) Source(1, 6) + SourceIndex(0)
2 >Emitted(6, 9) Source(1, 10) + SourceIndex(0)
3 >Emitted(6, 10) Source(1, 11) + SourceIndex(0)
4 >Emitted(6, 19) Source(1, 11) + SourceIndex(0)
---
>>> var x = v;
1 >^^^^
2 > ^^^^
3 > ^
4 > ^^^
5 > ^
6 > ^
1 > of ['a', 'b', 'c']) {
>
2 > var
3 > x
4 > =
5 > v
6 > ;
1 >Emitted(7, 5) Source(2, 5) + SourceIndex(0)
2 >Emitted(7, 9) Source(2, 9) + SourceIndex(0)
3 >Emitted(7, 10) Source(2, 10) + SourceIndex(0)
4 >Emitted(7, 13) Source(2, 13) + SourceIndex(0)
5 >Emitted(7, 14) Source(2, 14) + SourceIndex(0)
6 >Emitted(7, 15) Source(2, 15) + SourceIndex(0)
---
>>>}
1 >^
2 > ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^->
1 >
>}
1 >Emitted(8, 2) Source(3, 2) + SourceIndex(0)
---
>>>//# sourceMappingURL=ES5For-of13.js.map
@@ -0,0 +1,9 @@
=== tests/cases/conformance/statements/for-ofStatements/ES5For-of13.ts ===
for (let v of ['a', 'b', 'c']) {
>v : string
>['a', 'b', 'c'] : string[]
var x = v;
>x : string
>v : string
}
+10
View File
@@ -0,0 +1,10 @@
//// [ES5For-of14.ts]
for (const v of []) {
var x = v;
}
//// [ES5For-of14.js]
for (var _i = 0, _a = []; _i < _a.length; _i++) {
var v = _a[_i];
var x = v;
}
@@ -0,0 +1,9 @@
=== tests/cases/conformance/statements/for-ofStatements/ES5For-of14.ts ===
for (const v of []) {
>v : any
>[] : undefined[]
var x = v;
>x : any
>v : any
}
+17
View File
@@ -0,0 +1,17 @@
//// [ES5For-of15.ts]
for (let v of []) {
v;
for (const v of []) {
var x = v;
}
}
//// [ES5For-of15.js]
for (var _i = 0, _a = []; _i < _a.length; _i++) {
var v = _a[_i];
v;
for (var _b = 0, _c = []; _b < _c.length; _b++) {
var _v = _c[_b];
var x = _v;
}
}
@@ -0,0 +1,17 @@
=== tests/cases/conformance/statements/for-ofStatements/ES5For-of15.ts ===
for (let v of []) {
>v : any
>[] : undefined[]
v;
>v : any
for (const v of []) {
>v : any
>[] : undefined[]
var x = v;
>x : any
>v : any
}
}
+19
View File
@@ -0,0 +1,19 @@
//// [ES5For-of16.ts]
for (let v of []) {
v;
for (let v of []) {
var x = v;
v++;
}
}
//// [ES5For-of16.js]
for (var _i = 0, _a = []; _i < _a.length; _i++) {
var v = _a[_i];
v;
for (var _b = 0, _c = []; _b < _c.length; _b++) {
var _v = _c[_b];
var x = _v;
_v++;
}
}
@@ -0,0 +1,21 @@
=== tests/cases/conformance/statements/for-ofStatements/ES5For-of16.ts ===
for (let v of []) {
>v : any
>[] : undefined[]
v;
>v : any
for (let v of []) {
>v : any
>[] : undefined[]
var x = v;
>x : any
>v : any
v++;
>v++ : number
>v : any
}
}
@@ -0,0 +1,13 @@
tests/cases/conformance/statements/for-ofStatements/ES5For-of17.ts(3,20): error TS2448: Block-scoped variable 'v' used before its declaration.
==== tests/cases/conformance/statements/for-ofStatements/ES5For-of17.ts (1 errors) ====
for (let v of []) {
v;
for (let v of [v]) {
~
!!! error TS2448: Block-scoped variable 'v' used before its declaration.
var x = v;
v++;
}
}
+21
View File
@@ -0,0 +1,21 @@
//// [ES5For-of17.ts]
for (let v of []) {
v;
for (let v of [v]) {
var x = v;
v++;
}
}
//// [ES5For-of17.js]
for (var _i = 0, _a = []; _i < _a.length; _i++) {
var v = _a[_i];
v;
for (var _b = 0, _c = [
v
]; _b < _c.length; _b++) {
var _v = _c[_b];
var x = _v;
_v++;
}
}
+18
View File
@@ -0,0 +1,18 @@
//// [ES5For-of18.ts]
for (let v of []) {
v;
}
for (let v of []) {
v;
}
//// [ES5For-of18.js]
for (var _i = 0, _a = []; _i < _a.length; _i++) {
var v = _a[_i];
v;
}
for (var _b = 0, _c = []; _b < _c.length; _b++) {
var _v = _c[_b];
_v;
}
@@ -0,0 +1,16 @@
=== tests/cases/conformance/statements/for-ofStatements/ES5For-of18.ts ===
for (let v of []) {
>v : any
>[] : undefined[]
v;
>v : any
}
for (let v of []) {
>v : any
>[] : undefined[]
v;
>v : any
}
+22
View File
@@ -0,0 +1,22 @@
//// [ES5For-of19.ts]
for (let v of []) {
v;
function foo() {
for (const v of []) {
v;
}
}
}
//// [ES5For-of19.js]
for (var _i = 0, _a = []; _i < _a.length; _i++) {
var v = _a[_i];
v;
function foo() {
for (var _b = 0, _c = []; _b < _c.length; _b++) {
var _v = _c[_b];
_v;
}
}
}
@@ -0,0 +1,21 @@
=== tests/cases/conformance/statements/for-ofStatements/ES5For-of19.ts ===
for (let v of []) {
>v : any
>[] : undefined[]
v;
>v : any
function foo() {
>foo : () => void
for (const v of []) {
>v : any
>[] : undefined[]
v;
>v : any
}
}
}
+10
View File
@@ -0,0 +1,10 @@
//// [ES5For-of2.ts]
for (var v of []) {
var x = v;
}
//// [ES5For-of2.js]
for (var _i = 0, _a = []; _i < _a.length; _i++) {
var v = _a[_i];
var x = v;
}
@@ -0,0 +1,9 @@
=== tests/cases/conformance/statements/for-ofStatements/ES5For-of2.ts ===
for (var v of []) {
>v : any
>[] : undefined[]
var x = v;
>x : any
>v : any
}
@@ -0,0 +1,15 @@
tests/cases/conformance/statements/for-ofStatements/ES5For-of20.ts(3,20): error TS2448: Block-scoped variable 'v' used before its declaration.
tests/cases/conformance/statements/for-ofStatements/ES5For-of20.ts(4,15): error TS1155: 'const' declarations must be initialized
==== tests/cases/conformance/statements/for-ofStatements/ES5For-of20.ts (2 errors) ====
for (let v of []) {
let v;
for (let v of [v]) {
~
!!! error TS2448: Block-scoped variable 'v' used before its declaration.
const v;
~
!!! error TS1155: 'const' declarations must be initialized
}
}
+19
View File
@@ -0,0 +1,19 @@
//// [ES5For-of20.ts]
for (let v of []) {
let v;
for (let v of [v]) {
const v;
}
}
//// [ES5For-of20.js]
for (var _i = 0, _a = []; _i < _a.length; _i++) {
var v = _a[_i];
var _v;
for (var _b = 0, _c = [
v
]; _b < _c.length; _b++) {
var _v_1 = _c[_b];
var _v_2;
}
}
+12
View File
@@ -0,0 +1,12 @@
//// [ES5For-of21.ts]
for (let v of []) {
for (let _i of []) { }
}
//// [ES5For-of21.js]
for (var _i = 0, _a = []; _i < _a.length; _i++) {
var v = _a[_i];
for (var _b = 0, _c = []; _b < _c.length; _b++) {
var _i_1 = _c[_b];
}
}
@@ -0,0 +1,9 @@
=== tests/cases/conformance/statements/for-ofStatements/ES5For-of21.ts ===
for (let v of []) {
>v : any
>[] : undefined[]
for (let _i of []) { }
>_i : any
>[] : undefined[]
}
@@ -0,0 +1,10 @@
tests/cases/conformance/statements/for-ofStatements/ES5For-of22.ts(3,5): error TS2304: Cannot find name 'console'.
==== tests/cases/conformance/statements/for-ofStatements/ES5For-of22.ts (1 errors) ====
for (var x of [1, 2, 3]) {
let _a = 0;
console.log(x);
~~~~~~~
!!! error TS2304: Cannot find name 'console'.
}
+16
View File
@@ -0,0 +1,16 @@
//// [ES5For-of22.ts]
for (var x of [1, 2, 3]) {
let _a = 0;
console.log(x);
}
//// [ES5For-of22.js]
for (var _i = 0, _a = [
1,
2,
3
]; _i < _a.length; _i++) {
var x = _a[_i];
var _a_1 = 0;
console.log(x);
}
@@ -0,0 +1,10 @@
tests/cases/conformance/statements/for-ofStatements/ES5For-of23.ts(3,5): error TS2304: Cannot find name 'console'.
==== tests/cases/conformance/statements/for-ofStatements/ES5For-of23.ts (1 errors) ====
for (var x of [1, 2, 3]) {
var _a = 0;
console.log(x);
~~~~~~~
!!! error TS2304: Cannot find name 'console'.
}
+16
View File
@@ -0,0 +1,16 @@
//// [ES5For-of23.ts]
for (var x of [1, 2, 3]) {
var _a = 0;
console.log(x);
}
//// [ES5For-of23.js]
for (var _i = 0, _b = [
1,
2,
3
]; _i < _b.length; _i++) {
var x = _b[_i];
var _a = 0;
console.log(x);
}
+16
View File
@@ -0,0 +1,16 @@
//// [ES5For-of24.ts]
var a = [1, 2, 3];
for (var v of a) {
let a = 0;
}
//// [ES5For-of24.js]
var a = [
1,
2,
3
];
for (var _i = 0; _i < a.length; _i++) {
var v = a[_i];
var _a = 0;
}
@@ -0,0 +1,12 @@
=== tests/cases/conformance/statements/for-ofStatements/ES5For-of24.ts ===
var a = [1, 2, 3];
>a : number[]
>[1, 2, 3] : number[]
for (var v of a) {
>v : number
>a : number[]
let a = 0;
>a : number
}
+19
View File
@@ -0,0 +1,19 @@
//// [ES5For-of25.ts]
var a = [1, 2, 3];
for (var v of a) {
v;
a;
}
//// [ES5For-of25.js]
var a = [
1,
2,
3
];
for (var _i = 0; _i < a.length; _i++) {
var v = a[_i];
v;
a;
}
//# sourceMappingURL=ES5For-of25.js.map
@@ -0,0 +1,2 @@
//// [ES5For-of25.js.map]
{"version":3,"file":"ES5For-of25.js","sourceRoot":"","sources":["ES5For-of25.ts"],"names":[],"mappings":"AAAA,IAAI,CAAC,GAAG;IAAC,CAAC;IAAE,CAAC;IAAE,CAAC;CAAC,CAAC;AAClB,GAAG,CAAC,CAAU,UAAC,EAAV,aAAK,EAAL,IAAU,CAAC;IAAX,IAAI,CAAC,GAAI,CAAC,IAAL;IACN,CAAC,CAAC;IACF,CAAC,CAAC;CACL"}
@@ -0,0 +1,145 @@
===================================================================
JsFile: ES5For-of25.js
mapUrl: ES5For-of25.js.map
sourceRoot:
sources: ES5For-of25.ts
===================================================================
-------------------------------------------------------------------
emittedFile:tests/cases/conformance/statements/for-ofStatements/ES5For-of25.js
sourceFile:ES5For-of25.ts
-------------------------------------------------------------------
>>>var a = [
1 >
2 >^^^^
3 > ^
4 > ^^^
1 >
2 >var
3 > a
4 > =
1 >Emitted(1, 1) Source(1, 1) + SourceIndex(0)
2 >Emitted(1, 5) Source(1, 5) + SourceIndex(0)
3 >Emitted(1, 6) Source(1, 6) + SourceIndex(0)
4 >Emitted(1, 9) Source(1, 9) + SourceIndex(0)
---
>>> 1,
1 >^^^^
2 > ^
3 > ^^->
1 >[
2 > 1
1 >Emitted(2, 5) Source(1, 10) + SourceIndex(0)
2 >Emitted(2, 6) Source(1, 11) + SourceIndex(0)
---
>>> 2,
1->^^^^
2 > ^
3 > ^->
1->,
2 > 2
1->Emitted(3, 5) Source(1, 13) + SourceIndex(0)
2 >Emitted(3, 6) Source(1, 14) + SourceIndex(0)
---
>>> 3
1->^^^^
2 > ^
1->,
2 > 3
1->Emitted(4, 5) Source(1, 16) + SourceIndex(0)
2 >Emitted(4, 6) Source(1, 17) + SourceIndex(0)
---
>>>];
1 >^
2 > ^
3 > ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^->
1 >]
2 > ;
1 >Emitted(5, 2) Source(1, 18) + SourceIndex(0)
2 >Emitted(5, 3) Source(1, 19) + SourceIndex(0)
---
>>>for (var _i = 0; _i < a.length; _i++) {
1->
2 >^^^
3 > ^
4 > ^
5 > ^^^^^^^^^^
6 > ^^
7 > ^^^^^^^^^^^^^
8 > ^^
9 > ^^^^
10> ^
1->
>
2 >for
3 >
4 > (var v of
5 > a
6 >
7 > var v
8 >
9 > var v of a
10> )
1->Emitted(6, 1) Source(2, 1) + SourceIndex(0)
2 >Emitted(6, 4) Source(2, 4) + SourceIndex(0)
3 >Emitted(6, 5) Source(2, 5) + SourceIndex(0)
4 >Emitted(6, 6) Source(2, 15) + SourceIndex(0)
5 >Emitted(6, 16) Source(2, 16) + SourceIndex(0)
6 >Emitted(6, 18) Source(2, 6) + SourceIndex(0)
7 >Emitted(6, 31) Source(2, 11) + SourceIndex(0)
8 >Emitted(6, 33) Source(2, 6) + SourceIndex(0)
9 >Emitted(6, 37) Source(2, 16) + SourceIndex(0)
10>Emitted(6, 38) Source(2, 17) + SourceIndex(0)
---
>>> var v = a[_i];
1 >^^^^
2 > ^^^^
3 > ^
4 > ^^^
5 > ^
6 > ^^^^
1 >
2 > var
3 > v
4 > of
5 > a
6 >
1 >Emitted(7, 5) Source(2, 6) + SourceIndex(0)
2 >Emitted(7, 9) Source(2, 10) + SourceIndex(0)
3 >Emitted(7, 10) Source(2, 11) + SourceIndex(0)
4 >Emitted(7, 13) Source(2, 15) + SourceIndex(0)
5 >Emitted(7, 14) Source(2, 16) + SourceIndex(0)
6 >Emitted(7, 18) Source(2, 11) + SourceIndex(0)
---
>>> v;
1 >^^^^
2 > ^
3 > ^
4 > ^->
1 > of a) {
>
2 > v
3 > ;
1 >Emitted(8, 5) Source(3, 5) + SourceIndex(0)
2 >Emitted(8, 6) Source(3, 6) + SourceIndex(0)
3 >Emitted(8, 7) Source(3, 7) + SourceIndex(0)
---
>>> a;
1->^^^^
2 > ^
3 > ^
1->
>
2 > a
3 > ;
1->Emitted(9, 5) Source(4, 5) + SourceIndex(0)
2 >Emitted(9, 6) Source(4, 6) + SourceIndex(0)
3 >Emitted(9, 7) Source(4, 7) + SourceIndex(0)
---
>>>}
1 >^
2 > ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^->
1 >
>}
1 >Emitted(10, 2) Source(5, 2) + SourceIndex(0)
---
>>>//# sourceMappingURL=ES5For-of25.js.map
@@ -0,0 +1,15 @@
=== tests/cases/conformance/statements/for-ofStatements/ES5For-of25.ts ===
var a = [1, 2, 3];
>a : number[]
>[1, 2, 3] : number[]
for (var v of a) {
>v : number
>a : number[]
v;
>v : number
a;
>a : number[]
}
@@ -0,0 +1,10 @@
tests/cases/conformance/statements/for-ofStatements/ES5For-of26.ts(1,10): error TS2461: Type 'number' is not an array type.
==== tests/cases/conformance/statements/for-ofStatements/ES5For-of26.ts (1 errors) ====
for (var [a = 0, b = 1] of [2, 3]) {
~~~~~~~~~~~~~~
!!! error TS2461: Type 'number' is not an array type.
a;
b;
}
+16
View File
@@ -0,0 +1,16 @@
//// [ES5For-of26.ts]
for (var [a = 0, b = 1] of [2, 3]) {
a;
b;
}
//// [ES5For-of26.js]
for (var _i = 0, _a = [
2,
3
]; _i < _a.length; _i++) {
var _b = _a[_i], _c = _b[0], a = _c === void 0 ? 0 : _c, _d = _b[1], b = _d === void 0 ? 1 : _d;
a;
b;
}
//# sourceMappingURL=ES5For-of26.js.map
@@ -0,0 +1,2 @@
//// [ES5For-of26.js.map]
{"version":3,"file":"ES5For-of26.js","sourceRoot":"","sources":["ES5For-of26.ts"],"names":[],"mappings":"AAAA,GAAG,CAAC,CAAuB,UAAM,EAAN;IAAC,CAAC;IAAE,CAAC;CAAC,EAA5B,cAAkB,EAAlB,IAA4B,CAAC;IAA7B,6BAAK,CAAC,mBAAG,CAAC,mBAAE,CAAC,mBAAG,CAAC,KAAC;IACnB,CAAC,CAAC;IACF,CAAC,CAAC;CACL"}
@@ -0,0 +1,134 @@
===================================================================
JsFile: ES5For-of26.js
mapUrl: ES5For-of26.js.map
sourceRoot:
sources: ES5For-of26.ts
===================================================================
-------------------------------------------------------------------
emittedFile:tests/cases/conformance/statements/for-ofStatements/ES5For-of26.js
sourceFile:ES5For-of26.ts
-------------------------------------------------------------------
>>>for (var _i = 0, _a = [
1 >
2 >^^^
3 > ^
4 > ^
5 > ^^^^^^^^^^
6 > ^^
1 >
2 >for
3 >
4 > (var [a = 0, b = 1] of
5 > [2, 3]
6 >
1 >Emitted(1, 1) Source(1, 1) + SourceIndex(0)
2 >Emitted(1, 4) Source(1, 4) + SourceIndex(0)
3 >Emitted(1, 5) Source(1, 5) + SourceIndex(0)
4 >Emitted(1, 6) Source(1, 28) + SourceIndex(0)
5 >Emitted(1, 16) Source(1, 34) + SourceIndex(0)
6 >Emitted(1, 18) Source(1, 28) + SourceIndex(0)
---
>>> 2,
1 >^^^^
2 > ^
3 > ^->
1 >[
2 > 2
1 >Emitted(2, 5) Source(1, 29) + SourceIndex(0)
2 >Emitted(2, 6) Source(1, 30) + SourceIndex(0)
---
>>> 3
1->^^^^
2 > ^
3 > ^^^^^^^^^^^^^^^^^^^^^^->
1->,
2 > 3
1->Emitted(3, 5) Source(1, 32) + SourceIndex(0)
2 >Emitted(3, 6) Source(1, 33) + SourceIndex(0)
---
>>>]; _i < _a.length; _i++) {
1->^
2 > ^^
3 > ^^^^^^^^^^^^^^
4 > ^^
5 > ^^^^
6 > ^
7 > ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^->
1->]
2 >
3 > var [a = 0, b = 1]
4 >
5 > var [a = 0, b = 1] of [2, 3]
6 > )
1->Emitted(4, 2) Source(1, 34) + SourceIndex(0)
2 >Emitted(4, 4) Source(1, 6) + SourceIndex(0)
3 >Emitted(4, 18) Source(1, 24) + SourceIndex(0)
4 >Emitted(4, 20) Source(1, 6) + SourceIndex(0)
5 >Emitted(4, 24) Source(1, 34) + SourceIndex(0)
6 >Emitted(4, 25) Source(1, 35) + SourceIndex(0)
---
>>> var _b = _a[_i], _c = _b[0], a = _c === void 0 ? 0 : _c, _d = _b[1], b = _d === void 0 ? 1 : _d;
1->^^^^
2 > ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
3 > ^
4 > ^^^^^^^^^^^^^^^^^^^
5 > ^
6 > ^^^^^^^^^^^^^^^^^^^
7 > ^
8 > ^^^^^^^^^^^^^^^^^^^
9 > ^
10> ^^^^^
1->
2 > var [
3 > a
4 > =
5 > 0
6 > ,
7 > b
8 > =
9 > 1
10> ]
1->Emitted(5, 5) Source(1, 6) + SourceIndex(0)
2 >Emitted(5, 34) Source(1, 11) + SourceIndex(0)
3 >Emitted(5, 35) Source(1, 12) + SourceIndex(0)
4 >Emitted(5, 54) Source(1, 15) + SourceIndex(0)
5 >Emitted(5, 55) Source(1, 16) + SourceIndex(0)
6 >Emitted(5, 74) Source(1, 18) + SourceIndex(0)
7 >Emitted(5, 75) Source(1, 19) + SourceIndex(0)
8 >Emitted(5, 94) Source(1, 22) + SourceIndex(0)
9 >Emitted(5, 95) Source(1, 23) + SourceIndex(0)
10>Emitted(5, 100) Source(1, 24) + SourceIndex(0)
---
>>> a;
1 >^^^^
2 > ^
3 > ^
4 > ^->
1 > of [2, 3]) {
>
2 > a
3 > ;
1 >Emitted(6, 5) Source(2, 5) + SourceIndex(0)
2 >Emitted(6, 6) Source(2, 6) + SourceIndex(0)
3 >Emitted(6, 7) Source(2, 7) + SourceIndex(0)
---
>>> b;
1->^^^^
2 > ^
3 > ^
1->
>
2 > b
3 > ;
1->Emitted(7, 5) Source(3, 5) + SourceIndex(0)
2 >Emitted(7, 6) Source(3, 6) + SourceIndex(0)
3 >Emitted(7, 7) Source(3, 7) + SourceIndex(0)
---
>>>}
1 >^
2 > ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^->
1 >
>}
1 >Emitted(8, 2) Source(4, 2) + SourceIndex(0)
---
>>>//# sourceMappingURL=ES5For-of26.js.map
@@ -0,0 +1,13 @@
tests/cases/conformance/statements/for-ofStatements/ES5For-of27.ts(1,11): error TS2459: Type 'number' has no property 'x' and no string index signature.
tests/cases/conformance/statements/for-ofStatements/ES5For-of27.ts(1,21): error TS2459: Type 'number' has no property 'y' and no string index signature.
==== tests/cases/conformance/statements/for-ofStatements/ES5For-of27.ts (2 errors) ====
for (var {x: a = 0, y: b = 1} of [2, 3]) {
~
!!! error TS2459: Type 'number' has no property 'x' and no string index signature.
~
!!! error TS2459: Type 'number' has no property 'y' and no string index signature.
a;
b;
}
+15
View File
@@ -0,0 +1,15 @@
//// [ES5For-of27.ts]
for (var {x: a = 0, y: b = 1} of [2, 3]) {
a;
b;
}
//// [ES5For-of27.js]
for (var _i = 0, _a = [
2,
3
]; _i < _a.length; _i++) {
var _b = _a[_i], _c = _b.x, a = _c === void 0 ? 0 : _c, _d = _b.y, b = _d === void 0 ? 1 : _d;
a;
b;
}
@@ -0,0 +1,10 @@
tests/cases/conformance/statements/for-ofStatements/ES5For-of28.ts(1,10): error TS2461: Type 'number' is not an array type.
==== tests/cases/conformance/statements/for-ofStatements/ES5For-of28.ts (1 errors) ====
for (let [a = 0, b = 1] of [2, 3]) {
~~~~~~~~~~~~~~
!!! error TS2461: Type 'number' is not an array type.
a;
b;
}
+15
View File
@@ -0,0 +1,15 @@
//// [ES5For-of28.ts]
for (let [a = 0, b = 1] of [2, 3]) {
a;
b;
}
//// [ES5For-of28.js]
for (var _i = 0, _a = [
2,
3
]; _i < _a.length; _i++) {
var _b = _a[_i], _c = _b[0], a = _c === void 0 ? 0 : _c, _d = _b[1], b = _d === void 0 ? 1 : _d;
a;
b;
}
@@ -0,0 +1,13 @@
tests/cases/conformance/statements/for-ofStatements/ES5For-of29.ts(1,13): error TS2459: Type 'number' has no property 'x' and no string index signature.
tests/cases/conformance/statements/for-ofStatements/ES5For-of29.ts(1,23): error TS2459: Type 'number' has no property 'y' and no string index signature.
==== tests/cases/conformance/statements/for-ofStatements/ES5For-of29.ts (2 errors) ====
for (const {x: a = 0, y: b = 1} of [2, 3]) {
~
!!! error TS2459: Type 'number' has no property 'x' and no string index signature.
~
!!! error TS2459: Type 'number' has no property 'y' and no string index signature.
a;
b;
}
+15
View File
@@ -0,0 +1,15 @@
//// [ES5For-of29.ts]
for (const {x: a = 0, y: b = 1} of [2, 3]) {
a;
b;
}
//// [ES5For-of29.js]
for (var _i = 0, _a = [
2,
3
]; _i < _a.length; _i++) {
var _b = _a[_i], _c = _b.x, a = _c === void 0 ? 0 : _c, _d = _b.y, b = _d === void 0 ? 1 : _d;
a;
b;
}
+14
View File
@@ -0,0 +1,14 @@
//// [ES5For-of3.ts]
for (var v of ['a', 'b', 'c'])
var x = v;
//// [ES5For-of3.js]
for (var _i = 0, _a = [
'a',
'b',
'c'
]; _i < _a.length; _i++) {
var v = _a[_i];
var x = v;
}
//# sourceMappingURL=ES5For-of3.js.map
@@ -0,0 +1,2 @@
//// [ES5For-of3.js.map]
{"version":3,"file":"ES5For-of3.js","sourceRoot":"","sources":["ES5For-of3.ts"],"names":[],"mappings":"AAAA,GAAG,CAAC,CAAU,UAAe,EAAf;IAAC,GAAG;IAAE,GAAG;IAAE,GAAG;CAAC,EAAxB,cAAK,EAAL,IAAwB,CAAC;IAAzB,IAAI,CAAC,SAAA;IACN,IAAI,CAAC,GAAG,CAAC,CAAC;CAAA"}
@@ -0,0 +1,119 @@
===================================================================
JsFile: ES5For-of3.js
mapUrl: ES5For-of3.js.map
sourceRoot:
sources: ES5For-of3.ts
===================================================================
-------------------------------------------------------------------
emittedFile:tests/cases/conformance/statements/for-ofStatements/ES5For-of3.js
sourceFile:ES5For-of3.ts
-------------------------------------------------------------------
>>>for (var _i = 0, _a = [
1 >
2 >^^^
3 > ^
4 > ^
5 > ^^^^^^^^^^
6 > ^^
1 >
2 >for
3 >
4 > (var v of
5 > ['a', 'b', 'c']
6 >
1 >Emitted(1, 1) Source(1, 1) + SourceIndex(0)
2 >Emitted(1, 4) Source(1, 4) + SourceIndex(0)
3 >Emitted(1, 5) Source(1, 5) + SourceIndex(0)
4 >Emitted(1, 6) Source(1, 15) + SourceIndex(0)
5 >Emitted(1, 16) Source(1, 30) + SourceIndex(0)
6 >Emitted(1, 18) Source(1, 15) + SourceIndex(0)
---
>>> 'a',
1 >^^^^
2 > ^^^
3 > ^^->
1 >[
2 > 'a'
1 >Emitted(2, 5) Source(1, 16) + SourceIndex(0)
2 >Emitted(2, 8) Source(1, 19) + SourceIndex(0)
---
>>> 'b',
1->^^^^
2 > ^^^
3 > ^->
1->,
2 > 'b'
1->Emitted(3, 5) Source(1, 21) + SourceIndex(0)
2 >Emitted(3, 8) Source(1, 24) + SourceIndex(0)
---
>>> 'c'
1->^^^^
2 > ^^^
3 > ^^^^^^^^^^^^^^^^^^^^->
1->,
2 > 'c'
1->Emitted(4, 5) Source(1, 26) + SourceIndex(0)
2 >Emitted(4, 8) Source(1, 29) + SourceIndex(0)
---
>>>]; _i < _a.length; _i++) {
1->^
2 > ^^
3 > ^^^^^^^^^^^^^^
4 > ^^
5 > ^^^^
6 > ^
1->]
2 >
3 > var v
4 >
5 > var v of ['a', 'b', 'c']
6 > )
1->Emitted(5, 2) Source(1, 30) + SourceIndex(0)
2 >Emitted(5, 4) Source(1, 6) + SourceIndex(0)
3 >Emitted(5, 18) Source(1, 11) + SourceIndex(0)
4 >Emitted(5, 20) Source(1, 6) + SourceIndex(0)
5 >Emitted(5, 24) Source(1, 30) + SourceIndex(0)
6 >Emitted(5, 25) Source(1, 31) + SourceIndex(0)
---
>>> var v = _a[_i];
1 >^^^^
2 > ^^^^
3 > ^
4 > ^^^^^^^^^
1 >
2 > var
3 > v
4 >
1 >Emitted(6, 5) Source(1, 6) + SourceIndex(0)
2 >Emitted(6, 9) Source(1, 10) + SourceIndex(0)
3 >Emitted(6, 10) Source(1, 11) + SourceIndex(0)
4 >Emitted(6, 19) Source(1, 11) + SourceIndex(0)
---
>>> var x = v;
1 >^^^^
2 > ^^^^
3 > ^
4 > ^^^
5 > ^
6 > ^
1 > of ['a', 'b', 'c'])
>
2 > var
3 > x
4 > =
5 > v
6 > ;
1 >Emitted(7, 5) Source(2, 5) + SourceIndex(0)
2 >Emitted(7, 9) Source(2, 9) + SourceIndex(0)
3 >Emitted(7, 10) Source(2, 10) + SourceIndex(0)
4 >Emitted(7, 13) Source(2, 13) + SourceIndex(0)
5 >Emitted(7, 14) Source(2, 14) + SourceIndex(0)
6 >Emitted(7, 15) Source(2, 15) + SourceIndex(0)
---
>>>}
1 >^
2 > ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^->
1 >
1 >Emitted(8, 2) Source(2, 15) + SourceIndex(0)
---
>>>//# sourceMappingURL=ES5For-of3.js.map
@@ -0,0 +1,9 @@
=== tests/cases/conformance/statements/for-ofStatements/ES5For-of3.ts ===
for (var v of ['a', 'b', 'c'])
>v : string
>['a', 'b', 'c'] : string[]
var x = v;
>x : string
>v : string
@@ -0,0 +1,12 @@
tests/cases/conformance/statements/for-ofStatements/ES5For-of30.ts(3,6): error TS2461: Type 'string | number' is not an array type.
==== tests/cases/conformance/statements/for-ofStatements/ES5For-of30.ts (1 errors) ====
var a: string, b: number;
var tuple: [number, string] = [2, "3"];
for ([a = 1, b = ""] of tuple) {
~~~~~~~~~~~~~~~
!!! error TS2461: Type 'string | number' is not an array type.
a;
b;
}
+20
View File
@@ -0,0 +1,20 @@
//// [ES5For-of30.ts]
var a: string, b: number;
var tuple: [number, string] = [2, "3"];
for ([a = 1, b = ""] of tuple) {
a;
b;
}
//// [ES5For-of30.js]
var a, b;
var tuple = [
2,
"3"
];
for (var _i = 0; _i < tuple.length; _i++) {
_a = tuple[_i], _b = _a[0], a = _b === void 0 ? 1 : _b, _c = _a[1], b = _c === void 0 ? "" : _c;
a;
b;
}
var _a, _b, _c;
@@ -0,0 +1,15 @@
tests/cases/conformance/statements/for-ofStatements/ES5For-of31.ts(3,8): error TS2459: Type 'undefined' has no property 'a' and no string index signature.
tests/cases/conformance/statements/for-ofStatements/ES5For-of31.ts(3,18): error TS2459: Type 'undefined' has no property 'b' and no string index signature.
==== tests/cases/conformance/statements/for-ofStatements/ES5For-of31.ts (2 errors) ====
var a: string, b: number;
for ({ a: b = 1, b: a = ""} of []) {
~
!!! error TS2459: Type 'undefined' has no property 'a' and no string index signature.
~
!!! error TS2459: Type 'undefined' has no property 'b' and no string index signature.
a;
b;
}
+16
View File
@@ -0,0 +1,16 @@
//// [ES5For-of31.ts]
var a: string, b: number;
for ({ a: b = 1, b: a = ""} of []) {
a;
b;
}
//// [ES5For-of31.js]
var a, b;
for (var _i = 0, _a = []; _i < _a.length; _i++) {
_b = _a[_i], _c = _b.a, b = _c === void 0 ? 1 : _c, _d = _b.b, a = _d === void 0 ? "" : _d;
a;
b;
}
var _b, _c, _d;
+11
View File
@@ -0,0 +1,11 @@
//// [ES5For-of4.ts]
for (var v of [])
var x = v;
var y = v;
//// [ES5For-of4.js]
for (var _i = 0, _a = []; _i < _a.length; _i++) {
var v = _a[_i];
var x = v;
}
var y = v;
@@ -0,0 +1,13 @@
=== tests/cases/conformance/statements/for-ofStatements/ES5For-of4.ts ===
for (var v of [])
>v : any
>[] : undefined[]
var x = v;
>x : any
>v : any
var y = v;
>y : any
>v : any
+10
View File
@@ -0,0 +1,10 @@
//// [ES5For-of5.ts]
for (var _a of []) {
var x = _a;
}
//// [ES5For-of5.js]
for (var _i = 0, _b = []; _i < _b.length; _i++) {
var _a = _b[_i];
var x = _a;
}
@@ -0,0 +1,9 @@
=== tests/cases/conformance/statements/for-ofStatements/ES5For-of5.ts ===
for (var _a of []) {
>_a : any
>[] : undefined[]
var x = _a;
>x : any
>_a : any
}
+18
View File
@@ -0,0 +1,18 @@
//// [ES5For-of6.ts]
for (var w of []) {
for (var v of []) {
var x = [w, v];
}
}
//// [ES5For-of6.js]
for (var _i = 0, _a = []; _i < _a.length; _i++) {
var w = _a[_i];
for (var _b = 0, _c = []; _b < _c.length; _b++) {
var v = _c[_b];
var x = [
w,
v
];
}
}
@@ -0,0 +1,16 @@
=== tests/cases/conformance/statements/for-ofStatements/ES5For-of6.ts ===
for (var w of []) {
>w : any
>[] : undefined[]
for (var v of []) {
>v : any
>[] : undefined[]
var x = [w, v];
>x : any[]
>[w, v] : any[]
>w : any
>v : any
}
}
@@ -0,0 +1,13 @@
tests/cases/conformance/statements/for-ofStatements/ES5For-of7.ts(6,9): error TS2403: Subsequent variable declarations must have the same type. Variable 'x' must be of type 'any', but here has type 'any[]'.
==== tests/cases/conformance/statements/for-ofStatements/ES5For-of7.ts (1 errors) ====
for (var w of []) {
var x = w;
}
for (var v of []) {
var x = [w, v];
~
!!! error TS2403: Subsequent variable declarations must have the same type. Variable 'x' must be of type 'any', but here has type 'any[]'.
}
+21
View File
@@ -0,0 +1,21 @@
//// [ES5For-of7.ts]
for (var w of []) {
var x = w;
}
for (var v of []) {
var x = [w, v];
}
//// [ES5For-of7.js]
for (var _i = 0, _a = []; _i < _a.length; _i++) {
var w = _a[_i];
var x = w;
}
for (var _b = 0, _c = []; _b < _c.length; _b++) {
var v = _c[_b];
var x = [
w,
v
];
}
@@ -0,0 +1,12 @@
tests/cases/conformance/statements/for-ofStatements/ES5For-of8.ts(4,6): error TS2322: Type 'string' is not assignable to type 'number'.
==== tests/cases/conformance/statements/for-ofStatements/ES5For-of8.ts (1 errors) ====
function foo() {
return { x: 0 };
}
for (foo().x of ['a', 'b', 'c']) {
~~~~~~~
!!! error TS2322: Type 'string' is not assignable to type 'number'.
var p = foo().x;
}

Some files were not shown because too many files have changed in this diff Show More