mirror of
https://github.com/microsoft/TypeScript.git
synced 2025-11-18 17:21:48 +00:00
Merge branch 'release-2.3' of https://github.com/Microsoft/TypeScript into release-2.3
This commit is contained in:
@@ -1,8 +0,0 @@
|
||||
[0405/094221:ERROR:tcp_listen_socket.cc(76)] Could not bind socket to 127.0.0.1:5959
|
||||
[0405/094221:ERROR:node_debugger.cc(86)] Cannot start debugger server
|
||||
[0405/094221:ERROR:tcp_listen_socket.cc(76)] Could not bind socket to 127.0.0.1:5960
|
||||
[0405/094221:ERROR:node_debugger.cc(86)] Cannot start debugger server
|
||||
[0413/114447:ERROR:tcp_listen_socket.cc(76)] Could not bind socket to 127.0.0.1:5959
|
||||
[0413/114447:ERROR:node_debugger.cc(86)] Cannot start debugger server
|
||||
[0413/114448:ERROR:tcp_listen_socket.cc(76)] Could not bind socket to 127.0.0.1:5960
|
||||
[0413/114448:ERROR:node_debugger.cc(86)] Cannot start debugger server
|
||||
+410
-260
File diff suppressed because it is too large
Load Diff
+491
-309
File diff suppressed because it is too large
Load Diff
Vendored
+32
-28
@@ -482,9 +482,11 @@ declare namespace ts {
|
||||
type DeclarationName = Identifier | StringLiteral | NumericLiteral | ComputedPropertyName | BindingPattern;
|
||||
interface Declaration extends Node {
|
||||
_declarationBrand: any;
|
||||
}
|
||||
interface NamedDeclaration extends Declaration {
|
||||
name?: DeclarationName;
|
||||
}
|
||||
interface DeclarationStatement extends Declaration, Statement {
|
||||
interface DeclarationStatement extends NamedDeclaration, Statement {
|
||||
name?: Identifier | StringLiteral | NumericLiteral;
|
||||
}
|
||||
interface ComputedPropertyName extends Node {
|
||||
@@ -495,7 +497,7 @@ declare namespace ts {
|
||||
kind: SyntaxKind.Decorator;
|
||||
expression: LeftHandSideExpression;
|
||||
}
|
||||
interface TypeParameterDeclaration extends Declaration {
|
||||
interface TypeParameterDeclaration extends NamedDeclaration {
|
||||
kind: SyntaxKind.TypeParameter;
|
||||
parent?: DeclarationWithTypeParameters;
|
||||
name: Identifier;
|
||||
@@ -503,7 +505,7 @@ declare namespace ts {
|
||||
default?: TypeNode;
|
||||
expression?: Expression;
|
||||
}
|
||||
interface SignatureDeclaration extends Declaration {
|
||||
interface SignatureDeclaration extends NamedDeclaration {
|
||||
name?: PropertyName;
|
||||
typeParameters?: NodeArray<TypeParameterDeclaration>;
|
||||
parameters: NodeArray<ParameterDeclaration>;
|
||||
@@ -516,7 +518,7 @@ declare namespace ts {
|
||||
kind: SyntaxKind.ConstructSignature;
|
||||
}
|
||||
type BindingName = Identifier | BindingPattern;
|
||||
interface VariableDeclaration extends Declaration {
|
||||
interface VariableDeclaration extends NamedDeclaration {
|
||||
kind: SyntaxKind.VariableDeclaration;
|
||||
parent?: VariableDeclarationList | CatchClause;
|
||||
name: BindingName;
|
||||
@@ -528,7 +530,7 @@ declare namespace ts {
|
||||
parent?: VariableStatement | ForStatement | ForOfStatement | ForInStatement;
|
||||
declarations: NodeArray<VariableDeclaration>;
|
||||
}
|
||||
interface ParameterDeclaration extends Declaration {
|
||||
interface ParameterDeclaration extends NamedDeclaration {
|
||||
kind: SyntaxKind.Parameter;
|
||||
parent?: SignatureDeclaration;
|
||||
dotDotDotToken?: DotDotDotToken;
|
||||
@@ -537,7 +539,7 @@ declare namespace ts {
|
||||
type?: TypeNode;
|
||||
initializer?: Expression;
|
||||
}
|
||||
interface BindingElement extends Declaration {
|
||||
interface BindingElement extends NamedDeclaration {
|
||||
kind: SyntaxKind.BindingElement;
|
||||
parent?: BindingPattern;
|
||||
propertyName?: PropertyName;
|
||||
@@ -559,7 +561,7 @@ declare namespace ts {
|
||||
type?: TypeNode;
|
||||
initializer?: Expression;
|
||||
}
|
||||
interface ObjectLiteralElement extends Declaration {
|
||||
interface ObjectLiteralElement extends NamedDeclaration {
|
||||
_objectLiteralBrandBrand: any;
|
||||
name?: PropertyName;
|
||||
}
|
||||
@@ -581,7 +583,7 @@ declare namespace ts {
|
||||
kind: SyntaxKind.SpreadAssignment;
|
||||
expression: Expression;
|
||||
}
|
||||
interface VariableLikeDeclaration extends Declaration {
|
||||
interface VariableLikeDeclaration extends NamedDeclaration {
|
||||
propertyName?: PropertyName;
|
||||
dotDotDotToken?: DotDotDotToken;
|
||||
name: DeclarationName;
|
||||
@@ -589,7 +591,7 @@ declare namespace ts {
|
||||
type?: TypeNode;
|
||||
initializer?: Expression;
|
||||
}
|
||||
interface PropertyLikeDeclaration extends Declaration {
|
||||
interface PropertyLikeDeclaration extends NamedDeclaration {
|
||||
name: PropertyName;
|
||||
}
|
||||
interface ObjectBindingPattern extends Node {
|
||||
@@ -926,7 +928,7 @@ declare namespace ts {
|
||||
}
|
||||
type EntityNameExpression = Identifier | PropertyAccessEntityNameExpression | ParenthesizedExpression;
|
||||
type EntityNameOrEntityNameExpression = EntityName | EntityNameExpression;
|
||||
interface PropertyAccessExpression extends MemberExpression, Declaration {
|
||||
interface PropertyAccessExpression extends MemberExpression, NamedDeclaration {
|
||||
kind: SyntaxKind.PropertyAccessExpression;
|
||||
expression: LeftHandSideExpression;
|
||||
name: Identifier;
|
||||
@@ -1172,7 +1174,7 @@ declare namespace ts {
|
||||
block: Block;
|
||||
}
|
||||
type DeclarationWithTypeParameters = SignatureDeclaration | ClassLikeDeclaration | InterfaceDeclaration | TypeAliasDeclaration;
|
||||
interface ClassLikeDeclaration extends Declaration {
|
||||
interface ClassLikeDeclaration extends NamedDeclaration {
|
||||
name?: Identifier;
|
||||
typeParameters?: NodeArray<TypeParameterDeclaration>;
|
||||
heritageClauses?: NodeArray<HeritageClause>;
|
||||
@@ -1185,11 +1187,11 @@ declare namespace ts {
|
||||
interface ClassExpression extends ClassLikeDeclaration, PrimaryExpression {
|
||||
kind: SyntaxKind.ClassExpression;
|
||||
}
|
||||
interface ClassElement extends Declaration {
|
||||
interface ClassElement extends NamedDeclaration {
|
||||
_classElementBrand: any;
|
||||
name?: PropertyName;
|
||||
}
|
||||
interface TypeElement extends Declaration {
|
||||
interface TypeElement extends NamedDeclaration {
|
||||
_typeElementBrand: any;
|
||||
name?: PropertyName;
|
||||
questionToken?: QuestionToken;
|
||||
@@ -1213,7 +1215,7 @@ declare namespace ts {
|
||||
typeParameters?: NodeArray<TypeParameterDeclaration>;
|
||||
type: TypeNode;
|
||||
}
|
||||
interface EnumMember extends Declaration {
|
||||
interface EnumMember extends NamedDeclaration {
|
||||
kind: SyntaxKind.EnumMember;
|
||||
parent?: EnumDeclaration;
|
||||
name: PropertyName;
|
||||
@@ -1266,13 +1268,13 @@ declare namespace ts {
|
||||
moduleSpecifier: Expression;
|
||||
}
|
||||
type NamedImportBindings = NamespaceImport | NamedImports;
|
||||
interface ImportClause extends Declaration {
|
||||
interface ImportClause extends NamedDeclaration {
|
||||
kind: SyntaxKind.ImportClause;
|
||||
parent?: ImportDeclaration;
|
||||
name?: Identifier;
|
||||
namedBindings?: NamedImportBindings;
|
||||
}
|
||||
interface NamespaceImport extends Declaration {
|
||||
interface NamespaceImport extends NamedDeclaration {
|
||||
kind: SyntaxKind.NamespaceImport;
|
||||
parent?: ImportClause;
|
||||
name: Identifier;
|
||||
@@ -1298,13 +1300,13 @@ declare namespace ts {
|
||||
elements: NodeArray<ExportSpecifier>;
|
||||
}
|
||||
type NamedImportsOrExports = NamedImports | NamedExports;
|
||||
interface ImportSpecifier extends Declaration {
|
||||
interface ImportSpecifier extends NamedDeclaration {
|
||||
kind: SyntaxKind.ImportSpecifier;
|
||||
parent?: NamedImports;
|
||||
propertyName?: Identifier;
|
||||
name: Identifier;
|
||||
}
|
||||
interface ExportSpecifier extends Declaration {
|
||||
interface ExportSpecifier extends NamedDeclaration {
|
||||
kind: SyntaxKind.ExportSpecifier;
|
||||
parent?: NamedExports;
|
||||
propertyName?: Identifier;
|
||||
@@ -1435,7 +1437,7 @@ declare namespace ts {
|
||||
kind: SyntaxKind.JSDocTypeTag;
|
||||
typeExpression: JSDocTypeExpression;
|
||||
}
|
||||
interface JSDocTypedefTag extends JSDocTag, Declaration {
|
||||
interface JSDocTypedefTag extends JSDocTag, NamedDeclaration {
|
||||
kind: SyntaxKind.JSDocTypedefTag;
|
||||
fullName?: JSDocNamespaceDeclaration | Identifier;
|
||||
name?: Identifier;
|
||||
@@ -2195,14 +2197,15 @@ declare namespace ts {
|
||||
HelperName = 4096,
|
||||
ExportName = 8192,
|
||||
LocalName = 16384,
|
||||
Indented = 32768,
|
||||
NoIndentation = 65536,
|
||||
AsyncFunctionBody = 131072,
|
||||
ReuseTempVariableScope = 262144,
|
||||
CustomPrologue = 524288,
|
||||
NoHoisting = 1048576,
|
||||
HasEndOfDeclarationMarker = 2097152,
|
||||
Iterator = 4194304,
|
||||
InternalName = 32768,
|
||||
Indented = 65536,
|
||||
NoIndentation = 131072,
|
||||
AsyncFunctionBody = 262144,
|
||||
ReuseTempVariableScope = 524288,
|
||||
CustomPrologue = 1048576,
|
||||
NoHoisting = 2097152,
|
||||
HasEndOfDeclarationMarker = 4194304,
|
||||
Iterator = 8388608,
|
||||
}
|
||||
interface EmitHelper {
|
||||
readonly name: string;
|
||||
@@ -2271,7 +2274,7 @@ declare namespace ts {
|
||||
}
|
||||
}
|
||||
declare namespace ts {
|
||||
const version = "2.3.1";
|
||||
const version = "2.3.3";
|
||||
}
|
||||
declare function setTimeout(handler: (...args: any[]) => void, timeout: number): any;
|
||||
declare function clearTimeout(handle: any): void;
|
||||
@@ -4483,6 +4486,7 @@ declare namespace ts.server {
|
||||
protected logger: Logger;
|
||||
private canUseEvents;
|
||||
constructor(opts: SessionOptions);
|
||||
constructor(host: ServerHost, cancellationToken: ServerCancellationToken, useSingleInferredProject: boolean, typingsInstaller: ITypingsInstaller, byteLength: (buf: string, encoding?: string) => number, hrtime: (start?: number[]) => number[], logger: server.Logger, canUseEvents: boolean, eventHandler?: ProjectServiceEventHandler, throttleWaitMilliseconds?: number);
|
||||
private sendRequestCompletedEvent(requestId);
|
||||
private defaultEventHandler(event);
|
||||
logError(err: Error, cmd: string): void;
|
||||
|
||||
+491
-309
File diff suppressed because it is too large
Load Diff
Vendored
+31
-28
@@ -491,9 +491,11 @@ declare namespace ts {
|
||||
type DeclarationName = Identifier | StringLiteral | NumericLiteral | ComputedPropertyName | BindingPattern;
|
||||
interface Declaration extends Node {
|
||||
_declarationBrand: any;
|
||||
}
|
||||
interface NamedDeclaration extends Declaration {
|
||||
name?: DeclarationName;
|
||||
}
|
||||
interface DeclarationStatement extends Declaration, Statement {
|
||||
interface DeclarationStatement extends NamedDeclaration, Statement {
|
||||
name?: Identifier | StringLiteral | NumericLiteral;
|
||||
}
|
||||
interface ComputedPropertyName extends Node {
|
||||
@@ -504,7 +506,7 @@ declare namespace ts {
|
||||
kind: SyntaxKind.Decorator;
|
||||
expression: LeftHandSideExpression;
|
||||
}
|
||||
interface TypeParameterDeclaration extends Declaration {
|
||||
interface TypeParameterDeclaration extends NamedDeclaration {
|
||||
kind: SyntaxKind.TypeParameter;
|
||||
parent?: DeclarationWithTypeParameters;
|
||||
name: Identifier;
|
||||
@@ -512,7 +514,7 @@ declare namespace ts {
|
||||
default?: TypeNode;
|
||||
expression?: Expression;
|
||||
}
|
||||
interface SignatureDeclaration extends Declaration {
|
||||
interface SignatureDeclaration extends NamedDeclaration {
|
||||
name?: PropertyName;
|
||||
typeParameters?: NodeArray<TypeParameterDeclaration>;
|
||||
parameters: NodeArray<ParameterDeclaration>;
|
||||
@@ -525,7 +527,7 @@ declare namespace ts {
|
||||
kind: SyntaxKind.ConstructSignature;
|
||||
}
|
||||
type BindingName = Identifier | BindingPattern;
|
||||
interface VariableDeclaration extends Declaration {
|
||||
interface VariableDeclaration extends NamedDeclaration {
|
||||
kind: SyntaxKind.VariableDeclaration;
|
||||
parent?: VariableDeclarationList | CatchClause;
|
||||
name: BindingName;
|
||||
@@ -537,7 +539,7 @@ declare namespace ts {
|
||||
parent?: VariableStatement | ForStatement | ForOfStatement | ForInStatement;
|
||||
declarations: NodeArray<VariableDeclaration>;
|
||||
}
|
||||
interface ParameterDeclaration extends Declaration {
|
||||
interface ParameterDeclaration extends NamedDeclaration {
|
||||
kind: SyntaxKind.Parameter;
|
||||
parent?: SignatureDeclaration;
|
||||
dotDotDotToken?: DotDotDotToken;
|
||||
@@ -546,7 +548,7 @@ declare namespace ts {
|
||||
type?: TypeNode;
|
||||
initializer?: Expression;
|
||||
}
|
||||
interface BindingElement extends Declaration {
|
||||
interface BindingElement extends NamedDeclaration {
|
||||
kind: SyntaxKind.BindingElement;
|
||||
parent?: BindingPattern;
|
||||
propertyName?: PropertyName;
|
||||
@@ -568,7 +570,7 @@ declare namespace ts {
|
||||
type?: TypeNode;
|
||||
initializer?: Expression;
|
||||
}
|
||||
interface ObjectLiteralElement extends Declaration {
|
||||
interface ObjectLiteralElement extends NamedDeclaration {
|
||||
_objectLiteralBrandBrand: any;
|
||||
name?: PropertyName;
|
||||
}
|
||||
@@ -590,7 +592,7 @@ declare namespace ts {
|
||||
kind: SyntaxKind.SpreadAssignment;
|
||||
expression: Expression;
|
||||
}
|
||||
interface VariableLikeDeclaration extends Declaration {
|
||||
interface VariableLikeDeclaration extends NamedDeclaration {
|
||||
propertyName?: PropertyName;
|
||||
dotDotDotToken?: DotDotDotToken;
|
||||
name: DeclarationName;
|
||||
@@ -598,7 +600,7 @@ declare namespace ts {
|
||||
type?: TypeNode;
|
||||
initializer?: Expression;
|
||||
}
|
||||
interface PropertyLikeDeclaration extends Declaration {
|
||||
interface PropertyLikeDeclaration extends NamedDeclaration {
|
||||
name: PropertyName;
|
||||
}
|
||||
interface ObjectBindingPattern extends Node {
|
||||
@@ -950,7 +952,7 @@ declare namespace ts {
|
||||
}
|
||||
type EntityNameExpression = Identifier | PropertyAccessEntityNameExpression | ParenthesizedExpression;
|
||||
type EntityNameOrEntityNameExpression = EntityName | EntityNameExpression;
|
||||
interface PropertyAccessExpression extends MemberExpression, Declaration {
|
||||
interface PropertyAccessExpression extends MemberExpression, NamedDeclaration {
|
||||
kind: SyntaxKind.PropertyAccessExpression;
|
||||
expression: LeftHandSideExpression;
|
||||
name: Identifier;
|
||||
@@ -1197,7 +1199,7 @@ declare namespace ts {
|
||||
block: Block;
|
||||
}
|
||||
type DeclarationWithTypeParameters = SignatureDeclaration | ClassLikeDeclaration | InterfaceDeclaration | TypeAliasDeclaration;
|
||||
interface ClassLikeDeclaration extends Declaration {
|
||||
interface ClassLikeDeclaration extends NamedDeclaration {
|
||||
name?: Identifier;
|
||||
typeParameters?: NodeArray<TypeParameterDeclaration>;
|
||||
heritageClauses?: NodeArray<HeritageClause>;
|
||||
@@ -1210,11 +1212,11 @@ declare namespace ts {
|
||||
interface ClassExpression extends ClassLikeDeclaration, PrimaryExpression {
|
||||
kind: SyntaxKind.ClassExpression;
|
||||
}
|
||||
interface ClassElement extends Declaration {
|
||||
interface ClassElement extends NamedDeclaration {
|
||||
_classElementBrand: any;
|
||||
name?: PropertyName;
|
||||
}
|
||||
interface TypeElement extends Declaration {
|
||||
interface TypeElement extends NamedDeclaration {
|
||||
_typeElementBrand: any;
|
||||
name?: PropertyName;
|
||||
questionToken?: QuestionToken;
|
||||
@@ -1238,7 +1240,7 @@ declare namespace ts {
|
||||
typeParameters?: NodeArray<TypeParameterDeclaration>;
|
||||
type: TypeNode;
|
||||
}
|
||||
interface EnumMember extends Declaration {
|
||||
interface EnumMember extends NamedDeclaration {
|
||||
kind: SyntaxKind.EnumMember;
|
||||
parent?: EnumDeclaration;
|
||||
name: PropertyName;
|
||||
@@ -1297,13 +1299,13 @@ declare namespace ts {
|
||||
moduleSpecifier: Expression;
|
||||
}
|
||||
type NamedImportBindings = NamespaceImport | NamedImports;
|
||||
interface ImportClause extends Declaration {
|
||||
interface ImportClause extends NamedDeclaration {
|
||||
kind: SyntaxKind.ImportClause;
|
||||
parent?: ImportDeclaration;
|
||||
name?: Identifier;
|
||||
namedBindings?: NamedImportBindings;
|
||||
}
|
||||
interface NamespaceImport extends Declaration {
|
||||
interface NamespaceImport extends NamedDeclaration {
|
||||
kind: SyntaxKind.NamespaceImport;
|
||||
parent?: ImportClause;
|
||||
name: Identifier;
|
||||
@@ -1330,13 +1332,13 @@ declare namespace ts {
|
||||
elements: NodeArray<ExportSpecifier>;
|
||||
}
|
||||
type NamedImportsOrExports = NamedImports | NamedExports;
|
||||
interface ImportSpecifier extends Declaration {
|
||||
interface ImportSpecifier extends NamedDeclaration {
|
||||
kind: SyntaxKind.ImportSpecifier;
|
||||
parent?: NamedImports;
|
||||
propertyName?: Identifier;
|
||||
name: Identifier;
|
||||
}
|
||||
interface ExportSpecifier extends Declaration {
|
||||
interface ExportSpecifier extends NamedDeclaration {
|
||||
kind: SyntaxKind.ExportSpecifier;
|
||||
parent?: NamedExports;
|
||||
propertyName?: Identifier;
|
||||
@@ -1467,7 +1469,7 @@ declare namespace ts {
|
||||
kind: SyntaxKind.JSDocTypeTag;
|
||||
typeExpression: JSDocTypeExpression;
|
||||
}
|
||||
interface JSDocTypedefTag extends JSDocTag, Declaration {
|
||||
interface JSDocTypedefTag extends JSDocTag, NamedDeclaration {
|
||||
kind: SyntaxKind.JSDocTypedefTag;
|
||||
fullName?: JSDocNamespaceDeclaration | Identifier;
|
||||
name?: Identifier;
|
||||
@@ -2320,14 +2322,15 @@ declare namespace ts {
|
||||
HelperName = 4096,
|
||||
ExportName = 8192,
|
||||
LocalName = 16384,
|
||||
Indented = 32768,
|
||||
NoIndentation = 65536,
|
||||
AsyncFunctionBody = 131072,
|
||||
ReuseTempVariableScope = 262144,
|
||||
CustomPrologue = 524288,
|
||||
NoHoisting = 1048576,
|
||||
HasEndOfDeclarationMarker = 2097152,
|
||||
Iterator = 4194304,
|
||||
InternalName = 32768,
|
||||
Indented = 65536,
|
||||
NoIndentation = 131072,
|
||||
AsyncFunctionBody = 262144,
|
||||
ReuseTempVariableScope = 524288,
|
||||
CustomPrologue = 1048576,
|
||||
NoHoisting = 2097152,
|
||||
HasEndOfDeclarationMarker = 4194304,
|
||||
Iterator = 8388608,
|
||||
}
|
||||
interface EmitHelper {
|
||||
readonly name: string;
|
||||
@@ -2515,7 +2518,7 @@ declare namespace ts {
|
||||
}
|
||||
declare namespace ts {
|
||||
/** The version of the TypeScript compiler release */
|
||||
const version = "2.3.1";
|
||||
const version = "2.3.3";
|
||||
}
|
||||
declare function setTimeout(handler: (...args: any[]) => void, timeout: number): any;
|
||||
declare function clearTimeout(handle: any): void;
|
||||
|
||||
+536
-331
File diff suppressed because it is too large
Load Diff
Vendored
+31
-28
@@ -491,9 +491,11 @@ declare namespace ts {
|
||||
type DeclarationName = Identifier | StringLiteral | NumericLiteral | ComputedPropertyName | BindingPattern;
|
||||
interface Declaration extends Node {
|
||||
_declarationBrand: any;
|
||||
}
|
||||
interface NamedDeclaration extends Declaration {
|
||||
name?: DeclarationName;
|
||||
}
|
||||
interface DeclarationStatement extends Declaration, Statement {
|
||||
interface DeclarationStatement extends NamedDeclaration, Statement {
|
||||
name?: Identifier | StringLiteral | NumericLiteral;
|
||||
}
|
||||
interface ComputedPropertyName extends Node {
|
||||
@@ -504,7 +506,7 @@ declare namespace ts {
|
||||
kind: SyntaxKind.Decorator;
|
||||
expression: LeftHandSideExpression;
|
||||
}
|
||||
interface TypeParameterDeclaration extends Declaration {
|
||||
interface TypeParameterDeclaration extends NamedDeclaration {
|
||||
kind: SyntaxKind.TypeParameter;
|
||||
parent?: DeclarationWithTypeParameters;
|
||||
name: Identifier;
|
||||
@@ -512,7 +514,7 @@ declare namespace ts {
|
||||
default?: TypeNode;
|
||||
expression?: Expression;
|
||||
}
|
||||
interface SignatureDeclaration extends Declaration {
|
||||
interface SignatureDeclaration extends NamedDeclaration {
|
||||
name?: PropertyName;
|
||||
typeParameters?: NodeArray<TypeParameterDeclaration>;
|
||||
parameters: NodeArray<ParameterDeclaration>;
|
||||
@@ -525,7 +527,7 @@ declare namespace ts {
|
||||
kind: SyntaxKind.ConstructSignature;
|
||||
}
|
||||
type BindingName = Identifier | BindingPattern;
|
||||
interface VariableDeclaration extends Declaration {
|
||||
interface VariableDeclaration extends NamedDeclaration {
|
||||
kind: SyntaxKind.VariableDeclaration;
|
||||
parent?: VariableDeclarationList | CatchClause;
|
||||
name: BindingName;
|
||||
@@ -537,7 +539,7 @@ declare namespace ts {
|
||||
parent?: VariableStatement | ForStatement | ForOfStatement | ForInStatement;
|
||||
declarations: NodeArray<VariableDeclaration>;
|
||||
}
|
||||
interface ParameterDeclaration extends Declaration {
|
||||
interface ParameterDeclaration extends NamedDeclaration {
|
||||
kind: SyntaxKind.Parameter;
|
||||
parent?: SignatureDeclaration;
|
||||
dotDotDotToken?: DotDotDotToken;
|
||||
@@ -546,7 +548,7 @@ declare namespace ts {
|
||||
type?: TypeNode;
|
||||
initializer?: Expression;
|
||||
}
|
||||
interface BindingElement extends Declaration {
|
||||
interface BindingElement extends NamedDeclaration {
|
||||
kind: SyntaxKind.BindingElement;
|
||||
parent?: BindingPattern;
|
||||
propertyName?: PropertyName;
|
||||
@@ -568,7 +570,7 @@ declare namespace ts {
|
||||
type?: TypeNode;
|
||||
initializer?: Expression;
|
||||
}
|
||||
interface ObjectLiteralElement extends Declaration {
|
||||
interface ObjectLiteralElement extends NamedDeclaration {
|
||||
_objectLiteralBrandBrand: any;
|
||||
name?: PropertyName;
|
||||
}
|
||||
@@ -590,7 +592,7 @@ declare namespace ts {
|
||||
kind: SyntaxKind.SpreadAssignment;
|
||||
expression: Expression;
|
||||
}
|
||||
interface VariableLikeDeclaration extends Declaration {
|
||||
interface VariableLikeDeclaration extends NamedDeclaration {
|
||||
propertyName?: PropertyName;
|
||||
dotDotDotToken?: DotDotDotToken;
|
||||
name: DeclarationName;
|
||||
@@ -598,7 +600,7 @@ declare namespace ts {
|
||||
type?: TypeNode;
|
||||
initializer?: Expression;
|
||||
}
|
||||
interface PropertyLikeDeclaration extends Declaration {
|
||||
interface PropertyLikeDeclaration extends NamedDeclaration {
|
||||
name: PropertyName;
|
||||
}
|
||||
interface ObjectBindingPattern extends Node {
|
||||
@@ -950,7 +952,7 @@ declare namespace ts {
|
||||
}
|
||||
type EntityNameExpression = Identifier | PropertyAccessEntityNameExpression | ParenthesizedExpression;
|
||||
type EntityNameOrEntityNameExpression = EntityName | EntityNameExpression;
|
||||
interface PropertyAccessExpression extends MemberExpression, Declaration {
|
||||
interface PropertyAccessExpression extends MemberExpression, NamedDeclaration {
|
||||
kind: SyntaxKind.PropertyAccessExpression;
|
||||
expression: LeftHandSideExpression;
|
||||
name: Identifier;
|
||||
@@ -1197,7 +1199,7 @@ declare namespace ts {
|
||||
block: Block;
|
||||
}
|
||||
type DeclarationWithTypeParameters = SignatureDeclaration | ClassLikeDeclaration | InterfaceDeclaration | TypeAliasDeclaration;
|
||||
interface ClassLikeDeclaration extends Declaration {
|
||||
interface ClassLikeDeclaration extends NamedDeclaration {
|
||||
name?: Identifier;
|
||||
typeParameters?: NodeArray<TypeParameterDeclaration>;
|
||||
heritageClauses?: NodeArray<HeritageClause>;
|
||||
@@ -1210,11 +1212,11 @@ declare namespace ts {
|
||||
interface ClassExpression extends ClassLikeDeclaration, PrimaryExpression {
|
||||
kind: SyntaxKind.ClassExpression;
|
||||
}
|
||||
interface ClassElement extends Declaration {
|
||||
interface ClassElement extends NamedDeclaration {
|
||||
_classElementBrand: any;
|
||||
name?: PropertyName;
|
||||
}
|
||||
interface TypeElement extends Declaration {
|
||||
interface TypeElement extends NamedDeclaration {
|
||||
_typeElementBrand: any;
|
||||
name?: PropertyName;
|
||||
questionToken?: QuestionToken;
|
||||
@@ -1238,7 +1240,7 @@ declare namespace ts {
|
||||
typeParameters?: NodeArray<TypeParameterDeclaration>;
|
||||
type: TypeNode;
|
||||
}
|
||||
interface EnumMember extends Declaration {
|
||||
interface EnumMember extends NamedDeclaration {
|
||||
kind: SyntaxKind.EnumMember;
|
||||
parent?: EnumDeclaration;
|
||||
name: PropertyName;
|
||||
@@ -1297,13 +1299,13 @@ declare namespace ts {
|
||||
moduleSpecifier: Expression;
|
||||
}
|
||||
type NamedImportBindings = NamespaceImport | NamedImports;
|
||||
interface ImportClause extends Declaration {
|
||||
interface ImportClause extends NamedDeclaration {
|
||||
kind: SyntaxKind.ImportClause;
|
||||
parent?: ImportDeclaration;
|
||||
name?: Identifier;
|
||||
namedBindings?: NamedImportBindings;
|
||||
}
|
||||
interface NamespaceImport extends Declaration {
|
||||
interface NamespaceImport extends NamedDeclaration {
|
||||
kind: SyntaxKind.NamespaceImport;
|
||||
parent?: ImportClause;
|
||||
name: Identifier;
|
||||
@@ -1330,13 +1332,13 @@ declare namespace ts {
|
||||
elements: NodeArray<ExportSpecifier>;
|
||||
}
|
||||
type NamedImportsOrExports = NamedImports | NamedExports;
|
||||
interface ImportSpecifier extends Declaration {
|
||||
interface ImportSpecifier extends NamedDeclaration {
|
||||
kind: SyntaxKind.ImportSpecifier;
|
||||
parent?: NamedImports;
|
||||
propertyName?: Identifier;
|
||||
name: Identifier;
|
||||
}
|
||||
interface ExportSpecifier extends Declaration {
|
||||
interface ExportSpecifier extends NamedDeclaration {
|
||||
kind: SyntaxKind.ExportSpecifier;
|
||||
parent?: NamedExports;
|
||||
propertyName?: Identifier;
|
||||
@@ -1467,7 +1469,7 @@ declare namespace ts {
|
||||
kind: SyntaxKind.JSDocTypeTag;
|
||||
typeExpression: JSDocTypeExpression;
|
||||
}
|
||||
interface JSDocTypedefTag extends JSDocTag, Declaration {
|
||||
interface JSDocTypedefTag extends JSDocTag, NamedDeclaration {
|
||||
kind: SyntaxKind.JSDocTypedefTag;
|
||||
fullName?: JSDocNamespaceDeclaration | Identifier;
|
||||
name?: Identifier;
|
||||
@@ -2320,14 +2322,15 @@ declare namespace ts {
|
||||
HelperName = 4096,
|
||||
ExportName = 8192,
|
||||
LocalName = 16384,
|
||||
Indented = 32768,
|
||||
NoIndentation = 65536,
|
||||
AsyncFunctionBody = 131072,
|
||||
ReuseTempVariableScope = 262144,
|
||||
CustomPrologue = 524288,
|
||||
NoHoisting = 1048576,
|
||||
HasEndOfDeclarationMarker = 2097152,
|
||||
Iterator = 4194304,
|
||||
InternalName = 32768,
|
||||
Indented = 65536,
|
||||
NoIndentation = 131072,
|
||||
AsyncFunctionBody = 262144,
|
||||
ReuseTempVariableScope = 524288,
|
||||
CustomPrologue = 1048576,
|
||||
NoHoisting = 2097152,
|
||||
HasEndOfDeclarationMarker = 4194304,
|
||||
Iterator = 8388608,
|
||||
}
|
||||
interface EmitHelper {
|
||||
readonly name: string;
|
||||
@@ -2515,7 +2518,7 @@ declare namespace ts {
|
||||
}
|
||||
declare namespace ts {
|
||||
/** The version of the TypeScript compiler release */
|
||||
const version = "2.3.1";
|
||||
const version = "2.3.3";
|
||||
}
|
||||
declare function setTimeout(handler: (...args: any[]) => void, timeout: number): any;
|
||||
declare function clearTimeout(handle: any): void;
|
||||
|
||||
+536
-331
File diff suppressed because it is too large
Load Diff
@@ -152,7 +152,7 @@ var ts;
|
||||
})(ts || (ts = {}));
|
||||
var ts;
|
||||
(function (ts) {
|
||||
ts.version = "2.3.1";
|
||||
ts.version = "2.3.3";
|
||||
})(ts || (ts = {}));
|
||||
(function (ts) {
|
||||
ts.collator = typeof Intl === "object" && typeof Intl.Collator === "function" ? new Intl.Collator(undefined, { usage: "sort", sensitivity: "accent" }) : undefined;
|
||||
|
||||
+1
-1
@@ -2,7 +2,7 @@
|
||||
"name": "typescript",
|
||||
"author": "Microsoft Corp.",
|
||||
"homepage": "http://typescriptlang.org/",
|
||||
"version": "2.3.1",
|
||||
"version": "2.3.3",
|
||||
"license": "Apache-2.0",
|
||||
"description": "TypeScript is a language for application scale JavaScript development",
|
||||
"keywords": [
|
||||
|
||||
+14
-13
@@ -227,12 +227,13 @@ namespace ts {
|
||||
// Should not be called on a declaration with a computed property name,
|
||||
// unless it is a well known Symbol.
|
||||
function getDeclarationName(node: Declaration): string {
|
||||
if (node.name) {
|
||||
const name = getNameOfDeclaration(node);
|
||||
if (name) {
|
||||
if (isAmbientModule(node)) {
|
||||
return isGlobalScopeAugmentation(<ModuleDeclaration>node) ? "__global" : `"${(<LiteralExpression>node.name).text}"`;
|
||||
return isGlobalScopeAugmentation(<ModuleDeclaration>node) ? "__global" : `"${(<LiteralExpression>name).text}"`;
|
||||
}
|
||||
if (node.name.kind === SyntaxKind.ComputedPropertyName) {
|
||||
const nameExpression = (<ComputedPropertyName>node.name).expression;
|
||||
if (name.kind === SyntaxKind.ComputedPropertyName) {
|
||||
const nameExpression = (<ComputedPropertyName>name).expression;
|
||||
// treat computed property names where expression is string/numeric literal as just string/numeric literal
|
||||
if (isStringOrNumericLiteral(nameExpression)) {
|
||||
return nameExpression.text;
|
||||
@@ -241,7 +242,7 @@ namespace ts {
|
||||
Debug.assert(isWellKnownSymbolSyntactically(nameExpression));
|
||||
return getPropertyNameForKnownSymbolName((<PropertyAccessExpression>nameExpression).name.text);
|
||||
}
|
||||
return (<Identifier | LiteralExpression>node.name).text;
|
||||
return (<Identifier | LiteralExpression>name).text;
|
||||
}
|
||||
switch (node.kind) {
|
||||
case SyntaxKind.Constructor:
|
||||
@@ -303,7 +304,7 @@ namespace ts {
|
||||
}
|
||||
|
||||
function getDisplayName(node: Declaration): string {
|
||||
return node.name ? declarationNameToString(node.name) : getDeclarationName(node);
|
||||
return (node as NamedDeclaration).name ? declarationNameToString((node as NamedDeclaration).name) : getDeclarationName(node);
|
||||
}
|
||||
|
||||
/**
|
||||
@@ -366,8 +367,8 @@ namespace ts {
|
||||
symbolTable.set(name, symbol = createSymbol(SymbolFlags.None, name));
|
||||
}
|
||||
else {
|
||||
if (node.name) {
|
||||
node.name.parent = node;
|
||||
if ((node as NamedDeclaration).name) {
|
||||
(node as NamedDeclaration).name.parent = node;
|
||||
}
|
||||
|
||||
// Report errors every position with duplicate declaration
|
||||
@@ -396,9 +397,9 @@ namespace ts {
|
||||
}
|
||||
|
||||
forEach(symbol.declarations, declaration => {
|
||||
file.bindDiagnostics.push(createDiagnosticForNode(declaration.name || declaration, message, getDisplayName(declaration)));
|
||||
file.bindDiagnostics.push(createDiagnosticForNode(getNameOfDeclaration(declaration) || declaration, message, getDisplayName(declaration)));
|
||||
});
|
||||
file.bindDiagnostics.push(createDiagnosticForNode(node.name || node, message, getDisplayName(node)));
|
||||
file.bindDiagnostics.push(createDiagnosticForNode(getNameOfDeclaration(node) || node, message, getDisplayName(node)));
|
||||
|
||||
symbol = createSymbol(SymbolFlags.None, name);
|
||||
}
|
||||
@@ -439,9 +440,9 @@ namespace ts {
|
||||
// and this case is specially handled. Module augmentations should only be merged with original module definition
|
||||
// and should never be merged directly with other augmentation, and the latter case would be possible if automatic merge is allowed.
|
||||
const isJSDocTypedefInJSDocNamespace = node.kind === SyntaxKind.JSDocTypedefTag &&
|
||||
node.name &&
|
||||
node.name.kind === SyntaxKind.Identifier &&
|
||||
(<Identifier>node.name).isInJSDocNamespace;
|
||||
(node as JSDocTypedefTag).name &&
|
||||
(node as JSDocTypedefTag).name.kind === SyntaxKind.Identifier &&
|
||||
((node as JSDocTypedefTag).name as Identifier).isInJSDocNamespace;
|
||||
if ((!isAmbientModule(node) && (hasExportModifier || container.flags & NodeFlags.ExportContext)) || isJSDocTypedefInJSDocNamespace) {
|
||||
const exportKind =
|
||||
(symbolFlags & SymbolFlags.Value ? SymbolFlags.ExportValue : 0) |
|
||||
|
||||
+233
-150
@@ -580,16 +580,16 @@ namespace ts {
|
||||
recordMergedSymbol(target, source);
|
||||
}
|
||||
else if (target.flags & SymbolFlags.NamespaceModule) {
|
||||
error(source.declarations[0].name, Diagnostics.Cannot_augment_module_0_with_value_exports_because_it_resolves_to_a_non_module_entity, symbolToString(target));
|
||||
error(getNameOfDeclaration(source.declarations[0]), Diagnostics.Cannot_augment_module_0_with_value_exports_because_it_resolves_to_a_non_module_entity, symbolToString(target));
|
||||
}
|
||||
else {
|
||||
const message = target.flags & SymbolFlags.BlockScopedVariable || source.flags & SymbolFlags.BlockScopedVariable
|
||||
? Diagnostics.Cannot_redeclare_block_scoped_variable_0 : Diagnostics.Duplicate_identifier_0;
|
||||
forEach(source.declarations, node => {
|
||||
error(node.name ? node.name : node, message, symbolToString(source));
|
||||
error(getNameOfDeclaration(node) || node, message, symbolToString(source));
|
||||
});
|
||||
forEach(target.declarations, node => {
|
||||
error(node.name ? node.name : node, message, symbolToString(source));
|
||||
error(getNameOfDeclaration(node) || node, message, symbolToString(source));
|
||||
});
|
||||
}
|
||||
}
|
||||
@@ -732,7 +732,8 @@ namespace ts {
|
||||
const useFile = getSourceFileOfNode(usage);
|
||||
if (declarationFile !== useFile) {
|
||||
if ((modulekind && (declarationFile.externalModuleIndicator || useFile.externalModuleIndicator)) ||
|
||||
(!compilerOptions.outFile && !compilerOptions.out)) {
|
||||
(!compilerOptions.outFile && !compilerOptions.out) ||
|
||||
isInAmbientContext(declaration)) {
|
||||
// nodes are in different files and order cannot be determined
|
||||
return true;
|
||||
}
|
||||
@@ -1240,13 +1241,13 @@ namespace ts {
|
||||
|
||||
if (!isInAmbientContext(declaration) && !isBlockScopedNameDeclaredBeforeUse(declaration, errorLocation)) {
|
||||
if (result.flags & SymbolFlags.BlockScopedVariable) {
|
||||
error(errorLocation, Diagnostics.Block_scoped_variable_0_used_before_its_declaration, declarationNameToString(declaration.name));
|
||||
error(errorLocation, Diagnostics.Block_scoped_variable_0_used_before_its_declaration, declarationNameToString(getNameOfDeclaration(declaration)));
|
||||
}
|
||||
else if (result.flags & SymbolFlags.Class) {
|
||||
error(errorLocation, Diagnostics.Class_0_used_before_its_declaration, declarationNameToString(declaration.name));
|
||||
error(errorLocation, Diagnostics.Class_0_used_before_its_declaration, declarationNameToString(getNameOfDeclaration(declaration)));
|
||||
}
|
||||
else if (result.flags & SymbolFlags.Enum) {
|
||||
error(errorLocation, Diagnostics.Enum_0_used_before_its_declaration, declarationNameToString(declaration.name));
|
||||
error(errorLocation, Diagnostics.Enum_0_used_before_its_declaration, declarationNameToString(getNameOfDeclaration(declaration)));
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -2805,8 +2806,9 @@ namespace ts {
|
||||
function getNameOfSymbol(symbol: Symbol): string {
|
||||
const declaration = firstOrUndefined(symbol.declarations);
|
||||
if (declaration) {
|
||||
if (declaration.name) {
|
||||
return declarationNameToString(declaration.name);
|
||||
const name = getNameOfDeclaration(declaration);
|
||||
if (name) {
|
||||
return declarationNameToString(name);
|
||||
}
|
||||
if (declaration.parent && declaration.parent.kind === SyntaxKind.VariableDeclaration) {
|
||||
return declarationNameToString((<VariableDeclaration>declaration.parent).name);
|
||||
@@ -2893,8 +2895,9 @@ namespace ts {
|
||||
function getNameOfSymbol(symbol: Symbol): string {
|
||||
if (symbol.declarations && symbol.declarations.length) {
|
||||
const declaration = symbol.declarations[0];
|
||||
if (declaration.name) {
|
||||
return declarationNameToString(declaration.name);
|
||||
const name = getNameOfDeclaration(declaration);
|
||||
if (name) {
|
||||
return declarationNameToString(name);
|
||||
}
|
||||
if (declaration.parent && declaration.parent.kind === SyntaxKind.VariableDeclaration) {
|
||||
return declarationNameToString((<VariableDeclaration>declaration.parent).name);
|
||||
@@ -3631,8 +3634,8 @@ namespace ts {
|
||||
case SyntaxKind.BindingElement:
|
||||
return isDeclarationVisible(<Declaration>node.parent.parent);
|
||||
case SyntaxKind.VariableDeclaration:
|
||||
if (isBindingPattern(node.name) &&
|
||||
!(<BindingPattern>node.name).elements.length) {
|
||||
if (isBindingPattern((node as VariableDeclaration).name) &&
|
||||
!((node as VariableDeclaration).name as BindingPattern).elements.length) {
|
||||
// If the binding pattern is empty, this variable declaration is not visible
|
||||
return false;
|
||||
}
|
||||
@@ -6233,8 +6236,8 @@ namespace ts {
|
||||
case SyntaxKind.MethodDeclaration:
|
||||
case SyntaxKind.GetAccessor:
|
||||
case SyntaxKind.SetAccessor:
|
||||
return (<Declaration>node).name.kind === SyntaxKind.ComputedPropertyName
|
||||
&& traverse((<Declaration>node).name);
|
||||
return (<NamedDeclaration>node).name.kind === SyntaxKind.ComputedPropertyName
|
||||
&& traverse((<NamedDeclaration>node).name);
|
||||
|
||||
default:
|
||||
return !nodeStartsNewLexicalEnvironment(node) && !isPartOfTypeNode(node) && forEachChild(node, traverse);
|
||||
@@ -6314,8 +6317,9 @@ namespace ts {
|
||||
type = anyType;
|
||||
if (noImplicitAny) {
|
||||
const declaration = <Declaration>signature.declaration;
|
||||
if (declaration.name) {
|
||||
error(declaration.name, Diagnostics._0_implicitly_has_return_type_any_because_it_does_not_have_a_return_type_annotation_and_is_referenced_directly_or_indirectly_in_one_of_its_return_expressions, declarationNameToString(declaration.name));
|
||||
const name = getNameOfDeclaration(declaration);
|
||||
if (name) {
|
||||
error(name, Diagnostics._0_implicitly_has_return_type_any_because_it_does_not_have_a_return_type_annotation_and_is_referenced_directly_or_indirectly_in_one_of_its_return_expressions, declarationNameToString(name));
|
||||
}
|
||||
else {
|
||||
error(declaration, Diagnostics.Function_implicitly_has_return_type_any_because_it_does_not_have_a_return_type_annotation_and_is_referenced_directly_or_indirectly_in_one_of_its_return_expressions);
|
||||
@@ -8667,29 +8671,6 @@ namespace ts {
|
||||
return Ternary.False;
|
||||
}
|
||||
|
||||
// Check if a property with the given name is known anywhere in the given type. In an object type, a property
|
||||
// is considered known if the object type is empty and the check is for assignability, if the object type has
|
||||
// index signatures, or if the property is actually declared in the object type. In a union or intersection
|
||||
// type, a property is considered known if it is known in any constituent type.
|
||||
function isKnownProperty(type: Type, name: string, isComparingJsxAttributes: boolean): boolean {
|
||||
if (type.flags & TypeFlags.Object) {
|
||||
const resolved = resolveStructuredTypeMembers(<ObjectType>type);
|
||||
if (resolved.stringIndexInfo || resolved.numberIndexInfo && isNumericLiteralName(name) ||
|
||||
getPropertyOfType(type, name) || isComparingJsxAttributes && !isUnhyphenatedJsxName(name)) {
|
||||
// For JSXAttributes, if the attribute has a hyphenated name, consider that the attribute to be known.
|
||||
return true;
|
||||
}
|
||||
}
|
||||
else if (type.flags & TypeFlags.UnionOrIntersection) {
|
||||
for (const t of (<UnionOrIntersectionType>type).types) {
|
||||
if (isKnownProperty(t, name, isComparingJsxAttributes)) {
|
||||
return true;
|
||||
}
|
||||
}
|
||||
}
|
||||
return false;
|
||||
}
|
||||
|
||||
function hasExcessProperties(source: FreshObjectLiteralType, target: Type, reportErrors: boolean): boolean {
|
||||
if (maybeTypeOfKind(target, TypeFlags.Object) && !(getObjectFlags(target) & ObjectFlags.ObjectLiteralPatternWithComputedProperties)) {
|
||||
const isComparingJsxAttributes = !!(source.flags & TypeFlags.JsxAttributes);
|
||||
@@ -9204,25 +9185,39 @@ namespace ts {
|
||||
let result = Ternary.True;
|
||||
const saveErrorInfo = errorInfo;
|
||||
|
||||
outer: for (const t of targetSignatures) {
|
||||
// Only elaborate errors from the first failure
|
||||
let shouldElaborateErrors = reportErrors;
|
||||
for (const s of sourceSignatures) {
|
||||
const related = signatureRelatedTo(s, t, shouldElaborateErrors);
|
||||
if (related) {
|
||||
result &= related;
|
||||
errorInfo = saveErrorInfo;
|
||||
continue outer;
|
||||
if (getObjectFlags(source) & ObjectFlags.Instantiated && getObjectFlags(target) & ObjectFlags.Instantiated && source.symbol === target.symbol) {
|
||||
// We instantiations of the same anonymous type (which typically will be the type of a method).
|
||||
// Simply do a pairwise comparison of the signatures in the two signature lists instead of the
|
||||
// much more expensive N * M comparison matrix we explore below.
|
||||
for (let i = 0; i < targetSignatures.length; i++) {
|
||||
const related = signatureRelatedTo(sourceSignatures[i], targetSignatures[i], reportErrors);
|
||||
if (!related) {
|
||||
return Ternary.False;
|
||||
}
|
||||
shouldElaborateErrors = false;
|
||||
result &= related;
|
||||
}
|
||||
}
|
||||
else {
|
||||
outer: for (const t of targetSignatures) {
|
||||
// Only elaborate errors from the first failure
|
||||
let shouldElaborateErrors = reportErrors;
|
||||
for (const s of sourceSignatures) {
|
||||
const related = signatureRelatedTo(s, t, shouldElaborateErrors);
|
||||
if (related) {
|
||||
result &= related;
|
||||
errorInfo = saveErrorInfo;
|
||||
continue outer;
|
||||
}
|
||||
shouldElaborateErrors = false;
|
||||
}
|
||||
|
||||
if (shouldElaborateErrors) {
|
||||
reportError(Diagnostics.Type_0_provides_no_match_for_the_signature_1,
|
||||
typeToString(source),
|
||||
signatureToString(t, /*enclosingDeclaration*/ undefined, /*flags*/ undefined, kind));
|
||||
if (shouldElaborateErrors) {
|
||||
reportError(Diagnostics.Type_0_provides_no_match_for_the_signature_1,
|
||||
typeToString(source),
|
||||
signatureToString(t, /*enclosingDeclaration*/ undefined, /*flags*/ undefined, kind));
|
||||
}
|
||||
return Ternary.False;
|
||||
}
|
||||
return Ternary.False;
|
||||
}
|
||||
return result;
|
||||
}
|
||||
@@ -9885,7 +9880,7 @@ namespace ts {
|
||||
case SyntaxKind.SetAccessor:
|
||||
case SyntaxKind.FunctionExpression:
|
||||
case SyntaxKind.ArrowFunction:
|
||||
if (!declaration.name) {
|
||||
if (!(declaration as NamedDeclaration).name) {
|
||||
error(declaration, Diagnostics.Function_expression_which_lacks_return_type_annotation_implicitly_has_an_0_return_type, typeAsString);
|
||||
return;
|
||||
}
|
||||
@@ -9894,7 +9889,7 @@ namespace ts {
|
||||
default:
|
||||
diagnostic = Diagnostics.Variable_0_implicitly_has_an_1_type;
|
||||
}
|
||||
error(declaration, diagnostic, declarationNameToString(declaration.name), typeAsString);
|
||||
error(declaration, diagnostic, declarationNameToString(getNameOfDeclaration(declaration)), typeAsString);
|
||||
}
|
||||
|
||||
function reportErrorsFromWidening(declaration: Declaration, type: Type) {
|
||||
@@ -11799,7 +11794,7 @@ namespace ts {
|
||||
if (type === autoType || type === autoArrayType) {
|
||||
if (flowType === autoType || flowType === autoArrayType) {
|
||||
if (noImplicitAny) {
|
||||
error(declaration.name, Diagnostics.Variable_0_implicitly_has_type_1_in_some_locations_where_its_type_cannot_be_determined, symbolToString(symbol), typeToString(flowType));
|
||||
error(getNameOfDeclaration(declaration), Diagnostics.Variable_0_implicitly_has_type_1_in_some_locations_where_its_type_cannot_be_determined, symbolToString(symbol), typeToString(flowType));
|
||||
error(node, Diagnostics.Variable_0_implicitly_has_an_1_type, symbolToString(symbol), typeToString(flowType));
|
||||
}
|
||||
return convertAutoToAny(flowType);
|
||||
@@ -13211,6 +13206,11 @@ namespace ts {
|
||||
let attributesTable = createMap<Symbol>();
|
||||
let spread: Type = emptyObjectType;
|
||||
let attributesArray: Symbol[] = [];
|
||||
let hasSpreadAnyType = false;
|
||||
let typeToIntersect: Type;
|
||||
let explicitlySpecifyChildrenAttribute = false;
|
||||
const jsxChildrenPropertyName = getJsxElementChildrenPropertyname();
|
||||
|
||||
for (const attributeDecl of attributes.properties) {
|
||||
const member = attributeDecl.symbol;
|
||||
if (isJsxAttribute(attributeDecl)) {
|
||||
@@ -13228,6 +13228,9 @@ namespace ts {
|
||||
attributeSymbol.target = member;
|
||||
attributesTable.set(attributeSymbol.name, attributeSymbol);
|
||||
attributesArray.push(attributeSymbol);
|
||||
if (attributeDecl.name.text === jsxChildrenPropertyName) {
|
||||
explicitlySpecifyChildrenAttribute = true;
|
||||
}
|
||||
}
|
||||
else {
|
||||
Debug.assert(attributeDecl.kind === SyntaxKind.JsxSpreadAttribute);
|
||||
@@ -13237,33 +13240,36 @@ namespace ts {
|
||||
attributesTable = createMap<Symbol>();
|
||||
}
|
||||
const exprType = checkExpression(attributeDecl.expression);
|
||||
if (!isValidSpreadType(exprType)) {
|
||||
error(attributeDecl, Diagnostics.Spread_types_may_only_be_created_from_object_types);
|
||||
return anyType;
|
||||
}
|
||||
if (isTypeAny(exprType)) {
|
||||
return anyType;
|
||||
hasSpreadAnyType = true;
|
||||
}
|
||||
if (isValidSpreadType(exprType)) {
|
||||
spread = getSpreadType(spread, exprType);
|
||||
}
|
||||
else {
|
||||
typeToIntersect = typeToIntersect ? getIntersectionType([typeToIntersect, exprType]) : exprType;
|
||||
}
|
||||
spread = getSpreadType(spread, exprType);
|
||||
}
|
||||
}
|
||||
|
||||
if (spread !== emptyObjectType) {
|
||||
if (attributesArray.length > 0) {
|
||||
spread = getSpreadType(spread, createJsxAttributesType(attributes.symbol, attributesTable));
|
||||
attributesArray = [];
|
||||
attributesTable = createMap<Symbol>();
|
||||
}
|
||||
attributesArray = getPropertiesOfType(spread);
|
||||
}
|
||||
|
||||
attributesTable = createMap<Symbol>();
|
||||
if (attributesArray) {
|
||||
forEach(attributesArray, (attr) => {
|
||||
if (!filter || filter(attr)) {
|
||||
attributesTable.set(attr.name, attr);
|
||||
if (!hasSpreadAnyType) {
|
||||
if (spread !== emptyObjectType) {
|
||||
if (attributesArray.length > 0) {
|
||||
spread = getSpreadType(spread, createJsxAttributesType(attributes.symbol, attributesTable));
|
||||
attributesArray = [];
|
||||
attributesTable = createMap<Symbol>();
|
||||
}
|
||||
});
|
||||
attributesArray = getPropertiesOfType(spread);
|
||||
}
|
||||
|
||||
attributesTable = createMap<Symbol>();
|
||||
if (attributesArray) {
|
||||
forEach(attributesArray, (attr) => {
|
||||
if (!filter || filter(attr)) {
|
||||
attributesTable.set(attr.name, attr);
|
||||
}
|
||||
});
|
||||
}
|
||||
}
|
||||
|
||||
// Handle children attribute
|
||||
@@ -13284,11 +13290,11 @@ namespace ts {
|
||||
}
|
||||
}
|
||||
|
||||
// Error if there is a attribute named "children" and children element.
|
||||
// This is because children element will overwrite the value from attributes
|
||||
const jsxChildrenPropertyName = getJsxElementChildrenPropertyname();
|
||||
if (jsxChildrenPropertyName && jsxChildrenPropertyName !== "") {
|
||||
if (attributesTable.has(jsxChildrenPropertyName)) {
|
||||
if (!hasSpreadAnyType && jsxChildrenPropertyName && jsxChildrenPropertyName !== "") {
|
||||
// Error if there is a attribute named "children" explicitly specified and children element.
|
||||
// This is because children element will overwrite the value from attributes.
|
||||
// Note: we will not warn "children" attribute overwritten if "children" attribute is specified in object spread.
|
||||
if (explicitlySpecifyChildrenAttribute) {
|
||||
error(attributes, Diagnostics._0_are_specified_twice_The_attribute_named_0_will_be_overwritten, jsxChildrenPropertyName);
|
||||
}
|
||||
|
||||
@@ -13301,7 +13307,13 @@ namespace ts {
|
||||
}
|
||||
}
|
||||
|
||||
return createJsxAttributesType(attributes.symbol, attributesTable);
|
||||
if (hasSpreadAnyType) {
|
||||
return anyType;
|
||||
}
|
||||
|
||||
const attributeType = createJsxAttributesType(attributes.symbol, attributesTable);
|
||||
return typeToIntersect && attributesTable.size ? getIntersectionType([typeToIntersect, attributeType]) :
|
||||
typeToIntersect ? typeToIntersect : attributeType;
|
||||
|
||||
/**
|
||||
* Create anonymous type from given attributes symbol table.
|
||||
@@ -13310,8 +13322,7 @@ namespace ts {
|
||||
*/
|
||||
function createJsxAttributesType(symbol: Symbol, attributesTable: Map<Symbol>) {
|
||||
const result = createAnonymousType(symbol, attributesTable, emptyArray, emptyArray, /*stringIndexInfo*/ undefined, /*numberIndexInfo*/ undefined);
|
||||
const freshObjectLiteralFlag = compilerOptions.suppressExcessPropertyErrors ? 0 : TypeFlags.FreshLiteral;
|
||||
result.flags |= TypeFlags.JsxAttributes | TypeFlags.ContainsObjectLiteral | freshObjectLiteralFlag;
|
||||
result.flags |= TypeFlags.JsxAttributes | TypeFlags.ContainsObjectLiteral;
|
||||
result.objectFlags |= ObjectFlags.ObjectLiteral;
|
||||
return result;
|
||||
}
|
||||
@@ -13397,7 +13408,18 @@ namespace ts {
|
||||
}
|
||||
}
|
||||
|
||||
return getUnionType(map(signatures, getReturnTypeOfSignature), /*subtypeReduction*/ true);
|
||||
const instantiatedSignatures = [];
|
||||
for (const signature of signatures) {
|
||||
if (signature.typeParameters) {
|
||||
const typeArguments = fillMissingTypeArguments(/*typeArguments*/ undefined, signature.typeParameters, /*minTypeArgumentCount*/ 0);
|
||||
instantiatedSignatures.push(getSignatureInstantiation(signature, typeArguments));
|
||||
}
|
||||
else {
|
||||
instantiatedSignatures.push(signature);
|
||||
}
|
||||
}
|
||||
|
||||
return getUnionType(map(instantiatedSignatures, getReturnTypeOfSignature), /*subtypeReduction*/ true);
|
||||
}
|
||||
|
||||
/**
|
||||
@@ -13457,6 +13479,20 @@ namespace ts {
|
||||
return _jsxElementChildrenPropertyName;
|
||||
}
|
||||
|
||||
function getApparentTypeOfJsxPropsType(propsType: Type): Type {
|
||||
if (!propsType) {
|
||||
return undefined;
|
||||
}
|
||||
if (propsType.flags & TypeFlags.Intersection) {
|
||||
const propsApparentType: Type[] = [];
|
||||
for (const t of (<UnionOrIntersectionType>propsType).types) {
|
||||
propsApparentType.push(getApparentType(t));
|
||||
}
|
||||
return getIntersectionType(propsApparentType);
|
||||
}
|
||||
return getApparentType(propsType);
|
||||
}
|
||||
|
||||
/**
|
||||
* Get JSX attributes type by trying to resolve openingLikeElement as a stateless function component.
|
||||
* Return only attributes type of successfully resolved call signature.
|
||||
@@ -13477,6 +13513,7 @@ namespace ts {
|
||||
if (callSignature !== unknownSignature) {
|
||||
const callReturnType = callSignature && getReturnTypeOfSignature(callSignature);
|
||||
let paramType = callReturnType && (callSignature.parameters.length === 0 ? emptyObjectType : getTypeOfSymbol(callSignature.parameters[0]));
|
||||
paramType = getApparentTypeOfJsxPropsType(paramType);
|
||||
if (callReturnType && isTypeAssignableTo(callReturnType, jsxStatelessElementType)) {
|
||||
// Intersect in JSX.IntrinsicAttributes if it exists
|
||||
const intrinsicAttributes = getJsxType(JsxNames.IntrinsicAttributes);
|
||||
@@ -13514,7 +13551,8 @@ namespace ts {
|
||||
let allMatchingAttributesType: Type;
|
||||
for (const candidate of candidatesOutArray) {
|
||||
const callReturnType = getReturnTypeOfSignature(candidate);
|
||||
const paramType = callReturnType && (candidate.parameters.length === 0 ? emptyObjectType : getTypeOfSymbol(candidate.parameters[0]));
|
||||
let paramType = callReturnType && (candidate.parameters.length === 0 ? emptyObjectType : getTypeOfSymbol(candidate.parameters[0]));
|
||||
paramType = getApparentTypeOfJsxPropsType(paramType);
|
||||
if (callReturnType && isTypeAssignableTo(callReturnType, jsxStatelessElementType)) {
|
||||
let shouldBeCandidate = true;
|
||||
for (const attribute of openingLikeElement.attributes.properties) {
|
||||
@@ -13819,6 +13857,34 @@ namespace ts {
|
||||
checkJsxAttributesAssignableToTagNameAttributes(node);
|
||||
}
|
||||
|
||||
/**
|
||||
* Check if a property with the given name is known anywhere in the given type. In an object type, a property
|
||||
* is considered known if the object type is empty and the check is for assignability, if the object type has
|
||||
* index signatures, or if the property is actually declared in the object type. In a union or intersection
|
||||
* type, a property is considered known if it is known in any constituent type.
|
||||
* @param targetType a type to search a given name in
|
||||
* @param name a property name to search
|
||||
* @param isComparingJsxAttributes a boolean flag indicating whether we are searching in JsxAttributesType
|
||||
*/
|
||||
function isKnownProperty(targetType: Type, name: string, isComparingJsxAttributes: boolean): boolean {
|
||||
if (targetType.flags & TypeFlags.Object) {
|
||||
const resolved = resolveStructuredTypeMembers(<ObjectType>targetType);
|
||||
if (resolved.stringIndexInfo || resolved.numberIndexInfo && isNumericLiteralName(name) ||
|
||||
getPropertyOfType(targetType, name) || isComparingJsxAttributes && !isUnhyphenatedJsxName(name)) {
|
||||
// For JSXAttributes, if the attribute has a hyphenated name, consider that the attribute to be known.
|
||||
return true;
|
||||
}
|
||||
}
|
||||
else if (targetType.flags & TypeFlags.UnionOrIntersection) {
|
||||
for (const t of (<UnionOrIntersectionType>targetType).types) {
|
||||
if (isKnownProperty(t, name, isComparingJsxAttributes)) {
|
||||
return true;
|
||||
}
|
||||
}
|
||||
}
|
||||
return false;
|
||||
}
|
||||
|
||||
/**
|
||||
* Check whether the given attributes of JSX opening-like element is assignable to the tagName attributes.
|
||||
* Get the attributes type of the opening-like element through resolving the tagName, "target attributes"
|
||||
@@ -13851,7 +13917,19 @@ namespace ts {
|
||||
error(openingLikeElement, Diagnostics.JSX_element_class_does_not_support_attributes_because_it_does_not_have_a_0_property, getJsxElementPropertiesName());
|
||||
}
|
||||
else {
|
||||
checkTypeAssignableTo(sourceAttributesType, targetAttributesType, openingLikeElement.attributes.properties.length > 0 ? openingLikeElement.attributes : openingLikeElement);
|
||||
// Check if sourceAttributesType assignable to targetAttributesType though this check will allow excess properties
|
||||
const isSourceAttributeTypeAssignableToTarget = checkTypeAssignableTo(sourceAttributesType, targetAttributesType, openingLikeElement.attributes.properties.length > 0 ? openingLikeElement.attributes : openingLikeElement);
|
||||
// After we check for assignability, we will do another pass to check that all explicitly specified attributes have correct name corresponding in targetAttributeType.
|
||||
// This will allow excess properties in spread type as it is very common pattern to spread outter attributes into React component in its render method.
|
||||
if (isSourceAttributeTypeAssignableToTarget && !isTypeAny(sourceAttributesType) && !isTypeAny(targetAttributesType)) {
|
||||
for (const attribute of openingLikeElement.attributes.properties) {
|
||||
if (isJsxAttribute(attribute) && !isKnownProperty(targetAttributesType, attribute.name.text, /*isComparingJsxAttributes*/ true)) {
|
||||
error(attribute, Diagnostics.Property_0_does_not_exist_on_type_1, attribute.name.text, typeToString(targetAttributesType));
|
||||
// We break here so that errors won't be cascading
|
||||
break;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -15334,7 +15412,7 @@ namespace ts {
|
||||
// only the class declaration node will have the Abstract flag set.
|
||||
const valueDecl = expressionType.symbol && getClassLikeDeclarationOfSymbol(expressionType.symbol);
|
||||
if (valueDecl && getModifierFlags(valueDecl) & ModifierFlags.Abstract) {
|
||||
error(node, Diagnostics.Cannot_create_an_instance_of_the_abstract_class_0, declarationNameToString(valueDecl.name));
|
||||
error(node, Diagnostics.Cannot_create_an_instance_of_the_abstract_class_0, declarationNameToString(getNameOfDeclaration(valueDecl)));
|
||||
return resolveErrorCall(node);
|
||||
}
|
||||
|
||||
@@ -15798,11 +15876,11 @@ namespace ts {
|
||||
const links = getSymbolLinks(parameter);
|
||||
if (!links.type) {
|
||||
links.type = instantiateType(contextualType, mapper);
|
||||
const name = getNameOfDeclaration(parameter.valueDeclaration);
|
||||
// if inference didn't come up with anything but {}, fall back to the binding pattern if present.
|
||||
if (links.type === emptyObjectType &&
|
||||
(parameter.valueDeclaration.name.kind === SyntaxKind.ObjectBindingPattern ||
|
||||
parameter.valueDeclaration.name.kind === SyntaxKind.ArrayBindingPattern)) {
|
||||
links.type = getTypeFromBindingPattern(<BindingPattern>parameter.valueDeclaration.name);
|
||||
(name.kind === SyntaxKind.ObjectBindingPattern || name.kind === SyntaxKind.ArrayBindingPattern)) {
|
||||
links.type = getTypeFromBindingPattern(<BindingPattern>name);
|
||||
}
|
||||
assignBindingElementTypes(<ParameterDeclaration>parameter.valueDeclaration);
|
||||
}
|
||||
@@ -15947,7 +16025,7 @@ namespace ts {
|
||||
// From within an async function you can return either a non-promise value or a promise. Any
|
||||
// Promise/A+ compatible implementation will always assimilate any foreign promise, so the
|
||||
// return type of the body is awaited type of the body, wrapped in a native Promise<T> type.
|
||||
return (functionFlags & FunctionFlags.AsyncOrAsyncGenerator) === FunctionFlags.Async
|
||||
return (functionFlags & FunctionFlags.AsyncGenerator) === FunctionFlags.Async
|
||||
? createPromiseReturnType(func, widenedType) // Async function
|
||||
: widenedType; // Generator function, AsyncGenerator function, or normal function
|
||||
}
|
||||
@@ -16163,7 +16241,7 @@ namespace ts {
|
||||
|
||||
const functionFlags = getFunctionFlags(node);
|
||||
const returnOrPromisedType = node.type &&
|
||||
((functionFlags & FunctionFlags.AsyncOrAsyncGenerator) === FunctionFlags.Async ?
|
||||
((functionFlags & FunctionFlags.AsyncGenerator) === FunctionFlags.Async ?
|
||||
checkAsyncFunctionReturnType(node) : // Async function
|
||||
getTypeFromTypeNode(node.type)); // AsyncGenerator function, Generator function, or normal function
|
||||
|
||||
@@ -16193,7 +16271,7 @@ namespace ts {
|
||||
// its return type annotation.
|
||||
const exprType = checkExpression(<Expression>node.body);
|
||||
if (returnOrPromisedType) {
|
||||
if ((functionFlags & FunctionFlags.AsyncOrAsyncGenerator) === FunctionFlags.Async) { // Async function
|
||||
if ((functionFlags & FunctionFlags.AsyncGenerator) === FunctionFlags.Async) { // Async function
|
||||
const awaitedType = checkAwaitedType(exprType, node.body, Diagnostics.The_return_type_of_an_async_function_must_either_be_a_valid_promise_or_must_not_contain_a_callable_then_member);
|
||||
checkTypeAssignableTo(awaitedType, returnOrPromisedType, node.body);
|
||||
}
|
||||
@@ -16933,12 +17011,16 @@ namespace ts {
|
||||
// we are in a yield context.
|
||||
const functionFlags = func && getFunctionFlags(func);
|
||||
if (node.asteriskToken) {
|
||||
if (functionFlags & FunctionFlags.Async) {
|
||||
if (languageVersion < ScriptTarget.ES2017) {
|
||||
checkExternalEmitHelpers(node, ExternalEmitHelpers.AsyncDelegator);
|
||||
}
|
||||
// Async generator functions prior to ESNext require the __await, __asyncDelegator,
|
||||
// and __asyncValues helpers
|
||||
if ((functionFlags & FunctionFlags.AsyncGenerator) === FunctionFlags.AsyncGenerator &&
|
||||
languageVersion < ScriptTarget.ESNext) {
|
||||
checkExternalEmitHelpers(node, ExternalEmitHelpers.AsyncDelegatorIncludes);
|
||||
}
|
||||
else if (languageVersion < ScriptTarget.ES2015 && compilerOptions.downlevelIteration) {
|
||||
|
||||
// Generator functions prior to ES2015 require the __values helper
|
||||
if ((functionFlags & FunctionFlags.AsyncGenerator) === FunctionFlags.Generator &&
|
||||
languageVersion < ScriptTarget.ES2015 && compilerOptions.downlevelIteration) {
|
||||
checkExternalEmitHelpers(node, ExternalEmitHelpers.Values);
|
||||
}
|
||||
}
|
||||
@@ -17457,18 +17539,20 @@ namespace ts {
|
||||
}
|
||||
|
||||
const functionFlags = getFunctionFlags(<FunctionLikeDeclaration>node);
|
||||
if ((functionFlags & FunctionFlags.InvalidAsyncOrAsyncGenerator) === FunctionFlags.Async && languageVersion < ScriptTarget.ES2017) {
|
||||
checkExternalEmitHelpers(node, ExternalEmitHelpers.Awaiter);
|
||||
if (languageVersion < ScriptTarget.ES2015) {
|
||||
checkExternalEmitHelpers(node, ExternalEmitHelpers.Generator);
|
||||
if (!(functionFlags & FunctionFlags.Invalid)) {
|
||||
// Async generators prior to ESNext require the __await and __asyncGenerator helpers
|
||||
if ((functionFlags & FunctionFlags.AsyncGenerator) === FunctionFlags.AsyncGenerator && languageVersion < ScriptTarget.ESNext) {
|
||||
checkExternalEmitHelpers(node, ExternalEmitHelpers.AsyncGeneratorIncludes);
|
||||
}
|
||||
}
|
||||
|
||||
if ((functionFlags & FunctionFlags.InvalidGenerator) === FunctionFlags.Generator) {
|
||||
if (functionFlags & FunctionFlags.Async && languageVersion < ScriptTarget.ES2017) {
|
||||
checkExternalEmitHelpers(node, ExternalEmitHelpers.AsyncGenerator);
|
||||
// Async functions prior to ES2017 require the __awaiter helper
|
||||
if ((functionFlags & FunctionFlags.AsyncGenerator) === FunctionFlags.Async && languageVersion < ScriptTarget.ES2017) {
|
||||
checkExternalEmitHelpers(node, ExternalEmitHelpers.Awaiter);
|
||||
}
|
||||
else if (languageVersion < ScriptTarget.ES2015) {
|
||||
|
||||
// Generator functions, Async functions, and Async Generator functions prior to
|
||||
// ES2015 require the __generator helper
|
||||
if ((functionFlags & FunctionFlags.AsyncGenerator) !== FunctionFlags.Normal && languageVersion < ScriptTarget.ES2015) {
|
||||
checkExternalEmitHelpers(node, ExternalEmitHelpers.Generator);
|
||||
}
|
||||
}
|
||||
@@ -17496,7 +17580,7 @@ namespace ts {
|
||||
|
||||
if (node.type) {
|
||||
const functionFlags = getFunctionFlags(<FunctionDeclaration>node);
|
||||
if ((functionFlags & FunctionFlags.InvalidGenerator) === FunctionFlags.Generator) {
|
||||
if ((functionFlags & (FunctionFlags.Invalid | FunctionFlags.Generator)) === FunctionFlags.Generator) {
|
||||
const returnType = getTypeFromTypeNode(node.type);
|
||||
if (returnType === voidType) {
|
||||
error(node.type, Diagnostics.A_generator_cannot_have_a_void_type_annotation);
|
||||
@@ -17516,7 +17600,7 @@ namespace ts {
|
||||
checkTypeAssignableTo(iterableIteratorInstantiation, returnType, node.type);
|
||||
}
|
||||
}
|
||||
else if ((functionFlags & FunctionFlags.AsyncOrAsyncGenerator) === FunctionFlags.Async) {
|
||||
else if ((functionFlags & FunctionFlags.AsyncGenerator) === FunctionFlags.Async) {
|
||||
checkAsyncFunctionReturnType(<FunctionLikeDeclaration>node);
|
||||
}
|
||||
}
|
||||
@@ -17640,7 +17724,7 @@ namespace ts {
|
||||
}
|
||||
|
||||
if (names.get(memberName)) {
|
||||
error(member.symbol.valueDeclaration.name, Diagnostics.Duplicate_identifier_0, memberName);
|
||||
error(getNameOfDeclaration(member.symbol.valueDeclaration), Diagnostics.Duplicate_identifier_0, memberName);
|
||||
error(member.name, Diagnostics.Duplicate_identifier_0, memberName);
|
||||
}
|
||||
else {
|
||||
@@ -17741,7 +17825,8 @@ namespace ts {
|
||||
}
|
||||
|
||||
function containsSuperCallAsComputedPropertyName(n: Declaration): boolean {
|
||||
return n.name && containsSuperCall(n.name);
|
||||
const name = getNameOfDeclaration(n);
|
||||
return name && containsSuperCall(name);
|
||||
}
|
||||
|
||||
function containsSuperCall(n: Node): boolean {
|
||||
@@ -18036,16 +18121,16 @@ namespace ts {
|
||||
forEach(overloads, o => {
|
||||
const deviation = getEffectiveDeclarationFlags(o, flagsToCheck) ^ canonicalFlags;
|
||||
if (deviation & ModifierFlags.Export) {
|
||||
error(o.name, Diagnostics.Overload_signatures_must_all_be_exported_or_non_exported);
|
||||
error(getNameOfDeclaration(o), Diagnostics.Overload_signatures_must_all_be_exported_or_non_exported);
|
||||
}
|
||||
else if (deviation & ModifierFlags.Ambient) {
|
||||
error(o.name, Diagnostics.Overload_signatures_must_all_be_ambient_or_non_ambient);
|
||||
error(getNameOfDeclaration(o), Diagnostics.Overload_signatures_must_all_be_ambient_or_non_ambient);
|
||||
}
|
||||
else if (deviation & (ModifierFlags.Private | ModifierFlags.Protected)) {
|
||||
error(o.name || o, Diagnostics.Overload_signatures_must_all_be_public_private_or_protected);
|
||||
error(getNameOfDeclaration(o) || o, Diagnostics.Overload_signatures_must_all_be_public_private_or_protected);
|
||||
}
|
||||
else if (deviation & ModifierFlags.Abstract) {
|
||||
error(o.name, Diagnostics.Overload_signatures_must_all_be_abstract_or_non_abstract);
|
||||
error(getNameOfDeclaration(o), Diagnostics.Overload_signatures_must_all_be_abstract_or_non_abstract);
|
||||
}
|
||||
});
|
||||
}
|
||||
@@ -18057,7 +18142,7 @@ namespace ts {
|
||||
forEach(overloads, o => {
|
||||
const deviation = hasQuestionToken(o) !== canonicalHasQuestionToken;
|
||||
if (deviation) {
|
||||
error(o.name, Diagnostics.Overload_signatures_must_all_be_optional_or_required);
|
||||
error(getNameOfDeclaration(o), Diagnostics.Overload_signatures_must_all_be_optional_or_required);
|
||||
}
|
||||
});
|
||||
}
|
||||
@@ -18193,7 +18278,7 @@ namespace ts {
|
||||
|
||||
if (duplicateFunctionDeclaration) {
|
||||
forEach(declarations, declaration => {
|
||||
error(declaration.name, Diagnostics.Duplicate_function_implementation);
|
||||
error(getNameOfDeclaration(declaration), Diagnostics.Duplicate_function_implementation);
|
||||
});
|
||||
}
|
||||
|
||||
@@ -18275,12 +18360,13 @@ namespace ts {
|
||||
for (const d of symbol.declarations) {
|
||||
const declarationSpaces = getDeclarationSpaces(d);
|
||||
|
||||
const name = getNameOfDeclaration(d);
|
||||
// Only error on the declarations that contributed to the intersecting spaces.
|
||||
if (declarationSpaces & commonDeclarationSpacesForDefaultAndNonDefault) {
|
||||
error(d.name, Diagnostics.Merged_declaration_0_cannot_include_a_default_export_declaration_Consider_adding_a_separate_export_default_0_declaration_instead, declarationNameToString(d.name));
|
||||
error(name, Diagnostics.Merged_declaration_0_cannot_include_a_default_export_declaration_Consider_adding_a_separate_export_default_0_declaration_instead, declarationNameToString(name));
|
||||
}
|
||||
else if (declarationSpaces & commonDeclarationSpacesForExportsAndLocals) {
|
||||
error(d.name, Diagnostics.Individual_declarations_in_merged_declaration_0_must_be_all_exported_or_all_local, declarationNameToString(d.name));
|
||||
error(name, Diagnostics.Individual_declarations_in_merged_declaration_0_must_be_all_exported_or_all_local, declarationNameToString(name));
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -18861,15 +18947,16 @@ namespace ts {
|
||||
if (!local.isReferenced) {
|
||||
if (local.valueDeclaration && getRootDeclaration(local.valueDeclaration).kind === SyntaxKind.Parameter) {
|
||||
const parameter = <ParameterDeclaration>getRootDeclaration(local.valueDeclaration);
|
||||
const name = getNameOfDeclaration(local.valueDeclaration);
|
||||
if (compilerOptions.noUnusedParameters &&
|
||||
!isParameterPropertyDeclaration(parameter) &&
|
||||
!parameterIsThisKeyword(parameter) &&
|
||||
!parameterNameStartsWithUnderscore(local.valueDeclaration.name)) {
|
||||
error(local.valueDeclaration.name, Diagnostics._0_is_declared_but_never_used, local.name);
|
||||
!parameterNameStartsWithUnderscore(name)) {
|
||||
error(name, Diagnostics._0_is_declared_but_never_used, local.name);
|
||||
}
|
||||
}
|
||||
else if (compilerOptions.noUnusedLocals) {
|
||||
forEach(local.declarations, d => errorUnusedLocal(d.name || d, local.name));
|
||||
forEach(local.declarations, d => errorUnusedLocal(getNameOfDeclaration(d) || d, local.name));
|
||||
}
|
||||
}
|
||||
});
|
||||
@@ -18953,7 +19040,7 @@ namespace ts {
|
||||
if (!local.isReferenced && !local.exportSymbol) {
|
||||
for (const declaration of local.declarations) {
|
||||
if (!isAmbientModule(declaration)) {
|
||||
errorUnusedLocal(declaration.name, local.name);
|
||||
errorUnusedLocal(getNameOfDeclaration(declaration), local.name);
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -19032,7 +19119,7 @@ namespace ts {
|
||||
if (getNodeCheckFlags(current) & NodeCheckFlags.CaptureThis) {
|
||||
const isDeclaration = node.kind !== SyntaxKind.Identifier;
|
||||
if (isDeclaration) {
|
||||
error((<Declaration>node).name, Diagnostics.Duplicate_identifier_this_Compiler_uses_variable_declaration_this_to_capture_this_reference);
|
||||
error(getNameOfDeclaration(<Declaration>node), Diagnostics.Duplicate_identifier_this_Compiler_uses_variable_declaration_this_to_capture_this_reference);
|
||||
}
|
||||
else {
|
||||
error(node, Diagnostics.Expression_resolves_to_variable_declaration_this_that_compiler_uses_to_capture_this_reference);
|
||||
@@ -19047,7 +19134,7 @@ namespace ts {
|
||||
if (getNodeCheckFlags(current) & NodeCheckFlags.CaptureNewTarget) {
|
||||
const isDeclaration = node.kind !== SyntaxKind.Identifier;
|
||||
if (isDeclaration) {
|
||||
error((<Declaration>node).name, Diagnostics.Duplicate_identifier_newTarget_Compiler_uses_variable_declaration_newTarget_to_capture_new_target_meta_property_reference);
|
||||
error(getNameOfDeclaration(<Declaration>node), Diagnostics.Duplicate_identifier_newTarget_Compiler_uses_variable_declaration_newTarget_to_capture_new_target_meta_property_reference);
|
||||
}
|
||||
else {
|
||||
error(node, Diagnostics.Expression_resolves_to_variable_declaration_newTarget_that_compiler_uses_to_capture_new_target_meta_property_reference);
|
||||
@@ -19346,7 +19433,7 @@ namespace ts {
|
||||
checkTypeAssignableTo(checkExpressionCached(node.initializer), declarationType, node, /*headMessage*/ undefined);
|
||||
}
|
||||
if (!areDeclarationFlagsIdentical(node, symbol.valueDeclaration)) {
|
||||
error(symbol.valueDeclaration.name, Diagnostics.All_declarations_of_0_must_have_identical_modifiers, declarationNameToString(node.name));
|
||||
error(getNameOfDeclaration(symbol.valueDeclaration), Diagnostics.All_declarations_of_0_must_have_identical_modifiers, declarationNameToString(node.name));
|
||||
error(node.name, Diagnostics.All_declarations_of_0_must_have_identical_modifiers, declarationNameToString(node.name));
|
||||
}
|
||||
}
|
||||
@@ -19483,11 +19570,14 @@ namespace ts {
|
||||
|
||||
if (node.kind === SyntaxKind.ForOfStatement) {
|
||||
if ((<ForOfStatement>node).awaitModifier) {
|
||||
if (languageVersion < ScriptTarget.ES2017) {
|
||||
const functionFlags = getFunctionFlags(getContainingFunction(node));
|
||||
if ((functionFlags & (FunctionFlags.Invalid | FunctionFlags.Async)) === FunctionFlags.Async && languageVersion < ScriptTarget.ESNext) {
|
||||
// for..await..of in an async function or async generator function prior to ESNext requires the __asyncValues helper
|
||||
checkExternalEmitHelpers(node, ExternalEmitHelpers.ForAwaitOfIncludes);
|
||||
}
|
||||
}
|
||||
else if (languageVersion < ScriptTarget.ES2015 && compilerOptions.downlevelIteration) {
|
||||
else if (compilerOptions.downlevelIteration && languageVersion < ScriptTarget.ES2015) {
|
||||
// for..of prior to ES2015 requires the __values helper when downlevelIteration is enabled
|
||||
checkExternalEmitHelpers(node, ExternalEmitHelpers.ForOfIncludes);
|
||||
}
|
||||
}
|
||||
@@ -19917,7 +20007,7 @@ namespace ts {
|
||||
}
|
||||
|
||||
function isUnwrappedReturnTypeVoidOrAny(func: FunctionLikeDeclaration, returnType: Type): boolean {
|
||||
const unwrappedReturnType = (getFunctionFlags(func) & FunctionFlags.AsyncOrAsyncGenerator) === FunctionFlags.Async
|
||||
const unwrappedReturnType = (getFunctionFlags(func) & FunctionFlags.AsyncGenerator) === FunctionFlags.Async
|
||||
? getPromisedTypeOfPromise(returnType) // Async function
|
||||
: returnType; // AsyncGenerator function, Generator function, or normal function
|
||||
return unwrappedReturnType && maybeTypeOfKind(unwrappedReturnType, TypeFlags.Void | TypeFlags.Any);
|
||||
@@ -20174,14 +20264,17 @@ namespace ts {
|
||||
const propDeclaration = prop.valueDeclaration;
|
||||
|
||||
// index is numeric and property name is not valid numeric literal
|
||||
if (indexKind === IndexKind.Number && !(propDeclaration ? isNumericName(propDeclaration.name) : isNumericLiteralName(prop.name))) {
|
||||
if (indexKind === IndexKind.Number && !(propDeclaration ? isNumericName(getNameOfDeclaration(propDeclaration)) : isNumericLiteralName(prop.name))) {
|
||||
return;
|
||||
}
|
||||
|
||||
// perform property check if property or indexer is declared in 'type'
|
||||
// this allows to rule out cases when both property and indexer are inherited from the base class
|
||||
// this allows us to rule out cases when both property and indexer are inherited from the base class
|
||||
let errorNode: Node;
|
||||
if (propDeclaration && (propDeclaration.name.kind === SyntaxKind.ComputedPropertyName || prop.parent === containingType.symbol)) {
|
||||
if (propDeclaration &&
|
||||
(propDeclaration.kind === SyntaxKind.BinaryExpression ||
|
||||
getNameOfDeclaration(propDeclaration).kind === SyntaxKind.ComputedPropertyName ||
|
||||
prop.parent === containingType.symbol)) {
|
||||
errorNode = propDeclaration;
|
||||
}
|
||||
else if (indexDeclaration) {
|
||||
@@ -20544,7 +20637,7 @@ namespace ts {
|
||||
errorMessage = Diagnostics.Class_0_defines_instance_member_accessor_1_but_extended_class_2_defines_it_as_instance_member_function;
|
||||
}
|
||||
|
||||
error(derived.valueDeclaration.name || derived.valueDeclaration, errorMessage, typeToString(baseType), symbolToString(base), typeToString(type));
|
||||
error(getNameOfDeclaration(derived.valueDeclaration) || derived.valueDeclaration, errorMessage, typeToString(baseType), symbolToString(base), typeToString(type));
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -20875,7 +20968,7 @@ namespace ts {
|
||||
// check that const is placed\omitted on all enum declarations
|
||||
forEach(enumSymbol.declarations, decl => {
|
||||
if (isConstEnumDeclaration(decl) !== enumIsConst) {
|
||||
error(decl.name, Diagnostics.Enum_declarations_must_all_be_const_or_non_const);
|
||||
error(getNameOfDeclaration(decl), Diagnostics.Enum_declarations_must_all_be_const_or_non_const);
|
||||
}
|
||||
});
|
||||
}
|
||||
@@ -21768,7 +21861,7 @@ namespace ts {
|
||||
function isTypeDeclarationName(name: Node): boolean {
|
||||
return name.kind === SyntaxKind.Identifier &&
|
||||
isTypeDeclaration(name.parent) &&
|
||||
(<Declaration>name.parent).name === name;
|
||||
(<NamedDeclaration>name.parent).name === name;
|
||||
}
|
||||
|
||||
function isTypeDeclaration(node: Node): boolean {
|
||||
@@ -22615,16 +22708,6 @@ namespace ts {
|
||||
getSymbolDisplayBuilder().buildTypeDisplay(type, writer, enclosingDeclaration, flags);
|
||||
}
|
||||
|
||||
function writeBaseConstructorTypeOfClass(node: ClassLikeDeclaration, enclosingDeclaration: Node, flags: TypeFormatFlags, writer: SymbolWriter) {
|
||||
const classType = <InterfaceType>getDeclaredTypeOfSymbol(getSymbolOfNode(node));
|
||||
resolveBaseTypesOfClass(classType);
|
||||
const baseType = classType.resolvedBaseTypes.length ? classType.resolvedBaseTypes[0] : unknownType;
|
||||
if (!baseType.symbol) {
|
||||
writer.reportIllegalExtends();
|
||||
}
|
||||
getSymbolDisplayBuilder().buildTypeDisplay(baseType, writer, enclosingDeclaration, flags);
|
||||
}
|
||||
|
||||
function hasGlobalName(name: string): boolean {
|
||||
return globals.has(name);
|
||||
}
|
||||
@@ -22718,7 +22801,6 @@ namespace ts {
|
||||
writeTypeOfDeclaration,
|
||||
writeReturnTypeOfSignatureDeclaration,
|
||||
writeTypeOfExpression,
|
||||
writeBaseConstructorTypeOfClass,
|
||||
isSymbolAccessible,
|
||||
isEntityNameVisible,
|
||||
getConstantValue: node => {
|
||||
@@ -22924,6 +23006,7 @@ namespace ts {
|
||||
case ExternalEmitHelpers.Values: return "__values";
|
||||
case ExternalEmitHelpers.Read: return "__read";
|
||||
case ExternalEmitHelpers.Spread: return "__spread";
|
||||
case ExternalEmitHelpers.Await: return "__await";
|
||||
case ExternalEmitHelpers.AsyncGenerator: return "__asyncGenerator";
|
||||
case ExternalEmitHelpers.AsyncDelegator: return "__asyncDelegator";
|
||||
case ExternalEmitHelpers.AsyncValues: return "__asyncValues";
|
||||
|
||||
@@ -3,7 +3,7 @@
|
||||
|
||||
namespace ts {
|
||||
/** The version of the TypeScript compiler release */
|
||||
export const version = "2.3.1";
|
||||
export const version = "2.3.3";
|
||||
}
|
||||
|
||||
/* @internal */
|
||||
|
||||
@@ -67,7 +67,7 @@ namespace ts {
|
||||
let errorNameNode: DeclarationName;
|
||||
const emitJsDocComments = compilerOptions.removeComments ? noop : writeJsDocComments;
|
||||
const emit = compilerOptions.stripInternal ? stripInternal : emitNode;
|
||||
let noDeclare: boolean;
|
||||
let needsDeclare = true;
|
||||
|
||||
let moduleElementDeclarationEmitInfo: ModuleElementDeclarationEmitInfo[] = [];
|
||||
let asynchronousSubModuleDeclarationEmitInfo: ModuleElementDeclarationEmitInfo[];
|
||||
@@ -110,11 +110,11 @@ namespace ts {
|
||||
|
||||
resultHasExternalModuleIndicator = false;
|
||||
if (!isBundledEmit || !isExternalModule(sourceFile)) {
|
||||
noDeclare = false;
|
||||
needsDeclare = true;
|
||||
emitSourceFile(sourceFile);
|
||||
}
|
||||
else if (isExternalModule(sourceFile)) {
|
||||
noDeclare = true;
|
||||
needsDeclare = false;
|
||||
write(`declare module "${getResolvedExternalModuleName(host, sourceFile)}" {`);
|
||||
writeLine();
|
||||
increaseIndent();
|
||||
@@ -594,12 +594,11 @@ namespace ts {
|
||||
emitLines(node.statements);
|
||||
}
|
||||
|
||||
// Return a temp variable name to be used in `export default` statements.
|
||||
// Return a temp variable name to be used in `export default`/`export class ... extends` statements.
|
||||
// The temp name will be of the form _default_counter.
|
||||
// Note that export default is only allowed at most once in a module, so we
|
||||
// do not need to keep track of created temp names.
|
||||
function getExportDefaultTempVariableName(): string {
|
||||
const baseName = "_default";
|
||||
function getExportTempVariableName(baseName: string): string {
|
||||
if (!currentIdentifiers.has(baseName)) {
|
||||
return baseName;
|
||||
}
|
||||
@@ -613,24 +612,31 @@ namespace ts {
|
||||
}
|
||||
}
|
||||
|
||||
function emitTempVariableDeclaration(expr: Expression, baseName: string, diagnostic: SymbolAccessibilityDiagnostic, needsDeclare: boolean): string {
|
||||
const tempVarName = getExportTempVariableName(baseName);
|
||||
if (needsDeclare) {
|
||||
write("declare ");
|
||||
}
|
||||
write("const ");
|
||||
write(tempVarName);
|
||||
write(": ");
|
||||
writer.getSymbolAccessibilityDiagnostic = () => diagnostic;
|
||||
resolver.writeTypeOfExpression(expr, enclosingDeclaration, TypeFormatFlags.UseTypeOfFunction | TypeFormatFlags.UseTypeAliasValue, writer);
|
||||
write(";");
|
||||
writeLine();
|
||||
return tempVarName;
|
||||
}
|
||||
|
||||
function emitExportAssignment(node: ExportAssignment) {
|
||||
if (node.expression.kind === SyntaxKind.Identifier) {
|
||||
write(node.isExportEquals ? "export = " : "export default ");
|
||||
writeTextOfNode(currentText, node.expression);
|
||||
}
|
||||
else {
|
||||
// Expression
|
||||
const tempVarName = getExportDefaultTempVariableName();
|
||||
if (!noDeclare) {
|
||||
write("declare ");
|
||||
}
|
||||
write("var ");
|
||||
write(tempVarName);
|
||||
write(": ");
|
||||
writer.getSymbolAccessibilityDiagnostic = getDefaultExportAccessibilityDiagnostic;
|
||||
resolver.writeTypeOfExpression(node.expression, enclosingDeclaration, TypeFormatFlags.UseTypeOfFunction | TypeFormatFlags.UseTypeAliasValue, writer);
|
||||
write(";");
|
||||
writeLine();
|
||||
const tempVarName = emitTempVariableDeclaration(node.expression, "_default", {
|
||||
diagnosticMessage: Diagnostics.Default_export_of_the_module_has_or_is_using_private_name_0,
|
||||
errorNode: node
|
||||
}, needsDeclare);
|
||||
write(node.isExportEquals ? "export = " : "export default ");
|
||||
write(tempVarName);
|
||||
}
|
||||
@@ -644,13 +650,6 @@ namespace ts {
|
||||
// write each of these declarations asynchronously
|
||||
writeAsynchronousModuleElements(nodes);
|
||||
}
|
||||
|
||||
function getDefaultExportAccessibilityDiagnostic(): SymbolAccessibilityDiagnostic {
|
||||
return {
|
||||
diagnosticMessage: Diagnostics.Default_export_of_the_module_has_or_is_using_private_name_0,
|
||||
errorNode: node
|
||||
};
|
||||
}
|
||||
}
|
||||
|
||||
function isModuleElementVisible(node: Declaration) {
|
||||
@@ -729,7 +728,7 @@ namespace ts {
|
||||
if (modifiers & ModifierFlags.Default) {
|
||||
write("default ");
|
||||
}
|
||||
else if (node.kind !== SyntaxKind.InterfaceDeclaration && !noDeclare) {
|
||||
else if (node.kind !== SyntaxKind.InterfaceDeclaration && needsDeclare) {
|
||||
write("declare ");
|
||||
}
|
||||
}
|
||||
@@ -1097,7 +1096,7 @@ namespace ts {
|
||||
}
|
||||
}
|
||||
|
||||
function emitHeritageClause(className: Identifier, typeReferences: ExpressionWithTypeArguments[], isImplementsList: boolean) {
|
||||
function emitHeritageClause(typeReferences: ExpressionWithTypeArguments[], isImplementsList: boolean) {
|
||||
if (typeReferences) {
|
||||
write(isImplementsList ? " implements " : " extends ");
|
||||
emitCommaList(typeReferences, emitTypeOfTypeReference);
|
||||
@@ -1110,12 +1109,6 @@ namespace ts {
|
||||
else if (!isImplementsList && node.expression.kind === SyntaxKind.NullKeyword) {
|
||||
write("null");
|
||||
}
|
||||
else {
|
||||
writer.getSymbolAccessibilityDiagnostic = getHeritageClauseVisibilityError;
|
||||
errorNameNode = className;
|
||||
resolver.writeBaseConstructorTypeOfClass(<ClassLikeDeclaration>enclosingDeclaration, enclosingDeclaration, TypeFormatFlags.UseTypeOfFunction | TypeFormatFlags.UseTypeAliasValue, writer);
|
||||
errorNameNode = undefined;
|
||||
}
|
||||
|
||||
function getHeritageClauseVisibilityError(): SymbolAccessibilityDiagnostic {
|
||||
let diagnosticMessage: DiagnosticMessage;
|
||||
@@ -1134,7 +1127,7 @@ namespace ts {
|
||||
return {
|
||||
diagnosticMessage,
|
||||
errorNode: node,
|
||||
typeName: (<Declaration>node.parent.parent).name
|
||||
typeName: getNameOfDeclaration(node.parent.parent)
|
||||
};
|
||||
}
|
||||
}
|
||||
@@ -1151,23 +1144,43 @@ namespace ts {
|
||||
}
|
||||
}
|
||||
|
||||
const prevEnclosingDeclaration = enclosingDeclaration;
|
||||
enclosingDeclaration = node;
|
||||
const baseTypeNode = getClassExtendsHeritageClauseElement(node);
|
||||
let tempVarName: string;
|
||||
if (baseTypeNode && !isEntityNameExpression(baseTypeNode.expression)) {
|
||||
tempVarName = baseTypeNode.expression.kind === SyntaxKind.NullKeyword ?
|
||||
"null" :
|
||||
emitTempVariableDeclaration(baseTypeNode.expression, `${node.name.text}_base`, {
|
||||
diagnosticMessage: Diagnostics.extends_clause_of_exported_class_0_has_or_is_using_private_name_1,
|
||||
errorNode: baseTypeNode,
|
||||
typeName: node.name
|
||||
}, !findAncestor(node, n => n.kind === SyntaxKind.ModuleDeclaration));
|
||||
}
|
||||
|
||||
emitJsDocComments(node);
|
||||
emitModuleElementDeclarationFlags(node);
|
||||
if (hasModifier(node, ModifierFlags.Abstract)) {
|
||||
write("abstract ");
|
||||
}
|
||||
|
||||
write("class ");
|
||||
writeTextOfNode(currentText, node.name);
|
||||
const prevEnclosingDeclaration = enclosingDeclaration;
|
||||
enclosingDeclaration = node;
|
||||
emitTypeParameters(node.typeParameters);
|
||||
const baseTypeNode = getClassExtendsHeritageClauseElement(node);
|
||||
if (baseTypeNode) {
|
||||
node.name;
|
||||
emitHeritageClause(node.name, [baseTypeNode], /*isImplementsList*/ false);
|
||||
if (!isEntityNameExpression(baseTypeNode.expression)) {
|
||||
write(" extends ");
|
||||
write(tempVarName);
|
||||
if (baseTypeNode.typeArguments) {
|
||||
write("<");
|
||||
emitCommaList(baseTypeNode.typeArguments, emitType);
|
||||
write(">");
|
||||
}
|
||||
}
|
||||
else {
|
||||
emitHeritageClause([baseTypeNode], /*isImplementsList*/ false);
|
||||
}
|
||||
}
|
||||
emitHeritageClause(node.name, getClassImplementsHeritageClauseElements(node), /*isImplementsList*/ true);
|
||||
emitHeritageClause(getClassImplementsHeritageClauseElements(node), /*isImplementsList*/ true);
|
||||
write(" {");
|
||||
writeLine();
|
||||
increaseIndent();
|
||||
@@ -1189,7 +1202,7 @@ namespace ts {
|
||||
emitTypeParameters(node.typeParameters);
|
||||
const interfaceExtendsTypes = filter(getInterfaceBaseTypeNodes(node), base => isEntityNameExpression(base.expression));
|
||||
if (interfaceExtendsTypes && interfaceExtendsTypes.length) {
|
||||
emitHeritageClause(node.name, interfaceExtendsTypes, /*isImplementsList*/ false);
|
||||
emitHeritageClause(interfaceExtendsTypes, /*isImplementsList*/ false);
|
||||
}
|
||||
write(" {");
|
||||
writeLine();
|
||||
|
||||
+26
-3
@@ -2937,6 +2937,28 @@ namespace ts {
|
||||
);
|
||||
}
|
||||
|
||||
/**
|
||||
* Gets the internal name of a declaration. This is primarily used for declarations that can be
|
||||
* referred to by name in the body of an ES5 class function body. An internal name will *never*
|
||||
* be prefixed with an module or namespace export modifier like "exports." when emitted as an
|
||||
* expression. An internal name will also *never* be renamed due to a collision with a block
|
||||
* scoped variable.
|
||||
*
|
||||
* @param node The declaration.
|
||||
* @param allowComments A value indicating whether comments may be emitted for the name.
|
||||
* @param allowSourceMaps A value indicating whether source maps may be emitted for the name.
|
||||
*/
|
||||
export function getInternalName(node: Declaration, allowComments?: boolean, allowSourceMaps?: boolean) {
|
||||
return getName(node, allowComments, allowSourceMaps, EmitFlags.LocalName | EmitFlags.InternalName);
|
||||
}
|
||||
|
||||
/**
|
||||
* Gets whether an identifier should only be referred to by its internal name.
|
||||
*/
|
||||
export function isInternalName(node: Identifier) {
|
||||
return (getEmitFlags(node) & EmitFlags.InternalName) !== 0;
|
||||
}
|
||||
|
||||
/**
|
||||
* Gets the local name of a declaration. This is primarily used for declarations that can be
|
||||
* referred to by name in the declaration's immediate scope (classes, enums, namespaces). A
|
||||
@@ -2992,9 +3014,10 @@ namespace ts {
|
||||
}
|
||||
|
||||
function getName(node: Declaration, allowComments?: boolean, allowSourceMaps?: boolean, emitFlags?: EmitFlags) {
|
||||
if (node.name && isIdentifier(node.name) && !isGeneratedIdentifier(node.name)) {
|
||||
const name = getMutableClone(node.name);
|
||||
emitFlags |= getEmitFlags(node.name);
|
||||
const nodeName = getNameOfDeclaration(node);
|
||||
if (nodeName && isIdentifier(nodeName) && !isGeneratedIdentifier(nodeName)) {
|
||||
const name = getMutableClone(nodeName);
|
||||
emitFlags |= getEmitFlags(nodeName);
|
||||
if (!allowSourceMaps) emitFlags |= EmitFlags.NoSourceMap;
|
||||
if (!allowComments) emitFlags |= EmitFlags.NoComments;
|
||||
if (emitFlags) setEmitFlags(name, emitFlags);
|
||||
|
||||
@@ -813,7 +813,7 @@ namespace ts {
|
||||
|
||||
// Create a synthetic text range for the return statement.
|
||||
const closingBraceLocation = createTokenRange(skipTrivia(currentText, node.members.end), SyntaxKind.CloseBraceToken);
|
||||
const localName = getLocalName(node);
|
||||
const localName = getInternalName(node);
|
||||
|
||||
// The following partially-emitted expression exists purely to align our sourcemap
|
||||
// emit with the original emitter.
|
||||
@@ -870,7 +870,7 @@ namespace ts {
|
||||
/*decorators*/ undefined,
|
||||
/*modifiers*/ undefined,
|
||||
/*asteriskToken*/ undefined,
|
||||
getDeclarationName(node),
|
||||
getInternalName(node),
|
||||
/*typeParameters*/ undefined,
|
||||
transformConstructorParameters(constructor, hasSynthesizedSuper),
|
||||
/*type*/ undefined,
|
||||
@@ -3180,7 +3180,20 @@ namespace ts {
|
||||
const savedConvertedLoopState = convertedLoopState;
|
||||
convertedLoopState = undefined;
|
||||
const ancestorFacts = enterSubtree(HierarchyFacts.FunctionExcludes, HierarchyFacts.FunctionIncludes);
|
||||
const updated = visitEachChild(node, visitor, context);
|
||||
let updated: AccessorDeclaration;
|
||||
if (node.transformFlags & TransformFlags.ContainsCapturedLexicalThis) {
|
||||
const parameters = visitParameterList(node.parameters, visitor, context);
|
||||
const body = transformFunctionBody(node);
|
||||
if (node.kind === SyntaxKind.GetAccessor) {
|
||||
updated = updateGetAccessor(node, node.decorators, node.modifiers, node.name, parameters, node.type, body);
|
||||
}
|
||||
else {
|
||||
updated = updateSetAccessor(node, node.decorators, node.modifiers, node.name, parameters, body);
|
||||
}
|
||||
}
|
||||
else {
|
||||
updated = visitEachChild(node, visitor, context);
|
||||
}
|
||||
exitSubtree(ancestorFacts, HierarchyFacts.PropagateNewTargetMask, HierarchyFacts.None);
|
||||
convertedLoopState = savedConvertedLoopState;
|
||||
return updated;
|
||||
@@ -3712,7 +3725,7 @@ namespace ts {
|
||||
function substituteIdentifier(node: Identifier) {
|
||||
// Only substitute the identifier if we have enabled substitutions for block-scoped
|
||||
// bindings.
|
||||
if (enabledSubstitutions & ES2015SubstitutionFlags.BlockScopedBindings) {
|
||||
if (enabledSubstitutions & ES2015SubstitutionFlags.BlockScopedBindings && !isInternalName(node)) {
|
||||
const original = getParseTreeNode(node, isIdentifier);
|
||||
if (original && isNameOfDeclarationWithCollidingName(original)) {
|
||||
return setTextRange(getGeneratedNameForNode(original), node);
|
||||
@@ -3735,7 +3748,7 @@ namespace ts {
|
||||
case SyntaxKind.ClassDeclaration:
|
||||
case SyntaxKind.EnumDeclaration:
|
||||
case SyntaxKind.VariableDeclaration:
|
||||
return (<Declaration>parent).name === node
|
||||
return (<NamedDeclaration>parent).name === node
|
||||
&& resolver.isDeclarationWithCollidingName(<Declaration>parent);
|
||||
}
|
||||
|
||||
@@ -3765,16 +3778,42 @@ namespace ts {
|
||||
* @param node An Identifier node.
|
||||
*/
|
||||
function substituteExpressionIdentifier(node: Identifier): Identifier {
|
||||
if (enabledSubstitutions & ES2015SubstitutionFlags.BlockScopedBindings) {
|
||||
if (enabledSubstitutions & ES2015SubstitutionFlags.BlockScopedBindings && !isInternalName(node)) {
|
||||
const declaration = resolver.getReferencedDeclarationWithCollidingName(node);
|
||||
if (declaration) {
|
||||
return setTextRange(getGeneratedNameForNode(declaration.name), node);
|
||||
if (declaration && !(isClassLike(declaration) && isPartOfClassBody(declaration, node))) {
|
||||
return setTextRange(getGeneratedNameForNode(getNameOfDeclaration(declaration)), node);
|
||||
}
|
||||
}
|
||||
|
||||
return node;
|
||||
}
|
||||
|
||||
function isPartOfClassBody(declaration: ClassLikeDeclaration, node: Identifier) {
|
||||
let currentNode = getParseTreeNode(node);
|
||||
if (!currentNode || currentNode === declaration || currentNode.end <= declaration.pos || currentNode.pos >= declaration.end) {
|
||||
// if the node has no correlation to a parse tree node, its definitely not
|
||||
// part of the body.
|
||||
// if the node is outside of the document range of the declaration, its
|
||||
// definitely not part of the body.
|
||||
return false;
|
||||
}
|
||||
const blockScope = getEnclosingBlockScopeContainer(declaration);
|
||||
while (currentNode) {
|
||||
if (currentNode === blockScope || currentNode === declaration) {
|
||||
// if we are in the enclosing block scope of the declaration, we are definitely
|
||||
// not inside the class body.
|
||||
return false;
|
||||
}
|
||||
if (isClassElement(currentNode) && currentNode.parent === declaration) {
|
||||
// we are in the class body, but we treat static fields as outside of the class body
|
||||
return currentNode.kind !== SyntaxKind.PropertyDeclaration
|
||||
|| (getModifierFlags(currentNode) & ModifierFlags.Static) === 0;
|
||||
}
|
||||
currentNode = currentNode.parent;
|
||||
}
|
||||
return false;
|
||||
}
|
||||
|
||||
/**
|
||||
* Substitutes `this` when contained within an arrow function.
|
||||
*
|
||||
@@ -3789,8 +3828,9 @@ namespace ts {
|
||||
}
|
||||
|
||||
function getClassMemberPrefix(node: ClassExpression | ClassDeclaration, member: ClassElement) {
|
||||
const expression = getLocalName(node);
|
||||
return hasModifier(member, ModifierFlags.Static) ? expression : createPropertyAccess(expression, "prototype");
|
||||
return hasModifier(member, ModifierFlags.Static)
|
||||
? getInternalName(node)
|
||||
: createPropertyAccess(getInternalName(node), "prototype");
|
||||
}
|
||||
|
||||
function hasSynthesizedDefaultSuperCall(constructor: ConstructorDeclaration, hasExtendsClause: boolean) {
|
||||
|
||||
@@ -106,15 +106,11 @@ namespace ts {
|
||||
}
|
||||
}
|
||||
|
||||
function visitAwaitExpression(node: AwaitExpression) {
|
||||
function visitAwaitExpression(node: AwaitExpression): Expression {
|
||||
if (enclosingFunctionFlags & FunctionFlags.Async && enclosingFunctionFlags & FunctionFlags.Generator) {
|
||||
const expression = visitNode(node.expression, visitor, isExpression);
|
||||
return setOriginalNode(
|
||||
setTextRange(
|
||||
createYield(
|
||||
/*asteriskToken*/ undefined,
|
||||
createArrayLiteral([createLiteral("await"), expression])
|
||||
),
|
||||
createYield(createAwaitHelper(context, visitNode(node.expression, visitor, isExpression))),
|
||||
/*location*/ node
|
||||
),
|
||||
node
|
||||
@@ -124,18 +120,26 @@ namespace ts {
|
||||
}
|
||||
|
||||
function visitYieldExpression(node: YieldExpression) {
|
||||
if (enclosingFunctionFlags & FunctionFlags.Async && enclosingFunctionFlags & FunctionFlags.Generator) {
|
||||
if (enclosingFunctionFlags & FunctionFlags.Async && enclosingFunctionFlags & FunctionFlags.Generator && node.asteriskToken) {
|
||||
const expression = visitNode(node.expression, visitor, isExpression);
|
||||
return updateYield(
|
||||
node,
|
||||
node.asteriskToken,
|
||||
node.asteriskToken
|
||||
? createAsyncDelegatorHelper(context, expression, expression)
|
||||
: createArrayLiteral(
|
||||
expression
|
||||
? [createLiteral("yield"), expression]
|
||||
: [createLiteral("yield")]
|
||||
)
|
||||
return setOriginalNode(
|
||||
setTextRange(
|
||||
createYield(
|
||||
createAwaitHelper(context,
|
||||
updateYield(
|
||||
node,
|
||||
node.asteriskToken,
|
||||
createAsyncDelegatorHelper(
|
||||
context,
|
||||
createAsyncValuesHelper(context, expression, expression),
|
||||
expression
|
||||
)
|
||||
)
|
||||
)
|
||||
),
|
||||
node
|
||||
),
|
||||
node
|
||||
);
|
||||
}
|
||||
return visitEachChild(node, visitor, context);
|
||||
@@ -347,6 +351,10 @@ namespace ts {
|
||||
);
|
||||
}
|
||||
|
||||
function awaitAsYield(expression: Expression) {
|
||||
return createYield(/*asteriskToken*/ undefined, enclosingFunctionFlags & FunctionFlags.Generator ? createAwaitHelper(context, expression) : expression);
|
||||
}
|
||||
|
||||
function transformForAwaitOfStatement(node: ForOfStatement, outermostLabeledStatement: LabeledStatement) {
|
||||
const expression = visitNode(node.expression, visitor, isExpression);
|
||||
const iterator = isIdentifier(expression) ? getGeneratedNameForNode(expression) : createTempVariable(/*recordTempVariable*/ undefined);
|
||||
@@ -354,16 +362,11 @@ namespace ts {
|
||||
const errorRecord = createUniqueName("e");
|
||||
const catchVariable = getGeneratedNameForNode(errorRecord);
|
||||
const returnMethod = createTempVariable(/*recordTempVariable*/ undefined);
|
||||
const values = createAsyncValuesHelper(context, expression, /*location*/ node.expression);
|
||||
const next = createYield(
|
||||
/*asteriskToken*/ undefined,
|
||||
enclosingFunctionFlags & FunctionFlags.Generator
|
||||
? createArrayLiteral([
|
||||
createLiteral("await"),
|
||||
createCall(createPropertyAccess(iterator, "next" ), /*typeArguments*/ undefined, [])
|
||||
])
|
||||
: createCall(createPropertyAccess(iterator, "next" ), /*typeArguments*/ undefined, [])
|
||||
);
|
||||
const callValues = createAsyncValuesHelper(context, expression, /*location*/ node.expression);
|
||||
const callNext = createCall(createPropertyAccess(iterator, "next" ), /*typeArguments*/ undefined, []);
|
||||
const getDone = createPropertyAccess(result, "done");
|
||||
const getValue = createPropertyAccess(result, "value");
|
||||
const callReturn = createFunctionCall(returnMethod, iterator, []);
|
||||
|
||||
hoistVariableDeclaration(errorRecord);
|
||||
hoistVariableDeclaration(returnMethod);
|
||||
@@ -374,16 +377,19 @@ namespace ts {
|
||||
/*initializer*/ setEmitFlags(
|
||||
setTextRange(
|
||||
createVariableDeclarationList([
|
||||
setTextRange(createVariableDeclaration(iterator, /*type*/ undefined, values), node.expression),
|
||||
createVariableDeclaration(result, /*type*/ undefined, next)
|
||||
setTextRange(createVariableDeclaration(iterator, /*type*/ undefined, callValues), node.expression),
|
||||
createVariableDeclaration(result)
|
||||
]),
|
||||
node.expression
|
||||
),
|
||||
EmitFlags.NoHoisting
|
||||
),
|
||||
/*condition*/ createLogicalNot(createPropertyAccess(result, "done")),
|
||||
/*incrementor*/ createAssignment(result, next),
|
||||
/*statement*/ convertForOfStatementHead(node, createPropertyAccess(result, "value"))
|
||||
/*condition*/ createComma(
|
||||
createAssignment(result, awaitAsYield(callNext)),
|
||||
createLogicalNot(getDone)
|
||||
),
|
||||
/*incrementor*/ undefined,
|
||||
/*statement*/ convertForOfStatementHead(node, awaitAsYield(getValue))
|
||||
),
|
||||
/*location*/ node
|
||||
),
|
||||
@@ -421,26 +427,14 @@ namespace ts {
|
||||
createLogicalAnd(
|
||||
createLogicalAnd(
|
||||
result,
|
||||
createLogicalNot(
|
||||
createPropertyAccess(result, "done")
|
||||
)
|
||||
createLogicalNot(getDone)
|
||||
),
|
||||
createAssignment(
|
||||
returnMethod,
|
||||
createPropertyAccess(iterator, "return")
|
||||
)
|
||||
),
|
||||
createStatement(
|
||||
createYield(
|
||||
/*asteriskToken*/ undefined,
|
||||
enclosingFunctionFlags & FunctionFlags.Generator
|
||||
? createArrayLiteral([
|
||||
createLiteral("await"),
|
||||
createFunctionCall(returnMethod, iterator, [])
|
||||
])
|
||||
: createFunctionCall(returnMethod, iterator, [])
|
||||
)
|
||||
)
|
||||
createStatement(awaitAsYield(callReturn))
|
||||
),
|
||||
EmitFlags.SingleLine
|
||||
)
|
||||
@@ -880,27 +874,39 @@ namespace ts {
|
||||
);
|
||||
}
|
||||
|
||||
const awaitHelper: EmitHelper = {
|
||||
name: "typescript:await",
|
||||
scoped: false,
|
||||
text: `
|
||||
var __await = (this && this.__await) || function (v) { return this instanceof __await ? (this.v = v, this) : new __await(v); }
|
||||
`
|
||||
};
|
||||
|
||||
function createAwaitHelper(context: TransformationContext, expression: Expression) {
|
||||
context.requestEmitHelper(awaitHelper);
|
||||
return createCall(getHelperName("__await"), /*typeArguments*/ undefined, [expression]);
|
||||
}
|
||||
|
||||
const asyncGeneratorHelper: EmitHelper = {
|
||||
name: "typescript:asyncGenerator",
|
||||
scoped: false,
|
||||
text: `
|
||||
var __asyncGenerator = (this && this.__asyncGenerator) || function (thisArg, _arguments, generator) {
|
||||
if (!Symbol.asyncIterator) throw new TypeError("Symbol.asyncIterator is not defined.");
|
||||
var g = generator.apply(thisArg, _arguments || []), q = [], c, i;
|
||||
return i = { next: verb("next"), "throw": verb("throw"), "return": verb("return") }, i[Symbol.asyncIterator] = function () { return this; }, i;
|
||||
function verb(n) { return function (v) { return new Promise(function (a, b) { q.push([n, v, a, b]), next(); }); }; }
|
||||
function next() { if (!c && q.length) resume((c = q.shift())[0], c[1]); }
|
||||
function resume(n, v) { try { step(g[n](v)); } catch (e) { settle(c[3], e); } }
|
||||
function step(r) { r.done ? settle(c[2], r) : Promise.resolve(r.value[1]).then(r.value[0] === "yield" ? send : fulfill, reject); }
|
||||
function send(value) { settle(c[2], { value: value, done: false }); }
|
||||
var g = generator.apply(thisArg, _arguments || []), i, q = [];
|
||||
return i = {}, verb("next"), verb("throw"), verb("return"), i[Symbol.asyncIterator] = function () { return this; }, i;
|
||||
function verb(n) { if (g[n]) i[n] = function (v) { return new Promise(function (a, b) { q.push([n, v, a, b]) > 1 || resume(n, v); }); }; }
|
||||
function resume(n, v) { try { step(g[n](v)); } catch (e) { settle(q[0][3], e); } }
|
||||
function step(r) { r.value instanceof __await ? Promise.resolve(r.value.v).then(fulfill, reject) : settle(q[0][2], r); }
|
||||
function fulfill(value) { resume("next", value); }
|
||||
function reject(value) { resume("throw", value); }
|
||||
function settle(f, v) { c = void 0, f(v), next(); }
|
||||
function settle(f, v) { if (f(v), q.shift(), q.length) resume(q[0][0], q[0][1]); }
|
||||
};
|
||||
`
|
||||
};
|
||||
|
||||
function createAsyncGeneratorHelper(context: TransformationContext, generatorFunc: FunctionExpression) {
|
||||
context.requestEmitHelper(awaitHelper);
|
||||
context.requestEmitHelper(asyncGeneratorHelper);
|
||||
|
||||
// Mark this node as originally an async function
|
||||
@@ -922,16 +928,16 @@ namespace ts {
|
||||
scoped: false,
|
||||
text: `
|
||||
var __asyncDelegator = (this && this.__asyncDelegator) || function (o) {
|
||||
var i = { next: verb("next"), "throw": verb("throw", function (e) { throw e; }), "return": verb("return", function (v) { return { value: v, done: true }; }) }, p;
|
||||
return o = __asyncValues(o), i[Symbol.iterator] = function () { return this; }, i;
|
||||
function verb(n, f) { return function (v) { return v = p && n === "throw" ? f(v) : p && v.done ? v : { value: p ? ["yield", v.value] : ["await", (o[n] || f).call(o, v)], done: false }, p = !p, v; }; }
|
||||
var i, p;
|
||||
return i = {}, verb("next"), verb("throw", function (e) { throw e; }), verb("return"), i[Symbol.iterator] = function () { return this; }, i;
|
||||
function verb(n, f) { if (o[n]) i[n] = function (v) { return (p = !p) ? { value: __await(o[n](v)), done: n === "return" } : f ? f(v) : v; }; }
|
||||
};
|
||||
`
|
||||
};
|
||||
|
||||
function createAsyncDelegatorHelper(context: TransformationContext, expression: Expression, location?: TextRange) {
|
||||
context.requestEmitHelper(awaitHelper);
|
||||
context.requestEmitHelper(asyncDelegator);
|
||||
context.requestEmitHelper(asyncValues);
|
||||
return setTextRange(
|
||||
createCall(
|
||||
getHelperName("__asyncDelegator"),
|
||||
|
||||
+43
-34
@@ -605,10 +605,13 @@ namespace ts {
|
||||
|
||||
export interface Declaration extends Node {
|
||||
_declarationBrand: any;
|
||||
}
|
||||
|
||||
export interface NamedDeclaration extends Declaration {
|
||||
name?: DeclarationName;
|
||||
}
|
||||
|
||||
export interface DeclarationStatement extends Declaration, Statement {
|
||||
export interface DeclarationStatement extends NamedDeclaration, Statement {
|
||||
name?: Identifier | StringLiteral | NumericLiteral;
|
||||
}
|
||||
|
||||
@@ -622,7 +625,7 @@ namespace ts {
|
||||
expression: LeftHandSideExpression;
|
||||
}
|
||||
|
||||
export interface TypeParameterDeclaration extends Declaration {
|
||||
export interface TypeParameterDeclaration extends NamedDeclaration {
|
||||
kind: SyntaxKind.TypeParameter;
|
||||
parent?: DeclarationWithTypeParameters;
|
||||
name: Identifier;
|
||||
@@ -633,7 +636,7 @@ namespace ts {
|
||||
expression?: Expression;
|
||||
}
|
||||
|
||||
export interface SignatureDeclaration extends Declaration {
|
||||
export interface SignatureDeclaration extends NamedDeclaration {
|
||||
name?: PropertyName;
|
||||
typeParameters?: NodeArray<TypeParameterDeclaration>;
|
||||
parameters: NodeArray<ParameterDeclaration>;
|
||||
@@ -650,7 +653,7 @@ namespace ts {
|
||||
|
||||
export type BindingName = Identifier | BindingPattern;
|
||||
|
||||
export interface VariableDeclaration extends Declaration {
|
||||
export interface VariableDeclaration extends NamedDeclaration {
|
||||
kind: SyntaxKind.VariableDeclaration;
|
||||
parent?: VariableDeclarationList | CatchClause;
|
||||
name: BindingName; // Declared variable name
|
||||
@@ -664,7 +667,7 @@ namespace ts {
|
||||
declarations: NodeArray<VariableDeclaration>;
|
||||
}
|
||||
|
||||
export interface ParameterDeclaration extends Declaration {
|
||||
export interface ParameterDeclaration extends NamedDeclaration {
|
||||
kind: SyntaxKind.Parameter;
|
||||
parent?: SignatureDeclaration;
|
||||
dotDotDotToken?: DotDotDotToken; // Present on rest parameter
|
||||
@@ -674,7 +677,7 @@ namespace ts {
|
||||
initializer?: Expression; // Optional initializer
|
||||
}
|
||||
|
||||
export interface BindingElement extends Declaration {
|
||||
export interface BindingElement extends NamedDeclaration {
|
||||
kind: SyntaxKind.BindingElement;
|
||||
parent?: BindingPattern;
|
||||
propertyName?: PropertyName; // Binding property name (in object binding pattern)
|
||||
@@ -699,7 +702,7 @@ namespace ts {
|
||||
initializer?: Expression; // Optional initializer
|
||||
}
|
||||
|
||||
export interface ObjectLiteralElement extends Declaration {
|
||||
export interface ObjectLiteralElement extends NamedDeclaration {
|
||||
_objectLiteralBrandBrand: any;
|
||||
name?: PropertyName;
|
||||
}
|
||||
@@ -743,7 +746,7 @@ namespace ts {
|
||||
// SyntaxKind.ShorthandPropertyAssignment
|
||||
// SyntaxKind.EnumMember
|
||||
// SyntaxKind.JSDocPropertyTag
|
||||
export interface VariableLikeDeclaration extends Declaration {
|
||||
export interface VariableLikeDeclaration extends NamedDeclaration {
|
||||
propertyName?: PropertyName;
|
||||
dotDotDotToken?: DotDotDotToken;
|
||||
name: DeclarationName;
|
||||
@@ -752,7 +755,7 @@ namespace ts {
|
||||
initializer?: Expression;
|
||||
}
|
||||
|
||||
export interface PropertyLikeDeclaration extends Declaration {
|
||||
export interface PropertyLikeDeclaration extends NamedDeclaration {
|
||||
name: PropertyName;
|
||||
}
|
||||
|
||||
@@ -1216,8 +1219,7 @@ namespace ts {
|
||||
|
||||
export type BinaryOperatorToken = Token<BinaryOperator>;
|
||||
|
||||
// Binary expressions can be declarations if they are 'exports.foo = bar' expressions in JS files
|
||||
export interface BinaryExpression extends Expression, Declaration {
|
||||
export interface BinaryExpression extends Expression, Declaration {
|
||||
kind: SyntaxKind.BinaryExpression;
|
||||
left: Expression;
|
||||
operatorToken: BinaryOperatorToken;
|
||||
@@ -1417,7 +1419,7 @@ namespace ts {
|
||||
export type EntityNameExpression = Identifier | PropertyAccessEntityNameExpression | ParenthesizedExpression;
|
||||
export type EntityNameOrEntityNameExpression = EntityName | EntityNameExpression;
|
||||
|
||||
export interface PropertyAccessExpression extends MemberExpression, Declaration {
|
||||
export interface PropertyAccessExpression extends MemberExpression, NamedDeclaration {
|
||||
kind: SyntaxKind.PropertyAccessExpression;
|
||||
expression: LeftHandSideExpression;
|
||||
name: Identifier;
|
||||
@@ -1762,7 +1764,7 @@ namespace ts {
|
||||
|
||||
export type DeclarationWithTypeParameters = SignatureDeclaration | ClassLikeDeclaration | InterfaceDeclaration | TypeAliasDeclaration;
|
||||
|
||||
export interface ClassLikeDeclaration extends Declaration {
|
||||
export interface ClassLikeDeclaration extends NamedDeclaration {
|
||||
name?: Identifier;
|
||||
typeParameters?: NodeArray<TypeParameterDeclaration>;
|
||||
heritageClauses?: NodeArray<HeritageClause>;
|
||||
@@ -1778,12 +1780,12 @@ namespace ts {
|
||||
kind: SyntaxKind.ClassExpression;
|
||||
}
|
||||
|
||||
export interface ClassElement extends Declaration {
|
||||
export interface ClassElement extends NamedDeclaration {
|
||||
_classElementBrand: any;
|
||||
name?: PropertyName;
|
||||
}
|
||||
|
||||
export interface TypeElement extends Declaration {
|
||||
export interface TypeElement extends NamedDeclaration {
|
||||
_typeElementBrand: any;
|
||||
name?: PropertyName;
|
||||
questionToken?: QuestionToken;
|
||||
@@ -1811,7 +1813,7 @@ namespace ts {
|
||||
type: TypeNode;
|
||||
}
|
||||
|
||||
export interface EnumMember extends Declaration {
|
||||
export interface EnumMember extends NamedDeclaration {
|
||||
kind: SyntaxKind.EnumMember;
|
||||
parent?: EnumDeclaration;
|
||||
// This does include ComputedPropertyName, but the parser will give an error
|
||||
@@ -1900,14 +1902,14 @@ namespace ts {
|
||||
// import d, * as ns from "mod" => name = d, namedBinding: NamespaceImport = { name: ns }
|
||||
// import { a, b as x } from "mod" => name = undefined, namedBinding: NamedImports = { elements: [{ name: a }, { name: x, propertyName: b}]}
|
||||
// import d, { a, b as x } from "mod" => name = d, namedBinding: NamedImports = { elements: [{ name: a }, { name: x, propertyName: b}]}
|
||||
export interface ImportClause extends Declaration {
|
||||
export interface ImportClause extends NamedDeclaration {
|
||||
kind: SyntaxKind.ImportClause;
|
||||
parent?: ImportDeclaration;
|
||||
name?: Identifier; // Default binding
|
||||
namedBindings?: NamedImportBindings;
|
||||
}
|
||||
|
||||
export interface NamespaceImport extends Declaration {
|
||||
export interface NamespaceImport extends NamedDeclaration {
|
||||
kind: SyntaxKind.NamespaceImport;
|
||||
parent?: ImportClause;
|
||||
name: Identifier;
|
||||
@@ -1940,14 +1942,14 @@ namespace ts {
|
||||
|
||||
export type NamedImportsOrExports = NamedImports | NamedExports;
|
||||
|
||||
export interface ImportSpecifier extends Declaration {
|
||||
export interface ImportSpecifier extends NamedDeclaration {
|
||||
kind: SyntaxKind.ImportSpecifier;
|
||||
parent?: NamedImports;
|
||||
propertyName?: Identifier; // Name preceding "as" keyword (or undefined when "as" is absent)
|
||||
name: Identifier; // Declared name
|
||||
}
|
||||
|
||||
export interface ExportSpecifier extends Declaration {
|
||||
export interface ExportSpecifier extends NamedDeclaration {
|
||||
kind: SyntaxKind.ExportSpecifier;
|
||||
parent?: NamedExports;
|
||||
propertyName?: Identifier; // Name preceding "as" keyword (or undefined when "as" is absent)
|
||||
@@ -2113,7 +2115,7 @@ namespace ts {
|
||||
typeExpression: JSDocTypeExpression;
|
||||
}
|
||||
|
||||
export interface JSDocTypedefTag extends JSDocTag, Declaration {
|
||||
export interface JSDocTypedefTag extends JSDocTag, NamedDeclaration {
|
||||
kind: SyntaxKind.JSDocTypedefTag;
|
||||
fullName?: JSDocNamespaceDeclaration | Identifier;
|
||||
name?: Identifier;
|
||||
@@ -2727,7 +2729,6 @@ namespace ts {
|
||||
writeTypeOfDeclaration(declaration: AccessorDeclaration | VariableLikeDeclaration, enclosingDeclaration: Node, flags: TypeFormatFlags, writer: SymbolWriter): void;
|
||||
writeReturnTypeOfSignatureDeclaration(signatureDeclaration: SignatureDeclaration, enclosingDeclaration: Node, flags: TypeFormatFlags, writer: SymbolWriter): void;
|
||||
writeTypeOfExpression(expr: Expression, enclosingDeclaration: Node, flags: TypeFormatFlags, writer: SymbolWriter): void;
|
||||
writeBaseConstructorTypeOfClass(node: ClassLikeDeclaration, enclosingDeclaration: Node, flags: TypeFormatFlags, writer: SymbolWriter): void;
|
||||
isSymbolAccessible(symbol: Symbol, enclosingDeclaration: Node, meaning: SymbolFlags, shouldComputeAliasToMarkVisible: boolean): SymbolAccessibilityResult;
|
||||
isEntityNameVisible(entityName: EntityNameOrEntityNameExpression, enclosingDeclaration: Node): SymbolVisibilityResult;
|
||||
// Returns the constant value this property access resolves to, or 'undefined' for a non-constant
|
||||
@@ -3940,14 +3941,15 @@ namespace ts {
|
||||
HelperName = 1 << 12,
|
||||
ExportName = 1 << 13, // Ensure an export prefix is added for an identifier that points to an exported declaration with a local name (see SymbolFlags.ExportHasLocal).
|
||||
LocalName = 1 << 14, // Ensure an export prefix is not added for an identifier that points to an exported declaration.
|
||||
Indented = 1 << 15, // Adds an explicit extra indentation level for class and function bodies when printing (used to match old emitter).
|
||||
NoIndentation = 1 << 16, // Do not indent the node.
|
||||
AsyncFunctionBody = 1 << 17,
|
||||
ReuseTempVariableScope = 1 << 18, // Reuse the existing temp variable scope during emit.
|
||||
CustomPrologue = 1 << 19, // Treat the statement as if it were a prologue directive (NOTE: Prologue directives are *not* transformed).
|
||||
NoHoisting = 1 << 20, // Do not hoist this declaration in --module system
|
||||
HasEndOfDeclarationMarker = 1 << 21, // Declaration has an associated NotEmittedStatement to mark the end of the declaration
|
||||
Iterator = 1 << 22, // The expression to a `yield*` should be treated as an Iterator when down-leveling, not an Iterable.
|
||||
InternalName = 1 << 15, // The name is internal to an ES5 class body function.
|
||||
Indented = 1 << 16, // Adds an explicit extra indentation level for class and function bodies when printing (used to match old emitter).
|
||||
NoIndentation = 1 << 17, // Do not indent the node.
|
||||
AsyncFunctionBody = 1 << 18,
|
||||
ReuseTempVariableScope = 1 << 19, // Reuse the existing temp variable scope during emit.
|
||||
CustomPrologue = 1 << 20, // Treat the statement as if it were a prologue directive (NOTE: Prologue directives are *not* transformed).
|
||||
NoHoisting = 1 << 21, // Do not hoist this declaration in --module system
|
||||
HasEndOfDeclarationMarker = 1 << 22, // Declaration has an associated NotEmittedStatement to mark the end of the declaration
|
||||
Iterator = 1 << 23, // The expression to a `yield*` should be treated as an Iterator when down-leveling, not an Iterable.
|
||||
}
|
||||
|
||||
export interface EmitHelper {
|
||||
@@ -3972,11 +3974,12 @@ namespace ts {
|
||||
Awaiter = 1 << 6, // __awaiter (used by ES2017 async functions transformation)
|
||||
Generator = 1 << 7, // __generator (used by ES2015 generator transformation)
|
||||
Values = 1 << 8, // __values (used by ES2015 for..of and yield* transformations)
|
||||
Read = 1 << 9, // __read (used by ES2015 iterator destructuring transformation)
|
||||
Read = 1 << 9, // __read (used by ES2015 iterator destructuring transformation)
|
||||
Spread = 1 << 10, // __spread (used by ES2015 array spread and argument list spread transformations)
|
||||
AsyncGenerator = 1 << 11, // __asyncGenerator (used by ES2017 async generator transformation)
|
||||
AsyncDelegator = 1 << 12, // __asyncDelegator (used by ES2017 async generator yield* transformation)
|
||||
AsyncValues = 1 << 13, // __asyncValues (used by ES2017 for..await..of transformation)
|
||||
Await = 1 << 11, // __await (used by ES2017 async generator transformation)
|
||||
AsyncGenerator = 1 << 12, // __asyncGenerator (used by ES2017 async generator transformation)
|
||||
AsyncDelegator = 1 << 13, // __asyncDelegator (used by ES2017 async generator yield* transformation)
|
||||
AsyncValues = 1 << 14, // __asyncValues (used by ES2017 for..await..of transformation)
|
||||
|
||||
// Helpers included by ES2015 for..of
|
||||
ForOfIncludes = Values,
|
||||
@@ -3984,6 +3987,12 @@ namespace ts {
|
||||
// Helpers included by ES2017 for..await..of
|
||||
ForAwaitOfIncludes = AsyncValues,
|
||||
|
||||
// Helpers included by ES2017 async generators
|
||||
AsyncGeneratorIncludes = Await | AsyncGenerator,
|
||||
|
||||
// Helpers included by yield* in ES2017 async generators
|
||||
AsyncDelegatorIncludes = Await | AsyncDelegator | AsyncValues,
|
||||
|
||||
// Helpers included by ES2015 spread
|
||||
SpreadIncludes = Read | Spread,
|
||||
|
||||
|
||||
+47
-14
@@ -567,7 +567,7 @@ namespace ts {
|
||||
case SyntaxKind.GetAccessor:
|
||||
case SyntaxKind.SetAccessor:
|
||||
case SyntaxKind.TypeAliasDeclaration:
|
||||
errorNode = (<Declaration>node).name;
|
||||
errorNode = (<NamedDeclaration>node).name;
|
||||
break;
|
||||
case SyntaxKind.ArrowFunction:
|
||||
return getErrorSpanForArrowFunction(sourceFile, <ArrowFunction>node);
|
||||
@@ -1767,12 +1767,42 @@ namespace ts {
|
||||
}
|
||||
|
||||
if (isDeclaration(parent)) {
|
||||
return (<Declaration>parent).name === name;
|
||||
return parent.name === name;
|
||||
}
|
||||
|
||||
return false;
|
||||
}
|
||||
|
||||
export function getNameOfDeclaration(declaration: Declaration): DeclarationName {
|
||||
if (!declaration) {
|
||||
return undefined;
|
||||
}
|
||||
if (declaration.kind === SyntaxKind.BinaryExpression) {
|
||||
const kind = getSpecialPropertyAssignmentKind(declaration as BinaryExpression);
|
||||
const lhs = (declaration as BinaryExpression).left;
|
||||
switch (kind) {
|
||||
case SpecialPropertyAssignmentKind.None:
|
||||
case SpecialPropertyAssignmentKind.ModuleExports:
|
||||
return undefined;
|
||||
case SpecialPropertyAssignmentKind.ExportsProperty:
|
||||
if (lhs.kind === SyntaxKind.Identifier) {
|
||||
return (lhs as PropertyAccessExpression).name;
|
||||
}
|
||||
else {
|
||||
return ((lhs as PropertyAccessExpression).expression as PropertyAccessExpression).name;
|
||||
}
|
||||
case SpecialPropertyAssignmentKind.ThisProperty:
|
||||
case SpecialPropertyAssignmentKind.Property:
|
||||
return (lhs as PropertyAccessExpression).name;
|
||||
case SpecialPropertyAssignmentKind.PrototypeProperty:
|
||||
return ((lhs as PropertyAccessExpression).expression as PropertyAccessExpression).name;
|
||||
}
|
||||
}
|
||||
else {
|
||||
return (declaration as NamedDeclaration).name;
|
||||
}
|
||||
}
|
||||
|
||||
export function isLiteralComputedPropertyDeclarationName(node: Node) {
|
||||
return (node.kind === SyntaxKind.StringLiteral || node.kind === SyntaxKind.NumericLiteral) &&
|
||||
node.parent.kind === SyntaxKind.ComputedPropertyName &&
|
||||
@@ -1793,7 +1823,7 @@ namespace ts {
|
||||
case SyntaxKind.PropertyAssignment:
|
||||
case SyntaxKind.PropertyAccessExpression:
|
||||
// Name in member declaration or property name in property access
|
||||
return (<Declaration | PropertyAccessExpression>parent).name === node;
|
||||
return (<NamedDeclaration | PropertyAccessExpression>parent).name === node;
|
||||
case SyntaxKind.QualifiedName:
|
||||
// Name on right hand side of dot in a type query
|
||||
if ((<QualifiedName>parent).right === node) {
|
||||
@@ -1925,16 +1955,18 @@ namespace ts {
|
||||
}
|
||||
|
||||
export const enum FunctionFlags {
|
||||
Normal = 0,
|
||||
Generator = 1 << 0,
|
||||
Async = 1 << 1,
|
||||
AsyncOrAsyncGenerator = Async | Generator,
|
||||
Invalid = 1 << 2,
|
||||
InvalidAsyncOrAsyncGenerator = AsyncOrAsyncGenerator | Invalid,
|
||||
InvalidGenerator = Generator | Invalid,
|
||||
Normal = 0, // Function is a normal function
|
||||
Generator = 1 << 0, // Function is a generator function or async generator function
|
||||
Async = 1 << 1, // Function is an async function or an async generator function
|
||||
Invalid = 1 << 2, // Function is a signature or overload and does not have a body.
|
||||
AsyncGenerator = Async | Generator, // Function is an async generator function
|
||||
}
|
||||
|
||||
export function getFunctionFlags(node: FunctionLikeDeclaration) {
|
||||
export function getFunctionFlags(node: FunctionLikeDeclaration | undefined) {
|
||||
if (!node) {
|
||||
return FunctionFlags.Invalid;
|
||||
}
|
||||
|
||||
let flags = FunctionFlags.Normal;
|
||||
switch (node.kind) {
|
||||
case SyntaxKind.FunctionDeclaration:
|
||||
@@ -1989,7 +2021,8 @@ namespace ts {
|
||||
* Symbol.
|
||||
*/
|
||||
export function hasDynamicName(declaration: Declaration): boolean {
|
||||
return declaration.name && isDynamicName(declaration.name);
|
||||
const name = getNameOfDeclaration(declaration);
|
||||
return name && isDynamicName(name);
|
||||
}
|
||||
|
||||
export function isDynamicName(name: DeclarationName): boolean {
|
||||
@@ -2754,7 +2787,7 @@ namespace ts {
|
||||
forEach(declarations, (member: Declaration) => {
|
||||
if ((member.kind === SyntaxKind.GetAccessor || member.kind === SyntaxKind.SetAccessor)
|
||||
&& hasModifier(member, ModifierFlags.Static) === hasModifier(accessor, ModifierFlags.Static)) {
|
||||
const memberName = getPropertyNameForPropertyNameNode(member.name);
|
||||
const memberName = getPropertyNameForPropertyNameNode((member as NamedDeclaration).name);
|
||||
const accessorName = getPropertyNameForPropertyNameNode(accessor.name);
|
||||
if (memberName === accessorName) {
|
||||
if (!firstAccessor) {
|
||||
@@ -4070,7 +4103,7 @@ namespace ts {
|
||||
|| kind === SyntaxKind.MergeDeclarationMarker;
|
||||
}
|
||||
|
||||
export function isDeclaration(node: Node): node is Declaration {
|
||||
export function isDeclaration(node: Node): node is NamedDeclaration {
|
||||
return isDeclarationKind(node.kind);
|
||||
}
|
||||
|
||||
|
||||
@@ -655,7 +655,7 @@ namespace FourSlash {
|
||||
ts.zipWith(endMarkers, definitions, (endMarker, definition, i) => {
|
||||
const marker = this.getMarkerByName(endMarker);
|
||||
if (marker.fileName !== definition.fileName || marker.position !== definition.textSpan.start) {
|
||||
this.raiseError(`goToDefinition failed for definition ${i}: expected ${marker.fileName} at ${marker.position}, got ${definition.fileName} at ${definition.textSpan.start}`);
|
||||
this.raiseError(`goToDefinition failed for definition ${endMarker} (${i}): expected ${marker.fileName} at ${marker.position}, got ${definition.fileName} at ${definition.textSpan.start}`);
|
||||
}
|
||||
});
|
||||
}
|
||||
|
||||
+35
-1
@@ -369,7 +369,41 @@ namespace ts.server {
|
||||
protected logger: Logger;
|
||||
private canUseEvents: boolean;
|
||||
|
||||
constructor(opts: SessionOptions) {
|
||||
// New ctor
|
||||
constructor(opts: SessionOptions);
|
||||
// Back-compat ctor, remove / deprecate
|
||||
constructor(
|
||||
/*0*/ host: ServerHost,
|
||||
/*1*/ cancellationToken: ServerCancellationToken,
|
||||
/*2*/ useSingleInferredProject: boolean,
|
||||
/*3*/ typingsInstaller: ITypingsInstaller,
|
||||
/*4*/ byteLength: (buf: string, encoding?: string) => number,
|
||||
/*5*/ hrtime: (start?: number[]) => number[],
|
||||
/*6*/ logger: server.Logger,
|
||||
/*7*/ canUseEvents: boolean,
|
||||
/*8*/ eventHandler?: ProjectServiceEventHandler,
|
||||
/*9*/ throttleWaitMilliseconds?: number);
|
||||
// Implementation
|
||||
constructor(optsOrArg: SessionOptions | ServerHost) {
|
||||
let opts: SessionOptions;
|
||||
if (arguments.length === 1) {
|
||||
opts = optsOrArg as SessionOptions;
|
||||
}
|
||||
else {
|
||||
opts = {
|
||||
host: arguments[0],
|
||||
cancellationToken: arguments[1],
|
||||
useSingleInferredProject: arguments[2],
|
||||
typingsInstaller: arguments[3],
|
||||
byteLength: arguments[4],
|
||||
hrtime: arguments[5],
|
||||
logger: arguments[6],
|
||||
canUseEvents: arguments[7],
|
||||
eventHandler: arguments[8],
|
||||
throttleWaitMilliseconds: arguments[9]
|
||||
};
|
||||
}
|
||||
|
||||
this.host = opts.host;
|
||||
this.cancellationToken = opts.cancellationToken;
|
||||
this.typingsInstaller = opts.typingsInstaller;
|
||||
|
||||
@@ -63,7 +63,7 @@ namespace ts.codefix {
|
||||
|
||||
const declaration = declarations[0] as Declaration;
|
||||
// Clone name to remove leading trivia.
|
||||
const name = getSynthesizedClone(<PropertyName>declaration.name);
|
||||
const name = getSynthesizedClone(getNameOfDeclaration(declaration)) as PropertyName;
|
||||
const visibilityModifier = createVisibilityModifier(getModifierFlags(declaration));
|
||||
const modifiers = visibilityModifier ? createNodeArray([visibilityModifier]) : undefined;
|
||||
const type = checker.getWidenedType(checker.getTypeOfSymbolAtLocation(symbol, enclosingDeclaration));
|
||||
@@ -231,4 +231,4 @@ namespace ts.codefix {
|
||||
}
|
||||
return undefined;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -1214,7 +1214,7 @@ namespace ts.Completions {
|
||||
// TODO(jfreeman): Account for computed property name
|
||||
// NOTE: if one only performs this step when m.name is an identifier,
|
||||
// things like '__proto__' are not filtered out.
|
||||
existingName = (<Identifier>m.name).text;
|
||||
existingName = (getNameOfDeclaration(m) as Identifier).text;
|
||||
}
|
||||
|
||||
existingMemberNames.set(existingName, true);
|
||||
|
||||
@@ -908,7 +908,7 @@ namespace ts.FindAllReferences.Core {
|
||||
* position of property accessing, the referenceEntry of such position will be handled in the first case.
|
||||
*/
|
||||
if (!(flags & SymbolFlags.Transient) && search.includes(shorthandValueSymbol)) {
|
||||
addReference(valueDeclaration.name, shorthandValueSymbol, search.location, state);
|
||||
addReference(getNameOfDeclaration(valueDeclaration), shorthandValueSymbol, search.location, state);
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@@ -487,7 +487,7 @@ namespace ts.formatting {
|
||||
// falls through
|
||||
case SyntaxKind.PropertyDeclaration:
|
||||
case SyntaxKind.Parameter:
|
||||
return (<Declaration>node).name.kind;
|
||||
return getNameOfDeclaration(<Declaration>node).kind;
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@@ -235,7 +235,7 @@ namespace ts.GoToDefinition {
|
||||
|
||||
/** Creates a DefinitionInfo from a Declaration, using the declaration's name if possible. */
|
||||
function createDefinitionInfo(node: Declaration, symbolKind: string, symbolName: string, containerName: string): DefinitionInfo {
|
||||
return createDefinitionInfoFromName(node.name || node, symbolKind, symbolName, containerName);
|
||||
return createDefinitionInfoFromName(getNameOfDeclaration(node) || node, symbolKind, symbolName, containerName);
|
||||
}
|
||||
|
||||
/** Creates a DefinitionInfo directly from the name of a declaration. */
|
||||
|
||||
@@ -212,6 +212,10 @@ namespace ts.FindAllReferences {
|
||||
return;
|
||||
}
|
||||
|
||||
if (!decl.importClause) {
|
||||
return;
|
||||
}
|
||||
|
||||
const { importClause } = decl;
|
||||
|
||||
const { namedBindings } = importClause;
|
||||
@@ -533,7 +537,10 @@ namespace ts.FindAllReferences {
|
||||
return symbol.name;
|
||||
}
|
||||
|
||||
const name = forEach(symbol.declarations, ({ name }) => name && name.kind === SyntaxKind.Identifier && name.text);
|
||||
const name = forEach(symbol.declarations, decl => {
|
||||
const name = getNameOfDeclaration(decl);
|
||||
return name && name.kind === SyntaxKind.Identifier && name.text;
|
||||
});
|
||||
Debug.assert(!!name);
|
||||
return name;
|
||||
}
|
||||
|
||||
+22
-17
@@ -52,7 +52,7 @@ namespace ts.NavigateTo {
|
||||
rawItems = filter(rawItems, item => {
|
||||
const decl = item.declaration;
|
||||
if (decl.kind === SyntaxKind.ImportClause || decl.kind === SyntaxKind.ImportSpecifier || decl.kind === SyntaxKind.ImportEqualsDeclaration) {
|
||||
const importer = checker.getSymbolAtLocation(decl.name);
|
||||
const importer = checker.getSymbolAtLocation((decl as NamedDeclaration).name);
|
||||
const imported = checker.getAliasedSymbol(importer);
|
||||
return importer.name !== imported.name;
|
||||
}
|
||||
@@ -97,17 +97,20 @@ namespace ts.NavigateTo {
|
||||
}
|
||||
|
||||
function tryAddSingleDeclarationName(declaration: Declaration, containers: string[]) {
|
||||
if (declaration && declaration.name) {
|
||||
const text = getTextOfIdentifierOrLiteral(declaration.name);
|
||||
if (text !== undefined) {
|
||||
containers.unshift(text);
|
||||
}
|
||||
else if (declaration.name.kind === SyntaxKind.ComputedPropertyName) {
|
||||
return tryAddComputedPropertyName((<ComputedPropertyName>declaration.name).expression, containers, /*includeLastPortion*/ true);
|
||||
}
|
||||
else {
|
||||
// Don't know how to add this.
|
||||
return false;
|
||||
if (declaration) {
|
||||
const name = getNameOfDeclaration(declaration);
|
||||
if (name) {
|
||||
const text = getTextOfIdentifierOrLiteral(name);
|
||||
if (text !== undefined) {
|
||||
containers.unshift(text);
|
||||
}
|
||||
else if (name.kind === SyntaxKind.ComputedPropertyName) {
|
||||
return tryAddComputedPropertyName((<ComputedPropertyName>name).expression, containers, /*includeLastPortion*/ true);
|
||||
}
|
||||
else {
|
||||
// Don't know how to add this.
|
||||
return false;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -143,8 +146,9 @@ namespace ts.NavigateTo {
|
||||
|
||||
// First, if we started with a computed property name, then add all but the last
|
||||
// portion into the container array.
|
||||
if (declaration.name.kind === SyntaxKind.ComputedPropertyName) {
|
||||
if (!tryAddComputedPropertyName((<ComputedPropertyName>declaration.name).expression, containers, /*includeLastPortion*/ false)) {
|
||||
const name = getNameOfDeclaration(declaration);
|
||||
if (name.kind === SyntaxKind.ComputedPropertyName) {
|
||||
if (!tryAddComputedPropertyName((<ComputedPropertyName>name).expression, containers, /*includeLastPortion*/ false)) {
|
||||
return undefined;
|
||||
}
|
||||
}
|
||||
@@ -190,6 +194,7 @@ namespace ts.NavigateTo {
|
||||
function createNavigateToItem(rawItem: RawNavigateToItem): NavigateToItem {
|
||||
const declaration = rawItem.declaration;
|
||||
const container = <Declaration>getContainerNode(declaration);
|
||||
const containerName = container && getNameOfDeclaration(container);
|
||||
return {
|
||||
name: rawItem.name,
|
||||
kind: getNodeKind(declaration),
|
||||
@@ -199,9 +204,9 @@ namespace ts.NavigateTo {
|
||||
fileName: rawItem.fileName,
|
||||
textSpan: createTextSpanFromNode(declaration),
|
||||
// TODO(jfreeman): What should be the containerName when the container has a computed name?
|
||||
containerName: container && container.name ? (<Identifier>container.name).text : "",
|
||||
containerKind: container && container.name ? getNodeKind(container) : ""
|
||||
containerName: containerName ? (<Identifier>containerName).text : "",
|
||||
containerKind: containerName ? getNodeKind(container) : ""
|
||||
};
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -279,8 +279,8 @@ namespace ts.NavigationBar {
|
||||
function mergeChildren(children: NavigationBarNode[]): void {
|
||||
const nameToItems = createMap<NavigationBarNode | NavigationBarNode[]>();
|
||||
filterMutate(children, child => {
|
||||
const decl = <Declaration>child.node;
|
||||
const name = decl.name && nodeText(decl.name);
|
||||
const declName = getNameOfDeclaration(<Declaration>child.node);
|
||||
const name = declName && nodeText(declName);
|
||||
if (!name) {
|
||||
// Anonymous items are never merged.
|
||||
return true;
|
||||
@@ -378,9 +378,9 @@ namespace ts.NavigationBar {
|
||||
return getModuleName(<ModuleDeclaration>node);
|
||||
}
|
||||
|
||||
const decl = <Declaration>node;
|
||||
if (decl.name) {
|
||||
return getPropertyNameForPropertyNameNode(decl.name);
|
||||
const declName = getNameOfDeclaration(<Declaration>node);
|
||||
if (declName) {
|
||||
return getPropertyNameForPropertyNameNode(declName);
|
||||
}
|
||||
switch (node.kind) {
|
||||
case SyntaxKind.FunctionExpression:
|
||||
@@ -399,7 +399,7 @@ namespace ts.NavigationBar {
|
||||
return getModuleName(<ModuleDeclaration>node);
|
||||
}
|
||||
|
||||
const name = (<Declaration>node).name;
|
||||
const name = getNameOfDeclaration(<Declaration>node);
|
||||
if (name) {
|
||||
const text = nodeText(name);
|
||||
if (text.length > 0) {
|
||||
|
||||
@@ -575,14 +575,15 @@ namespace ts {
|
||||
}
|
||||
|
||||
function getDeclarationName(declaration: Declaration) {
|
||||
if (declaration.name) {
|
||||
const result = getTextOfIdentifierOrLiteral(declaration.name);
|
||||
const name = getNameOfDeclaration(declaration);
|
||||
if (name) {
|
||||
const result = getTextOfIdentifierOrLiteral(name);
|
||||
if (result !== undefined) {
|
||||
return result;
|
||||
}
|
||||
|
||||
if (declaration.name.kind === SyntaxKind.ComputedPropertyName) {
|
||||
const expr = (<ComputedPropertyName>declaration.name).expression;
|
||||
if (name.kind === SyntaxKind.ComputedPropertyName) {
|
||||
const expr = (<ComputedPropertyName>name).expression;
|
||||
if (expr.kind === SyntaxKind.PropertyAccessExpression) {
|
||||
return (<PropertyAccessExpression>expr).name.text;
|
||||
}
|
||||
|
||||
@@ -1038,7 +1038,11 @@ namespace ts {
|
||||
return this.forwardJSONCall(`resolveModuleName('${fileName}')`, () => {
|
||||
const compilerOptions = <CompilerOptions>JSON.parse(compilerOptionsJson);
|
||||
const result = resolveModuleName(moduleName, normalizeSlashes(fileName), compilerOptions, this.host);
|
||||
const resolvedFileName = result.resolvedModule ? result.resolvedModule.resolvedFileName : undefined;
|
||||
let resolvedFileName = result.resolvedModule ? result.resolvedModule.resolvedFileName : undefined;
|
||||
if (result.resolvedModule && result.resolvedModule.extension !== Extension.Ts && result.resolvedModule.extension !== Extension.Tsx && result.resolvedModule.extension !== Extension.Dts) {
|
||||
resolvedFileName = undefined;
|
||||
}
|
||||
|
||||
return {
|
||||
resolvedFileName,
|
||||
failedLookupLocations: result.failedLookupLocations
|
||||
|
||||
@@ -238,7 +238,7 @@ namespace ts {
|
||||
case SyntaxKind.GetAccessor:
|
||||
case SyntaxKind.SetAccessor:
|
||||
case SyntaxKind.ModuleDeclaration:
|
||||
return (<Declaration>node.parent).name === node;
|
||||
return getNameOfDeclaration(<Declaration>node.parent) === node;
|
||||
case SyntaxKind.ElementAccessExpression:
|
||||
return (<ElementAccessExpression>node.parent).argumentExpression === node;
|
||||
case SyntaxKind.ComputedPropertyName:
|
||||
|
||||
@@ -0,0 +1,35 @@
|
||||
//// [tests/cases/compiler/blockScopedNamespaceDifferentFile.ts] ////
|
||||
|
||||
//// [test.ts]
|
||||
// #15734 failed when test.ts comes before typings.d.ts
|
||||
namespace C {
|
||||
export class Name {
|
||||
static funcData = A.AA.func();
|
||||
static someConst = A.AA.foo;
|
||||
|
||||
constructor(parameters) {}
|
||||
}
|
||||
}
|
||||
|
||||
//// [typings.d.ts]
|
||||
declare namespace A {
|
||||
namespace AA {
|
||||
function func(): number;
|
||||
const foo = "";
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
//// [out.js]
|
||||
// #15734 failed when test.ts comes before typings.d.ts
|
||||
var C;
|
||||
(function (C) {
|
||||
var Name = (function () {
|
||||
function Name(parameters) {
|
||||
}
|
||||
return Name;
|
||||
}());
|
||||
Name.funcData = A.AA.func();
|
||||
Name.someConst = A.AA.foo;
|
||||
C.Name = Name;
|
||||
})(C || (C = {}));
|
||||
@@ -0,0 +1,44 @@
|
||||
=== tests/cases/compiler/test.ts ===
|
||||
// #15734 failed when test.ts comes before typings.d.ts
|
||||
namespace C {
|
||||
>C : Symbol(C, Decl(test.ts, 0, 0))
|
||||
|
||||
export class Name {
|
||||
>Name : Symbol(Name, Decl(test.ts, 1, 13))
|
||||
|
||||
static funcData = A.AA.func();
|
||||
>funcData : Symbol(Name.funcData, Decl(test.ts, 2, 23))
|
||||
>A.AA.func : Symbol(A.AA.func, Decl(typings.d.ts, 1, 18))
|
||||
>A.AA : Symbol(A.AA, Decl(typings.d.ts, 0, 21))
|
||||
>A : Symbol(A, Decl(typings.d.ts, 0, 0))
|
||||
>AA : Symbol(A.AA, Decl(typings.d.ts, 0, 21))
|
||||
>func : Symbol(A.AA.func, Decl(typings.d.ts, 1, 18))
|
||||
|
||||
static someConst = A.AA.foo;
|
||||
>someConst : Symbol(Name.someConst, Decl(test.ts, 3, 38))
|
||||
>A.AA.foo : Symbol(A.AA.foo, Decl(typings.d.ts, 3, 13))
|
||||
>A.AA : Symbol(A.AA, Decl(typings.d.ts, 0, 21))
|
||||
>A : Symbol(A, Decl(typings.d.ts, 0, 0))
|
||||
>AA : Symbol(A.AA, Decl(typings.d.ts, 0, 21))
|
||||
>foo : Symbol(A.AA.foo, Decl(typings.d.ts, 3, 13))
|
||||
|
||||
constructor(parameters) {}
|
||||
>parameters : Symbol(parameters, Decl(test.ts, 6, 20))
|
||||
}
|
||||
}
|
||||
|
||||
=== tests/cases/compiler/typings.d.ts ===
|
||||
declare namespace A {
|
||||
>A : Symbol(A, Decl(typings.d.ts, 0, 0))
|
||||
|
||||
namespace AA {
|
||||
>AA : Symbol(AA, Decl(typings.d.ts, 0, 21))
|
||||
|
||||
function func(): number;
|
||||
>func : Symbol(func, Decl(typings.d.ts, 1, 18))
|
||||
|
||||
const foo = "";
|
||||
>foo : Symbol(foo, Decl(typings.d.ts, 3, 13))
|
||||
}
|
||||
}
|
||||
|
||||
@@ -0,0 +1,46 @@
|
||||
=== tests/cases/compiler/test.ts ===
|
||||
// #15734 failed when test.ts comes before typings.d.ts
|
||||
namespace C {
|
||||
>C : typeof C
|
||||
|
||||
export class Name {
|
||||
>Name : Name
|
||||
|
||||
static funcData = A.AA.func();
|
||||
>funcData : number
|
||||
>A.AA.func() : number
|
||||
>A.AA.func : () => number
|
||||
>A.AA : typeof A.AA
|
||||
>A : typeof A
|
||||
>AA : typeof A.AA
|
||||
>func : () => number
|
||||
|
||||
static someConst = A.AA.foo;
|
||||
>someConst : string
|
||||
>A.AA.foo : ""
|
||||
>A.AA : typeof A.AA
|
||||
>A : typeof A
|
||||
>AA : typeof A.AA
|
||||
>foo : ""
|
||||
|
||||
constructor(parameters) {}
|
||||
>parameters : any
|
||||
}
|
||||
}
|
||||
|
||||
=== tests/cases/compiler/typings.d.ts ===
|
||||
declare namespace A {
|
||||
>A : typeof A
|
||||
|
||||
namespace AA {
|
||||
>AA : typeof AA
|
||||
|
||||
function func(): number;
|
||||
>func : () => number
|
||||
|
||||
const foo = "";
|
||||
>foo : ""
|
||||
>"" : ""
|
||||
}
|
||||
}
|
||||
|
||||
@@ -0,0 +1,29 @@
|
||||
tests/cases/compiler/weird.js(1,1): error TS2304: Cannot find name 'someFunction'.
|
||||
tests/cases/compiler/weird.js(1,23): error TS7006: Parameter 'BaseClass' implicitly has an 'any' type.
|
||||
tests/cases/compiler/weird.js(6,13): error TS2346: Supplied parameters do not match any signature of call target.
|
||||
tests/cases/compiler/weird.js(9,17): error TS7006: Parameter 'error' implicitly has an 'any' type.
|
||||
|
||||
|
||||
==== tests/cases/compiler/weird.js (4 errors) ====
|
||||
someFunction(function(BaseClass) {
|
||||
~~~~~~~~~~~~
|
||||
!!! error TS2304: Cannot find name 'someFunction'.
|
||||
~~~~~~~~~
|
||||
!!! error TS7006: Parameter 'BaseClass' implicitly has an 'any' type.
|
||||
'use strict';
|
||||
const DEFAULT_MESSAGE = "nop!";
|
||||
class Hello extends BaseClass {
|
||||
constructor() {
|
||||
super();
|
||||
~~~~~~~
|
||||
!!! error TS2346: Supplied parameters do not match any signature of call target.
|
||||
this.foo = "bar";
|
||||
}
|
||||
_render(error) {
|
||||
~~~~~
|
||||
!!! error TS7006: Parameter 'error' implicitly has an 'any' type.
|
||||
const message = error.message || DEFAULT_MESSAGE;
|
||||
}
|
||||
}
|
||||
});
|
||||
|
||||
@@ -0,0 +1,17 @@
|
||||
=== tests/cases/compiler/weird.js ===
|
||||
someFunction(function(BaseClass) {
|
||||
>BaseClass : Symbol(BaseClass, Decl(weird.js, 0, 22))
|
||||
|
||||
class Hello extends BaseClass {
|
||||
>Hello : Symbol(Hello, Decl(weird.js, 0, 34))
|
||||
>BaseClass : Symbol(BaseClass, Decl(weird.js, 0, 22))
|
||||
|
||||
constructor() {
|
||||
this.foo = "bar";
|
||||
>this.foo : Symbol(Hello.foo, Decl(weird.js, 2, 17))
|
||||
>this : Symbol(Hello, Decl(weird.js, 0, 34))
|
||||
>foo : Symbol(Hello.foo, Decl(weird.js, 2, 17))
|
||||
}
|
||||
}
|
||||
});
|
||||
|
||||
@@ -0,0 +1,22 @@
|
||||
=== tests/cases/compiler/weird.js ===
|
||||
someFunction(function(BaseClass) {
|
||||
>someFunction(function(BaseClass) { class Hello extends BaseClass { constructor() { this.foo = "bar"; } }}) : any
|
||||
>someFunction : any
|
||||
>function(BaseClass) { class Hello extends BaseClass { constructor() { this.foo = "bar"; } }} : (BaseClass: any) => void
|
||||
>BaseClass : any
|
||||
|
||||
class Hello extends BaseClass {
|
||||
>Hello : Hello
|
||||
>BaseClass : any
|
||||
|
||||
constructor() {
|
||||
this.foo = "bar";
|
||||
>this.foo = "bar" : "bar"
|
||||
>this.foo : string
|
||||
>this : this
|
||||
>foo : string
|
||||
>"bar" : "bar"
|
||||
}
|
||||
}
|
||||
});
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
tests/cases/compiler/a.js(14,5): error TS2424: Class 'A' defines instance member function 'foo', but extended class 'B' defines it as instance member property.
|
||||
tests/cases/compiler/a.js(14,10): error TS2424: Class 'A' defines instance member function 'foo', but extended class 'B' defines it as instance member property.
|
||||
|
||||
|
||||
==== tests/cases/compiler/a.js (1 errors) ====
|
||||
@@ -16,7 +16,7 @@ tests/cases/compiler/a.js(14,5): error TS2424: Class 'A' defines instance member
|
||||
constructor() {
|
||||
super();
|
||||
this.foo = () => 3;
|
||||
~~~~~~~~~~~~~~~~~~
|
||||
~~~
|
||||
!!! error TS2424: Class 'A' defines instance member function 'foo', but extended class 'B' defines it as instance member property.
|
||||
}
|
||||
}
|
||||
|
||||
@@ -0,0 +1,76 @@
|
||||
//// [file.tsx]
|
||||
import React = require('react');
|
||||
|
||||
interface ButtonProp {
|
||||
a: number,
|
||||
b: string,
|
||||
children: Button;
|
||||
}
|
||||
|
||||
class Button extends React.Component<ButtonProp, any> {
|
||||
render() {
|
||||
let condition: boolean;
|
||||
if (condition) {
|
||||
return <InnerButton {...this.props} />
|
||||
}
|
||||
else {
|
||||
return (<InnerButton {...this.props} >
|
||||
<div>Hello World</div>
|
||||
</InnerButton>);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
interface InnerButtonProp {
|
||||
a: number
|
||||
}
|
||||
|
||||
class InnerButton extends React.Component<InnerButtonProp, any> {
|
||||
render() {
|
||||
return (<button>Hello</button>);
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
//// [file.jsx]
|
||||
"use strict";
|
||||
var __extends = (this && this.__extends) || (function () {
|
||||
var extendStatics = Object.setPrototypeOf ||
|
||||
({ __proto__: [] } instanceof Array && function (d, b) { d.__proto__ = b; }) ||
|
||||
function (d, b) { for (var p in b) if (b.hasOwnProperty(p)) d[p] = b[p]; };
|
||||
return function (d, b) {
|
||||
extendStatics(d, b);
|
||||
function __() { this.constructor = d; }
|
||||
d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __());
|
||||
};
|
||||
})();
|
||||
exports.__esModule = true;
|
||||
var React = require("react");
|
||||
var Button = (function (_super) {
|
||||
__extends(Button, _super);
|
||||
function Button() {
|
||||
return _super !== null && _super.apply(this, arguments) || this;
|
||||
}
|
||||
Button.prototype.render = function () {
|
||||
var condition;
|
||||
if (condition) {
|
||||
return <InnerButton {...this.props}/>;
|
||||
}
|
||||
else {
|
||||
return (<InnerButton {...this.props}>
|
||||
<div>Hello World</div>
|
||||
</InnerButton>);
|
||||
}
|
||||
};
|
||||
return Button;
|
||||
}(React.Component));
|
||||
var InnerButton = (function (_super) {
|
||||
__extends(InnerButton, _super);
|
||||
function InnerButton() {
|
||||
return _super !== null && _super.apply(this, arguments) || this;
|
||||
}
|
||||
InnerButton.prototype.render = function () {
|
||||
return (<button>Hello</button>);
|
||||
};
|
||||
return InnerButton;
|
||||
}(React.Component));
|
||||
@@ -0,0 +1,80 @@
|
||||
=== tests/cases/conformance/jsx/file.tsx ===
|
||||
import React = require('react');
|
||||
>React : Symbol(React, Decl(file.tsx, 0, 0))
|
||||
|
||||
interface ButtonProp {
|
||||
>ButtonProp : Symbol(ButtonProp, Decl(file.tsx, 0, 32))
|
||||
|
||||
a: number,
|
||||
>a : Symbol(ButtonProp.a, Decl(file.tsx, 2, 22))
|
||||
|
||||
b: string,
|
||||
>b : Symbol(ButtonProp.b, Decl(file.tsx, 3, 14))
|
||||
|
||||
children: Button;
|
||||
>children : Symbol(ButtonProp.children, Decl(file.tsx, 4, 14))
|
||||
>Button : Symbol(Button, Decl(file.tsx, 6, 1))
|
||||
}
|
||||
|
||||
class Button extends React.Component<ButtonProp, any> {
|
||||
>Button : Symbol(Button, Decl(file.tsx, 6, 1))
|
||||
>React.Component : Symbol(React.Component, Decl(react.d.ts, 158, 55))
|
||||
>React : Symbol(React, Decl(file.tsx, 0, 0))
|
||||
>Component : Symbol(React.Component, Decl(react.d.ts, 158, 55))
|
||||
>ButtonProp : Symbol(ButtonProp, Decl(file.tsx, 0, 32))
|
||||
|
||||
render() {
|
||||
>render : Symbol(Button.render, Decl(file.tsx, 8, 55))
|
||||
|
||||
let condition: boolean;
|
||||
>condition : Symbol(condition, Decl(file.tsx, 10, 5))
|
||||
|
||||
if (condition) {
|
||||
>condition : Symbol(condition, Decl(file.tsx, 10, 5))
|
||||
|
||||
return <InnerButton {...this.props} />
|
||||
>InnerButton : Symbol(InnerButton, Decl(file.tsx, 24, 1))
|
||||
>this.props : Symbol(React.Component.props, Decl(react.d.ts, 166, 37))
|
||||
>this : Symbol(Button, Decl(file.tsx, 6, 1))
|
||||
>props : Symbol(React.Component.props, Decl(react.d.ts, 166, 37))
|
||||
}
|
||||
else {
|
||||
return (<InnerButton {...this.props} >
|
||||
>InnerButton : Symbol(InnerButton, Decl(file.tsx, 24, 1))
|
||||
>this.props : Symbol(React.Component.props, Decl(react.d.ts, 166, 37))
|
||||
>this : Symbol(Button, Decl(file.tsx, 6, 1))
|
||||
>props : Symbol(React.Component.props, Decl(react.d.ts, 166, 37))
|
||||
|
||||
<div>Hello World</div>
|
||||
>div : Symbol(JSX.IntrinsicElements.div, Decl(react.d.ts, 2399, 45))
|
||||
>div : Symbol(JSX.IntrinsicElements.div, Decl(react.d.ts, 2399, 45))
|
||||
|
||||
</InnerButton>);
|
||||
>InnerButton : Symbol(InnerButton, Decl(file.tsx, 24, 1))
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
interface InnerButtonProp {
|
||||
>InnerButtonProp : Symbol(InnerButtonProp, Decl(file.tsx, 20, 1))
|
||||
|
||||
a: number
|
||||
>a : Symbol(InnerButtonProp.a, Decl(file.tsx, 22, 27))
|
||||
}
|
||||
|
||||
class InnerButton extends React.Component<InnerButtonProp, any> {
|
||||
>InnerButton : Symbol(InnerButton, Decl(file.tsx, 24, 1))
|
||||
>React.Component : Symbol(React.Component, Decl(react.d.ts, 158, 55))
|
||||
>React : Symbol(React, Decl(file.tsx, 0, 0))
|
||||
>Component : Symbol(React.Component, Decl(react.d.ts, 158, 55))
|
||||
>InnerButtonProp : Symbol(InnerButtonProp, Decl(file.tsx, 20, 1))
|
||||
|
||||
render() {
|
||||
>render : Symbol(InnerButton.render, Decl(file.tsx, 26, 65))
|
||||
|
||||
return (<button>Hello</button>);
|
||||
>button : Symbol(JSX.IntrinsicElements.button, Decl(react.d.ts, 2385, 43))
|
||||
>button : Symbol(JSX.IntrinsicElements.button, Decl(react.d.ts, 2385, 43))
|
||||
}
|
||||
}
|
||||
|
||||
@@ -0,0 +1,86 @@
|
||||
=== tests/cases/conformance/jsx/file.tsx ===
|
||||
import React = require('react');
|
||||
>React : typeof React
|
||||
|
||||
interface ButtonProp {
|
||||
>ButtonProp : ButtonProp
|
||||
|
||||
a: number,
|
||||
>a : number
|
||||
|
||||
b: string,
|
||||
>b : string
|
||||
|
||||
children: Button;
|
||||
>children : Button
|
||||
>Button : Button
|
||||
}
|
||||
|
||||
class Button extends React.Component<ButtonProp, any> {
|
||||
>Button : Button
|
||||
>React.Component : React.Component<ButtonProp, any>
|
||||
>React : typeof React
|
||||
>Component : typeof React.Component
|
||||
>ButtonProp : ButtonProp
|
||||
|
||||
render() {
|
||||
>render : () => JSX.Element
|
||||
|
||||
let condition: boolean;
|
||||
>condition : boolean
|
||||
|
||||
if (condition) {
|
||||
>condition : boolean
|
||||
|
||||
return <InnerButton {...this.props} />
|
||||
><InnerButton {...this.props} /> : JSX.Element
|
||||
>InnerButton : typeof InnerButton
|
||||
>this.props : ButtonProp & { children?: React.ReactNode; }
|
||||
>this : this
|
||||
>props : ButtonProp & { children?: React.ReactNode; }
|
||||
}
|
||||
else {
|
||||
return (<InnerButton {...this.props} >
|
||||
>(<InnerButton {...this.props} > <div>Hello World</div> </InnerButton>) : JSX.Element
|
||||
><InnerButton {...this.props} > <div>Hello World</div> </InnerButton> : JSX.Element
|
||||
>InnerButton : typeof InnerButton
|
||||
>this.props : ButtonProp & { children?: React.ReactNode; }
|
||||
>this : this
|
||||
>props : ButtonProp & { children?: React.ReactNode; }
|
||||
|
||||
<div>Hello World</div>
|
||||
><div>Hello World</div> : JSX.Element
|
||||
>div : any
|
||||
>div : any
|
||||
|
||||
</InnerButton>);
|
||||
>InnerButton : typeof InnerButton
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
interface InnerButtonProp {
|
||||
>InnerButtonProp : InnerButtonProp
|
||||
|
||||
a: number
|
||||
>a : number
|
||||
}
|
||||
|
||||
class InnerButton extends React.Component<InnerButtonProp, any> {
|
||||
>InnerButton : InnerButton
|
||||
>React.Component : React.Component<InnerButtonProp, any>
|
||||
>React : typeof React
|
||||
>Component : typeof React.Component
|
||||
>InnerButtonProp : InnerButtonProp
|
||||
|
||||
render() {
|
||||
>render : () => JSX.Element
|
||||
|
||||
return (<button>Hello</button>);
|
||||
>(<button>Hello</button>) : JSX.Element
|
||||
><button>Hello</button> : JSX.Element
|
||||
>button : any
|
||||
>button : any
|
||||
}
|
||||
}
|
||||
|
||||
@@ -0,0 +1,33 @@
|
||||
tests/cases/conformance/jsx/file.tsx(12,30): error TS2710: 'children' are specified twice. The attribute named 'children' will be overwritten.
|
||||
|
||||
|
||||
==== tests/cases/conformance/jsx/file.tsx (1 errors) ====
|
||||
import React = require('react');
|
||||
|
||||
interface ButtonProp {
|
||||
a: number,
|
||||
b: string,
|
||||
children: Button;
|
||||
}
|
||||
|
||||
class Button extends React.Component<ButtonProp, any> {
|
||||
render() {
|
||||
// Error children are specified twice
|
||||
return (<InnerButton {...this.props} children="hi">
|
||||
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
|
||||
!!! error TS2710: 'children' are specified twice. The attribute named 'children' will be overwritten.
|
||||
<div>Hello World</div>
|
||||
</InnerButton>);
|
||||
}
|
||||
}
|
||||
|
||||
interface InnerButtonProp {
|
||||
a: number
|
||||
}
|
||||
|
||||
class InnerButton extends React.Component<InnerButtonProp, any> {
|
||||
render() {
|
||||
return (<button>Hello</button>);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -0,0 +1,66 @@
|
||||
//// [file.tsx]
|
||||
import React = require('react');
|
||||
|
||||
interface ButtonProp {
|
||||
a: number,
|
||||
b: string,
|
||||
children: Button;
|
||||
}
|
||||
|
||||
class Button extends React.Component<ButtonProp, any> {
|
||||
render() {
|
||||
// Error children are specified twice
|
||||
return (<InnerButton {...this.props} children="hi">
|
||||
<div>Hello World</div>
|
||||
</InnerButton>);
|
||||
}
|
||||
}
|
||||
|
||||
interface InnerButtonProp {
|
||||
a: number
|
||||
}
|
||||
|
||||
class InnerButton extends React.Component<InnerButtonProp, any> {
|
||||
render() {
|
||||
return (<button>Hello</button>);
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
//// [file.jsx]
|
||||
"use strict";
|
||||
var __extends = (this && this.__extends) || (function () {
|
||||
var extendStatics = Object.setPrototypeOf ||
|
||||
({ __proto__: [] } instanceof Array && function (d, b) { d.__proto__ = b; }) ||
|
||||
function (d, b) { for (var p in b) if (b.hasOwnProperty(p)) d[p] = b[p]; };
|
||||
return function (d, b) {
|
||||
extendStatics(d, b);
|
||||
function __() { this.constructor = d; }
|
||||
d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __());
|
||||
};
|
||||
})();
|
||||
exports.__esModule = true;
|
||||
var React = require("react");
|
||||
var Button = (function (_super) {
|
||||
__extends(Button, _super);
|
||||
function Button() {
|
||||
return _super !== null && _super.apply(this, arguments) || this;
|
||||
}
|
||||
Button.prototype.render = function () {
|
||||
// Error children are specified twice
|
||||
return (<InnerButton {...this.props} children="hi">
|
||||
<div>Hello World</div>
|
||||
</InnerButton>);
|
||||
};
|
||||
return Button;
|
||||
}(React.Component));
|
||||
var InnerButton = (function (_super) {
|
||||
__extends(InnerButton, _super);
|
||||
function InnerButton() {
|
||||
return _super !== null && _super.apply(this, arguments) || this;
|
||||
}
|
||||
InnerButton.prototype.render = function () {
|
||||
return (<button>Hello</button>);
|
||||
};
|
||||
return InnerButton;
|
||||
}(React.Component));
|
||||
@@ -2,7 +2,6 @@ tests/cases/conformance/jsx/file.tsx(14,15): error TS2322: Type '{ a: 10; b: "hi
|
||||
Type '{ a: 10; b: "hi"; }' is not assignable to type 'Prop'.
|
||||
Property 'children' is missing in type '{ a: 10; b: "hi"; }'.
|
||||
tests/cases/conformance/jsx/file.tsx(17,11): error TS2710: 'children' are specified twice. The attribute named 'children' will be overwritten.
|
||||
tests/cases/conformance/jsx/file.tsx(25,11): error TS2710: 'children' are specified twice. The attribute named 'children' will be overwritten.
|
||||
tests/cases/conformance/jsx/file.tsx(31,11): error TS2322: Type '{ a: 10; b: "hi"; children: (Element | ((name: string) => Element))[]; }' is not assignable to type 'IntrinsicAttributes & Prop'.
|
||||
Type '{ a: 10; b: "hi"; children: (Element | ((name: string) => Element))[]; }' is not assignable to type 'Prop'.
|
||||
Types of property 'children' are incompatible.
|
||||
@@ -29,7 +28,7 @@ tests/cases/conformance/jsx/file.tsx(49,11): error TS2322: Type '{ a: 10; b: "hi
|
||||
Property 'type' is missing in type 'Element[]'.
|
||||
|
||||
|
||||
==== tests/cases/conformance/jsx/file.tsx (7 errors) ====
|
||||
==== tests/cases/conformance/jsx/file.tsx (6 errors) ====
|
||||
import React = require('react');
|
||||
|
||||
interface Prop {
|
||||
@@ -61,8 +60,6 @@ tests/cases/conformance/jsx/file.tsx(49,11): error TS2322: Type '{ a: 10; b: "hi
|
||||
}
|
||||
let k1 =
|
||||
<Comp a={10} b="hi" {...o} >
|
||||
~~~~~~~~~~~~~~~~~~~~
|
||||
!!! error TS2710: 'children' are specified twice. The attribute named 'children' will be overwritten.
|
||||
hi hi hi!
|
||||
</Comp>;
|
||||
|
||||
|
||||
@@ -0,0 +1,71 @@
|
||||
//// [classBlockScoping.ts]
|
||||
function f(b: boolean) {
|
||||
let Foo: any;
|
||||
if (b) {
|
||||
Foo = class Foo {
|
||||
static y = new Foo();
|
||||
|
||||
static x() {
|
||||
new Foo();
|
||||
}
|
||||
|
||||
m() {
|
||||
new Foo();
|
||||
}
|
||||
};
|
||||
|
||||
new Foo();
|
||||
}
|
||||
else {
|
||||
class Foo {
|
||||
static y = new Foo();
|
||||
|
||||
static x() {
|
||||
new Foo();
|
||||
}
|
||||
|
||||
m() {
|
||||
new Foo();
|
||||
}
|
||||
}
|
||||
|
||||
new Foo();
|
||||
}
|
||||
}
|
||||
|
||||
//// [classBlockScoping.js]
|
||||
function f(b) {
|
||||
var Foo;
|
||||
if (b) {
|
||||
Foo = (_a = (function () {
|
||||
function Foo() {
|
||||
}
|
||||
Foo.x = function () {
|
||||
new Foo();
|
||||
};
|
||||
Foo.prototype.m = function () {
|
||||
new Foo();
|
||||
};
|
||||
return Foo;
|
||||
}()),
|
||||
_a.y = new _a(),
|
||||
_a);
|
||||
new Foo();
|
||||
}
|
||||
else {
|
||||
var Foo_1 = (function () {
|
||||
function Foo() {
|
||||
}
|
||||
Foo.x = function () {
|
||||
new Foo();
|
||||
};
|
||||
Foo.prototype.m = function () {
|
||||
new Foo();
|
||||
};
|
||||
return Foo;
|
||||
}());
|
||||
Foo_1.y = new Foo_1();
|
||||
new Foo_1();
|
||||
}
|
||||
var _a;
|
||||
}
|
||||
@@ -0,0 +1,64 @@
|
||||
=== tests/cases/compiler/classBlockScoping.ts ===
|
||||
function f(b: boolean) {
|
||||
>f : Symbol(f, Decl(classBlockScoping.ts, 0, 0))
|
||||
>b : Symbol(b, Decl(classBlockScoping.ts, 0, 11))
|
||||
|
||||
let Foo: any;
|
||||
>Foo : Symbol(Foo, Decl(classBlockScoping.ts, 1, 5))
|
||||
|
||||
if (b) {
|
||||
>b : Symbol(b, Decl(classBlockScoping.ts, 0, 11))
|
||||
|
||||
Foo = class Foo {
|
||||
>Foo : Symbol(Foo, Decl(classBlockScoping.ts, 1, 5))
|
||||
>Foo : Symbol(Foo, Decl(classBlockScoping.ts, 3, 9))
|
||||
|
||||
static y = new Foo();
|
||||
>y : Symbol(Foo.y, Decl(classBlockScoping.ts, 3, 21))
|
||||
>Foo : Symbol(Foo, Decl(classBlockScoping.ts, 3, 9))
|
||||
|
||||
static x() {
|
||||
>x : Symbol(Foo.x, Decl(classBlockScoping.ts, 4, 27))
|
||||
|
||||
new Foo();
|
||||
>Foo : Symbol(Foo, Decl(classBlockScoping.ts, 3, 9))
|
||||
}
|
||||
|
||||
m() {
|
||||
>m : Symbol(Foo.m, Decl(classBlockScoping.ts, 8, 7))
|
||||
|
||||
new Foo();
|
||||
>Foo : Symbol(Foo, Decl(classBlockScoping.ts, 3, 9))
|
||||
}
|
||||
};
|
||||
|
||||
new Foo();
|
||||
>Foo : Symbol(Foo, Decl(classBlockScoping.ts, 1, 5))
|
||||
}
|
||||
else {
|
||||
class Foo {
|
||||
>Foo : Symbol(Foo, Decl(classBlockScoping.ts, 17, 8))
|
||||
|
||||
static y = new Foo();
|
||||
>y : Symbol(Foo.y, Decl(classBlockScoping.ts, 18, 15))
|
||||
>Foo : Symbol(Foo, Decl(classBlockScoping.ts, 17, 8))
|
||||
|
||||
static x() {
|
||||
>x : Symbol(Foo.x, Decl(classBlockScoping.ts, 19, 27))
|
||||
|
||||
new Foo();
|
||||
>Foo : Symbol(Foo, Decl(classBlockScoping.ts, 17, 8))
|
||||
}
|
||||
|
||||
m() {
|
||||
>m : Symbol(Foo.m, Decl(classBlockScoping.ts, 23, 7))
|
||||
|
||||
new Foo();
|
||||
>Foo : Symbol(Foo, Decl(classBlockScoping.ts, 17, 8))
|
||||
}
|
||||
}
|
||||
|
||||
new Foo();
|
||||
>Foo : Symbol(Foo, Decl(classBlockScoping.ts, 17, 8))
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,74 @@
|
||||
=== tests/cases/compiler/classBlockScoping.ts ===
|
||||
function f(b: boolean) {
|
||||
>f : (b: boolean) => void
|
||||
>b : boolean
|
||||
|
||||
let Foo: any;
|
||||
>Foo : any
|
||||
|
||||
if (b) {
|
||||
>b : boolean
|
||||
|
||||
Foo = class Foo {
|
||||
>Foo = class Foo { static y = new Foo(); static x() { new Foo(); } m() { new Foo(); } } : typeof Foo
|
||||
>Foo : any
|
||||
>class Foo { static y = new Foo(); static x() { new Foo(); } m() { new Foo(); } } : typeof Foo
|
||||
>Foo : typeof Foo
|
||||
|
||||
static y = new Foo();
|
||||
>y : Foo
|
||||
>new Foo() : Foo
|
||||
>Foo : typeof Foo
|
||||
|
||||
static x() {
|
||||
>x : () => void
|
||||
|
||||
new Foo();
|
||||
>new Foo() : Foo
|
||||
>Foo : typeof Foo
|
||||
}
|
||||
|
||||
m() {
|
||||
>m : () => void
|
||||
|
||||
new Foo();
|
||||
>new Foo() : Foo
|
||||
>Foo : typeof Foo
|
||||
}
|
||||
};
|
||||
|
||||
new Foo();
|
||||
>new Foo() : any
|
||||
>Foo : any
|
||||
}
|
||||
else {
|
||||
class Foo {
|
||||
>Foo : Foo
|
||||
|
||||
static y = new Foo();
|
||||
>y : Foo
|
||||
>new Foo() : Foo
|
||||
>Foo : typeof Foo
|
||||
|
||||
static x() {
|
||||
>x : () => void
|
||||
|
||||
new Foo();
|
||||
>new Foo() : Foo
|
||||
>Foo : typeof Foo
|
||||
}
|
||||
|
||||
m() {
|
||||
>m : () => void
|
||||
|
||||
new Foo();
|
||||
>new Foo() : Foo
|
||||
>Foo : typeof Foo
|
||||
}
|
||||
}
|
||||
|
||||
new Foo();
|
||||
>new Foo() : Foo
|
||||
>Foo : typeof Foo
|
||||
}
|
||||
}
|
||||
@@ -15,8 +15,8 @@ var C = (function () {
|
||||
}());
|
||||
{
|
||||
var C_1 = (function () {
|
||||
function C_1() {
|
||||
function C() {
|
||||
}
|
||||
return C_1;
|
||||
return C;
|
||||
}());
|
||||
}
|
||||
|
||||
@@ -19,9 +19,9 @@ function f() {
|
||||
var c1 = C;
|
||||
{
|
||||
var C_1 = (function () {
|
||||
function C_1() {
|
||||
function C() {
|
||||
}
|
||||
return C_1;
|
||||
return C;
|
||||
}());
|
||||
var c2 = C_1;
|
||||
}
|
||||
|
||||
+20
-24
@@ -1,15 +1,13 @@
|
||||
tests/cases/conformance/types/contextualTypes/jsxAttributes/file.tsx(27,24): error TS2322: Type '{ extra: true; onClick: (k: "left" | "right") => void; }' is not assignable to type 'IntrinsicAttributes & LinkProps'.
|
||||
Property 'extra' does not exist on type 'IntrinsicAttributes & LinkProps'.
|
||||
Type '{ extra: true; onClick: (k: "left" | "right") => void; }' is not assignable to type 'LinkProps'.
|
||||
Property 'goTo' is missing in type '{ extra: true; onClick: (k: "left" | "right") => void; }'.
|
||||
tests/cases/conformance/types/contextualTypes/jsxAttributes/file.tsx(28,24): error TS2322: Type '{ onClick: (k: "left" | "right") => void; extra: true; }' is not assignable to type 'IntrinsicAttributes & LinkProps'.
|
||||
Property 'onClick' does not exist on type 'IntrinsicAttributes & LinkProps'.
|
||||
tests/cases/conformance/types/contextualTypes/jsxAttributes/file.tsx(29,24): error TS2322: Type '{ extra: true; goTo: "home"; }' is not assignable to type 'IntrinsicAttributes & LinkProps'.
|
||||
Property 'extra' does not exist on type 'IntrinsicAttributes & LinkProps'.
|
||||
tests/cases/conformance/types/contextualTypes/jsxAttributes/file.tsx(30,24): error TS2322: Type '{ goTo: "home"; extra: true; }' is not assignable to type 'IntrinsicAttributes & LinkProps'.
|
||||
Property 'extra' does not exist on type 'IntrinsicAttributes & LinkProps'.
|
||||
tests/cases/conformance/types/contextualTypes/jsxAttributes/file.tsx(33,25): error TS2322: Type '{ extra: true; onClick: (k: "left" | "right") => void; }' is not assignable to type 'IntrinsicAttributes & ButtonProps'.
|
||||
Property 'extra' does not exist on type 'IntrinsicAttributes & ButtonProps'.
|
||||
tests/cases/conformance/types/contextualTypes/jsxAttributes/file.tsx(36,25): error TS2322: Type '{ extra: true; goTo: "home"; }' is not assignable to type 'IntrinsicAttributes & LinkProps'.
|
||||
Property 'extra' does not exist on type 'IntrinsicAttributes & LinkProps'.
|
||||
Type '{ onClick: (k: "left" | "right") => void; extra: true; }' is not assignable to type 'LinkProps'.
|
||||
Property 'goTo' is missing in type '{ onClick: (k: "left" | "right") => void; extra: true; }'.
|
||||
tests/cases/conformance/types/contextualTypes/jsxAttributes/file.tsx(29,43): error TS2339: Property 'extra' does not exist on type 'IntrinsicAttributes & LinkProps'.
|
||||
tests/cases/conformance/types/contextualTypes/jsxAttributes/file.tsx(30,36): error TS2339: Property 'extra' does not exist on type 'IntrinsicAttributes & LinkProps'.
|
||||
tests/cases/conformance/types/contextualTypes/jsxAttributes/file.tsx(33,65): error TS2339: Property 'extra' does not exist on type 'IntrinsicAttributes & ButtonProps'.
|
||||
tests/cases/conformance/types/contextualTypes/jsxAttributes/file.tsx(36,44): error TS2339: Property 'extra' does not exist on type 'IntrinsicAttributes & LinkProps'.
|
||||
|
||||
|
||||
==== tests/cases/conformance/types/contextualTypes/jsxAttributes/file.tsx (6 errors) ====
|
||||
@@ -42,29 +40,27 @@ tests/cases/conformance/types/contextualTypes/jsxAttributes/file.tsx(36,25): err
|
||||
const b0 = <MainButton {...{onClick: (k) => {console.log(k)}}} extra />; // k has type "left" | "right"
|
||||
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
|
||||
!!! error TS2322: Type '{ extra: true; onClick: (k: "left" | "right") => void; }' is not assignable to type 'IntrinsicAttributes & LinkProps'.
|
||||
!!! error TS2322: Property 'extra' does not exist on type 'IntrinsicAttributes & LinkProps'.
|
||||
!!! error TS2322: Type '{ extra: true; onClick: (k: "left" | "right") => void; }' is not assignable to type 'LinkProps'.
|
||||
!!! error TS2322: Property 'goTo' is missing in type '{ extra: true; onClick: (k: "left" | "right") => void; }'.
|
||||
const b2 = <MainButton onClick={(k)=>{console.log(k)}} extra />; // k has type "left" | "right"
|
||||
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
|
||||
!!! error TS2322: Type '{ onClick: (k: "left" | "right") => void; extra: true; }' is not assignable to type 'IntrinsicAttributes & LinkProps'.
|
||||
!!! error TS2322: Property 'onClick' does not exist on type 'IntrinsicAttributes & LinkProps'.
|
||||
!!! error TS2322: Type '{ onClick: (k: "left" | "right") => void; extra: true; }' is not assignable to type 'LinkProps'.
|
||||
!!! error TS2322: Property 'goTo' is missing in type '{ onClick: (k: "left" | "right") => void; extra: true; }'.
|
||||
const b3 = <MainButton {...{goTo:"home"}} extra />; // goTo has type"home" | "contact"
|
||||
~~~~~~~~~~~~~~~~~~~~~~~~
|
||||
!!! error TS2322: Type '{ extra: true; goTo: "home"; }' is not assignable to type 'IntrinsicAttributes & LinkProps'.
|
||||
!!! error TS2322: Property 'extra' does not exist on type 'IntrinsicAttributes & LinkProps'.
|
||||
~~~~~
|
||||
!!! error TS2339: Property 'extra' does not exist on type 'IntrinsicAttributes & LinkProps'.
|
||||
const b4 = <MainButton goTo="home" extra />; // goTo has type "home" | "contact"
|
||||
~~~~~~~~~~~~~~~~~
|
||||
!!! error TS2322: Type '{ goTo: "home"; extra: true; }' is not assignable to type 'IntrinsicAttributes & LinkProps'.
|
||||
!!! error TS2322: Property 'extra' does not exist on type 'IntrinsicAttributes & LinkProps'.
|
||||
~~~~~
|
||||
!!! error TS2339: Property 'extra' does not exist on type 'IntrinsicAttributes & LinkProps'.
|
||||
|
||||
export function NoOverload(buttonProps: ButtonProps): JSX.Element { return undefined }
|
||||
const c1 = <NoOverload {...{onClick: (k) => {console.log(k)}}} extra />; // k has type any
|
||||
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
|
||||
!!! error TS2322: Type '{ extra: true; onClick: (k: "left" | "right") => void; }' is not assignable to type 'IntrinsicAttributes & ButtonProps'.
|
||||
!!! error TS2322: Property 'extra' does not exist on type 'IntrinsicAttributes & ButtonProps'.
|
||||
~~~~~
|
||||
!!! error TS2339: Property 'extra' does not exist on type 'IntrinsicAttributes & ButtonProps'.
|
||||
|
||||
export function NoOverload1(linkProps: LinkProps): JSX.Element { return undefined }
|
||||
const d1 = <NoOverload1 {...{goTo:"home"}} extra />; // goTo has type "home" | "contact"
|
||||
~~~~~~~~~~~~~~~~~~~~~~~~
|
||||
!!! error TS2322: Type '{ extra: true; goTo: "home"; }' is not assignable to type 'IntrinsicAttributes & LinkProps'.
|
||||
!!! error TS2322: Property 'extra' does not exist on type 'IntrinsicAttributes & LinkProps'.
|
||||
~~~~~
|
||||
!!! error TS2339: Property 'extra' does not exist on type 'IntrinsicAttributes & LinkProps'.
|
||||
|
||||
@@ -0,0 +1,23 @@
|
||||
//// [tests/cases/conformance/jsx/correctlyMarkAliasAsReferences1.tsx] ////
|
||||
|
||||
//// [declaration.d.ts]
|
||||
declare module "classnames";
|
||||
|
||||
//// [0.tsx]
|
||||
///<reference path="declaration.d.ts" />
|
||||
import * as cx from 'classnames';
|
||||
import * as React from "react";
|
||||
|
||||
let buttonProps; // any
|
||||
let k = <button {...buttonProps}>
|
||||
<span className={cx('class1', { class2: true })} />
|
||||
</button>;
|
||||
|
||||
|
||||
//// [0.js]
|
||||
///<reference path="declaration.d.ts" />
|
||||
import * as cx from 'classnames';
|
||||
import * as React from "react";
|
||||
let buttonProps; // any
|
||||
let k = React.createElement("button", Object.assign({}, buttonProps),
|
||||
React.createElement("span", { className: cx('class1', { class2: true }) }));
|
||||
@@ -0,0 +1,29 @@
|
||||
=== tests/cases/conformance/jsx/0.tsx ===
|
||||
///<reference path="declaration.d.ts" />
|
||||
import * as cx from 'classnames';
|
||||
>cx : Symbol(cx, Decl(0.tsx, 1, 6))
|
||||
|
||||
import * as React from "react";
|
||||
>React : Symbol(React, Decl(0.tsx, 2, 6))
|
||||
|
||||
let buttonProps; // any
|
||||
>buttonProps : Symbol(buttonProps, Decl(0.tsx, 4, 3))
|
||||
|
||||
let k = <button {...buttonProps}>
|
||||
>k : Symbol(k, Decl(0.tsx, 5, 3))
|
||||
>button : Symbol(JSX.IntrinsicElements.button, Decl(react.d.ts, 2385, 43))
|
||||
>buttonProps : Symbol(buttonProps, Decl(0.tsx, 4, 3))
|
||||
|
||||
<span className={cx('class1', { class2: true })} />
|
||||
>span : Symbol(JSX.IntrinsicElements.span, Decl(react.d.ts, 2460, 51))
|
||||
>className : Symbol(className, Decl(0.tsx, 6, 17))
|
||||
>cx : Symbol(cx, Decl(0.tsx, 1, 6))
|
||||
>class2 : Symbol(class2, Decl(0.tsx, 6, 43))
|
||||
|
||||
</button>;
|
||||
>button : Symbol(JSX.IntrinsicElements.button, Decl(react.d.ts, 2385, 43))
|
||||
|
||||
=== tests/cases/conformance/jsx/declaration.d.ts ===
|
||||
declare module "classnames";
|
||||
No type information for this code.
|
||||
No type information for this code.
|
||||
@@ -0,0 +1,35 @@
|
||||
=== tests/cases/conformance/jsx/0.tsx ===
|
||||
///<reference path="declaration.d.ts" />
|
||||
import * as cx from 'classnames';
|
||||
>cx : any
|
||||
|
||||
import * as React from "react";
|
||||
>React : typeof React
|
||||
|
||||
let buttonProps; // any
|
||||
>buttonProps : any
|
||||
|
||||
let k = <button {...buttonProps}>
|
||||
>k : JSX.Element
|
||||
><button {...buttonProps}> <span className={cx('class1', { class2: true })} /> </button> : JSX.Element
|
||||
>button : any
|
||||
>buttonProps : any
|
||||
|
||||
<span className={cx('class1', { class2: true })} />
|
||||
><span className={cx('class1', { class2: true })} /> : JSX.Element
|
||||
>span : any
|
||||
>className : any
|
||||
>cx('class1', { class2: true }) : any
|
||||
>cx : any
|
||||
>'class1' : "class1"
|
||||
>{ class2: true } : { class2: boolean; }
|
||||
>class2 : boolean
|
||||
>true : true
|
||||
|
||||
</button>;
|
||||
>button : any
|
||||
|
||||
=== tests/cases/conformance/jsx/declaration.d.ts ===
|
||||
declare module "classnames";
|
||||
No type information for this code.
|
||||
No type information for this code.
|
||||
@@ -0,0 +1,23 @@
|
||||
//// [tests/cases/conformance/jsx/correctlyMarkAliasAsReferences2.tsx] ////
|
||||
|
||||
//// [declaration.d.ts]
|
||||
declare module "classnames";
|
||||
|
||||
//// [0.tsx]
|
||||
///<reference path="declaration.d.ts" />
|
||||
import * as cx from 'classnames';
|
||||
import * as React from "react";
|
||||
|
||||
let buttonProps : {[attributeName: string]: ''}
|
||||
let k = <button {...buttonProps}>
|
||||
<span className={cx('class1', { class2: true })} />
|
||||
</button>;
|
||||
|
||||
|
||||
//// [0.js]
|
||||
///<reference path="declaration.d.ts" />
|
||||
import * as cx from 'classnames';
|
||||
import * as React from "react";
|
||||
let buttonProps;
|
||||
let k = React.createElement("button", Object.assign({}, buttonProps),
|
||||
React.createElement("span", { className: cx('class1', { class2: true }) }));
|
||||
@@ -0,0 +1,30 @@
|
||||
=== tests/cases/conformance/jsx/0.tsx ===
|
||||
///<reference path="declaration.d.ts" />
|
||||
import * as cx from 'classnames';
|
||||
>cx : Symbol(cx, Decl(0.tsx, 1, 6))
|
||||
|
||||
import * as React from "react";
|
||||
>React : Symbol(React, Decl(0.tsx, 2, 6))
|
||||
|
||||
let buttonProps : {[attributeName: string]: ''}
|
||||
>buttonProps : Symbol(buttonProps, Decl(0.tsx, 4, 3))
|
||||
>attributeName : Symbol(attributeName, Decl(0.tsx, 4, 20))
|
||||
|
||||
let k = <button {...buttonProps}>
|
||||
>k : Symbol(k, Decl(0.tsx, 5, 3))
|
||||
>button : Symbol(JSX.IntrinsicElements.button, Decl(react.d.ts, 2385, 43))
|
||||
>buttonProps : Symbol(buttonProps, Decl(0.tsx, 4, 3))
|
||||
|
||||
<span className={cx('class1', { class2: true })} />
|
||||
>span : Symbol(JSX.IntrinsicElements.span, Decl(react.d.ts, 2460, 51))
|
||||
>className : Symbol(className, Decl(0.tsx, 6, 17))
|
||||
>cx : Symbol(cx, Decl(0.tsx, 1, 6))
|
||||
>class2 : Symbol(class2, Decl(0.tsx, 6, 43))
|
||||
|
||||
</button>;
|
||||
>button : Symbol(JSX.IntrinsicElements.button, Decl(react.d.ts, 2385, 43))
|
||||
|
||||
=== tests/cases/conformance/jsx/declaration.d.ts ===
|
||||
declare module "classnames";
|
||||
No type information for this code.
|
||||
No type information for this code.
|
||||
@@ -0,0 +1,36 @@
|
||||
=== tests/cases/conformance/jsx/0.tsx ===
|
||||
///<reference path="declaration.d.ts" />
|
||||
import * as cx from 'classnames';
|
||||
>cx : any
|
||||
|
||||
import * as React from "react";
|
||||
>React : typeof React
|
||||
|
||||
let buttonProps : {[attributeName: string]: ''}
|
||||
>buttonProps : { [attributeName: string]: ""; }
|
||||
>attributeName : string
|
||||
|
||||
let k = <button {...buttonProps}>
|
||||
>k : JSX.Element
|
||||
><button {...buttonProps}> <span className={cx('class1', { class2: true })} /> </button> : JSX.Element
|
||||
>button : any
|
||||
>buttonProps : { [attributeName: string]: ""; }
|
||||
|
||||
<span className={cx('class1', { class2: true })} />
|
||||
><span className={cx('class1', { class2: true })} /> : JSX.Element
|
||||
>span : any
|
||||
>className : any
|
||||
>cx('class1', { class2: true }) : any
|
||||
>cx : any
|
||||
>'class1' : "class1"
|
||||
>{ class2: true } : { class2: boolean; }
|
||||
>class2 : boolean
|
||||
>true : true
|
||||
|
||||
</button>;
|
||||
>button : any
|
||||
|
||||
=== tests/cases/conformance/jsx/declaration.d.ts ===
|
||||
declare module "classnames";
|
||||
No type information for this code.
|
||||
No type information for this code.
|
||||
@@ -0,0 +1,23 @@
|
||||
//// [tests/cases/conformance/jsx/correctlyMarkAliasAsReferences3.tsx] ////
|
||||
|
||||
//// [declaration.d.ts]
|
||||
declare module "classnames";
|
||||
|
||||
//// [0.tsx]
|
||||
///<reference path="declaration.d.ts" />
|
||||
import * as cx from 'classnames';
|
||||
import * as React from "react";
|
||||
|
||||
let buttonProps;
|
||||
let k = <button {...buttonProps}>
|
||||
<span className={cx('class1', { class2: true })} />
|
||||
</button>;
|
||||
|
||||
|
||||
//// [0.js]
|
||||
///<reference path="declaration.d.ts" />
|
||||
import * as cx from 'classnames';
|
||||
import * as React from "react";
|
||||
let buttonProps;
|
||||
let k = React.createElement("button", Object.assign({}, buttonProps),
|
||||
React.createElement("span", { className: cx('class1', { class2: true }) }));
|
||||
@@ -0,0 +1,29 @@
|
||||
=== tests/cases/conformance/jsx/0.tsx ===
|
||||
///<reference path="declaration.d.ts" />
|
||||
import * as cx from 'classnames';
|
||||
>cx : Symbol(cx, Decl(0.tsx, 1, 6))
|
||||
|
||||
import * as React from "react";
|
||||
>React : Symbol(React, Decl(0.tsx, 2, 6))
|
||||
|
||||
let buttonProps;
|
||||
>buttonProps : Symbol(buttonProps, Decl(0.tsx, 4, 3))
|
||||
|
||||
let k = <button {...buttonProps}>
|
||||
>k : Symbol(k, Decl(0.tsx, 5, 3))
|
||||
>button : Symbol(JSX.IntrinsicElements.button, Decl(react.d.ts, 2385, 43))
|
||||
>buttonProps : Symbol(buttonProps, Decl(0.tsx, 4, 3))
|
||||
|
||||
<span className={cx('class1', { class2: true })} />
|
||||
>span : Symbol(JSX.IntrinsicElements.span, Decl(react.d.ts, 2460, 51))
|
||||
>className : Symbol(className, Decl(0.tsx, 6, 17))
|
||||
>cx : Symbol(cx, Decl(0.tsx, 1, 6))
|
||||
>class2 : Symbol(class2, Decl(0.tsx, 6, 43))
|
||||
|
||||
</button>;
|
||||
>button : Symbol(JSX.IntrinsicElements.button, Decl(react.d.ts, 2385, 43))
|
||||
|
||||
=== tests/cases/conformance/jsx/declaration.d.ts ===
|
||||
declare module "classnames";
|
||||
No type information for this code.
|
||||
No type information for this code.
|
||||
@@ -0,0 +1,35 @@
|
||||
=== tests/cases/conformance/jsx/0.tsx ===
|
||||
///<reference path="declaration.d.ts" />
|
||||
import * as cx from 'classnames';
|
||||
>cx : any
|
||||
|
||||
import * as React from "react";
|
||||
>React : typeof React
|
||||
|
||||
let buttonProps;
|
||||
>buttonProps : any
|
||||
|
||||
let k = <button {...buttonProps}>
|
||||
>k : JSX.Element
|
||||
><button {...buttonProps}> <span className={cx('class1', { class2: true })} /> </button> : JSX.Element
|
||||
>button : any
|
||||
>buttonProps : undefined
|
||||
|
||||
<span className={cx('class1', { class2: true })} />
|
||||
><span className={cx('class1', { class2: true })} /> : JSX.Element
|
||||
>span : any
|
||||
>className : any
|
||||
>cx('class1', { class2: true }) : any
|
||||
>cx : any
|
||||
>'class1' : "class1"
|
||||
>{ class2: true } : { class2: boolean; }
|
||||
>class2 : boolean
|
||||
>true : true
|
||||
|
||||
</button>;
|
||||
>button : any
|
||||
|
||||
=== tests/cases/conformance/jsx/declaration.d.ts ===
|
||||
declare module "classnames";
|
||||
No type information for this code.
|
||||
No type information for this code.
|
||||
@@ -0,0 +1,19 @@
|
||||
//// [tests/cases/conformance/jsx/correctlyMarkAliasAsReferences4.tsx] ////
|
||||
|
||||
//// [declaration.d.ts]
|
||||
declare module "classnames";
|
||||
|
||||
//// [0.tsx]
|
||||
///<reference path="declaration.d.ts" />
|
||||
import * as cx from 'classnames';
|
||||
import * as React from "react";
|
||||
|
||||
let buttonProps : {[attributeName: string]: ''}
|
||||
let k = <button {...buttonProps} className={cx('class1', { class2: true })} />;
|
||||
|
||||
//// [0.js]
|
||||
///<reference path="declaration.d.ts" />
|
||||
import * as cx from 'classnames';
|
||||
import * as React from "react";
|
||||
let buttonProps;
|
||||
let k = React.createElement("button", Object.assign({}, buttonProps, { className: cx('class1', { class2: true }) }));
|
||||
@@ -0,0 +1,24 @@
|
||||
=== tests/cases/conformance/jsx/0.tsx ===
|
||||
///<reference path="declaration.d.ts" />
|
||||
import * as cx from 'classnames';
|
||||
>cx : Symbol(cx, Decl(0.tsx, 1, 6))
|
||||
|
||||
import * as React from "react";
|
||||
>React : Symbol(React, Decl(0.tsx, 2, 6))
|
||||
|
||||
let buttonProps : {[attributeName: string]: ''}
|
||||
>buttonProps : Symbol(buttonProps, Decl(0.tsx, 4, 3))
|
||||
>attributeName : Symbol(attributeName, Decl(0.tsx, 4, 20))
|
||||
|
||||
let k = <button {...buttonProps} className={cx('class1', { class2: true })} />;
|
||||
>k : Symbol(k, Decl(0.tsx, 5, 3))
|
||||
>button : Symbol(JSX.IntrinsicElements.button, Decl(react.d.ts, 2385, 43))
|
||||
>buttonProps : Symbol(buttonProps, Decl(0.tsx, 4, 3))
|
||||
>className : Symbol(className, Decl(0.tsx, 5, 32))
|
||||
>cx : Symbol(cx, Decl(0.tsx, 1, 6))
|
||||
>class2 : Symbol(class2, Decl(0.tsx, 5, 58))
|
||||
|
||||
=== tests/cases/conformance/jsx/declaration.d.ts ===
|
||||
declare module "classnames";
|
||||
No type information for this code.
|
||||
No type information for this code.
|
||||
@@ -0,0 +1,29 @@
|
||||
=== tests/cases/conformance/jsx/0.tsx ===
|
||||
///<reference path="declaration.d.ts" />
|
||||
import * as cx from 'classnames';
|
||||
>cx : any
|
||||
|
||||
import * as React from "react";
|
||||
>React : typeof React
|
||||
|
||||
let buttonProps : {[attributeName: string]: ''}
|
||||
>buttonProps : { [attributeName: string]: ""; }
|
||||
>attributeName : string
|
||||
|
||||
let k = <button {...buttonProps} className={cx('class1', { class2: true })} />;
|
||||
>k : JSX.Element
|
||||
><button {...buttonProps} className={cx('class1', { class2: true })} /> : JSX.Element
|
||||
>button : any
|
||||
>buttonProps : { [attributeName: string]: ""; }
|
||||
>className : any
|
||||
>cx('class1', { class2: true }) : any
|
||||
>cx : any
|
||||
>'class1' : "class1"
|
||||
>{ class2: true } : { class2: boolean; }
|
||||
>class2 : boolean
|
||||
>true : true
|
||||
|
||||
=== tests/cases/conformance/jsx/declaration.d.ts ===
|
||||
declare module "classnames";
|
||||
No type information for this code.
|
||||
No type information for this code.
|
||||
@@ -7,5 +7,5 @@ export default 1 + 2;
|
||||
|
||||
|
||||
//// [declarationEmitDefaultExport5.d.ts]
|
||||
declare var _default: number;
|
||||
declare const _default: number;
|
||||
export default _default;
|
||||
|
||||
@@ -12,5 +12,5 @@ export default new A();
|
||||
//// [declarationEmitDefaultExport6.d.ts]
|
||||
export declare class A {
|
||||
}
|
||||
declare var _default: A;
|
||||
declare const _default: A;
|
||||
export default _default;
|
||||
|
||||
@@ -13,5 +13,5 @@ export default 1 + 2;
|
||||
//// [declarationEmitDefaultExport8.d.ts]
|
||||
declare var _default: number;
|
||||
export { _default as d };
|
||||
declare var _default_1: number;
|
||||
declare const _default_1: number;
|
||||
export default _default_1;
|
||||
|
||||
@@ -15,5 +15,5 @@ System.register([], function (exports_1, context_1) {
|
||||
|
||||
|
||||
//// [pi.d.ts]
|
||||
declare var _default: 3.14159;
|
||||
declare const _default: 3.14159;
|
||||
export default _default;
|
||||
|
||||
+1
-1
@@ -16,6 +16,6 @@ System.register("pi", [], function (exports_1, context_1) {
|
||||
|
||||
//// [app.d.ts]
|
||||
declare module "pi" {
|
||||
var _default: 3.14159;
|
||||
const _default: 3.14159;
|
||||
export default _default;
|
||||
}
|
||||
|
||||
@@ -45,5 +45,6 @@ declare class C<T, U> {
|
||||
y: U;
|
||||
}
|
||||
declare function getClass<T>(c: T): typeof C;
|
||||
declare class MyClass extends C<string, number> {
|
||||
declare const MyClass_base: typeof C;
|
||||
declare class MyClass extends MyClass_base<string, number> {
|
||||
}
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
tests/cases/compiler/declarationEmitExpressionInExtends3.ts(28,30): error TS4020: 'extends' clause of exported class 'MyClass' has or is using private name 'LocalClass'.
|
||||
tests/cases/compiler/declarationEmitExpressionInExtends3.ts(36,31): error TS4020: 'extends' clause of exported class 'MyClass3' has or is using private name 'LocalInterface'.
|
||||
tests/cases/compiler/declarationEmitExpressionInExtends3.ts(36,75): error TS4020: 'extends' clause of exported class 'MyClass3' has or is using private name 'LocalInterface'.
|
||||
|
||||
|
||||
==== tests/cases/compiler/declarationEmitExpressionInExtends3.ts (2 errors) ====
|
||||
@@ -41,7 +41,7 @@ tests/cases/compiler/declarationEmitExpressionInExtends3.ts(36,31): error TS4020
|
||||
|
||||
|
||||
export class MyClass3 extends getExportedClass<LocalInterface>(undefined)<LocalInterface> { // Error LocalInterface is inaccisble
|
||||
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
|
||||
~~~~~~~~~~~~~~
|
||||
!!! error TS4020: 'extends' clause of exported class 'MyClass3' has or is using private name 'LocalInterface'.
|
||||
}
|
||||
|
||||
|
||||
@@ -1,13 +1,12 @@
|
||||
tests/cases/compiler/declarationEmitExpressionInExtends4.ts(1,10): error TS4060: Return type of exported function has or is using private name 'D'.
|
||||
tests/cases/compiler/declarationEmitExpressionInExtends4.ts(5,7): error TS4093: 'extends' clause of exported class 'C' refers to a type whose name cannot be referenced.
|
||||
tests/cases/compiler/declarationEmitExpressionInExtends4.ts(5,17): error TS2315: Type 'D' is not generic.
|
||||
tests/cases/compiler/declarationEmitExpressionInExtends4.ts(9,7): error TS4093: 'extends' clause of exported class 'C2' refers to a type whose name cannot be referenced.
|
||||
tests/cases/compiler/declarationEmitExpressionInExtends4.ts(5,17): error TS4020: 'extends' clause of exported class 'C' has or is using private name 'D'.
|
||||
tests/cases/compiler/declarationEmitExpressionInExtends4.ts(9,18): error TS2304: Cannot find name 'SomeUndefinedFunction'.
|
||||
tests/cases/compiler/declarationEmitExpressionInExtends4.ts(14,18): error TS2304: Cannot find name 'SomeUndefinedFunction'.
|
||||
tests/cases/compiler/declarationEmitExpressionInExtends4.ts(14,18): error TS4020: 'extends' clause of exported class 'C3' has or is using private name 'SomeUndefinedFunction'.
|
||||
|
||||
|
||||
==== tests/cases/compiler/declarationEmitExpressionInExtends4.ts (7 errors) ====
|
||||
==== tests/cases/compiler/declarationEmitExpressionInExtends4.ts (6 errors) ====
|
||||
function getSomething() {
|
||||
~~~~~~~~~~~~
|
||||
!!! error TS4060: Return type of exported function has or is using private name 'D'.
|
||||
@@ -15,16 +14,14 @@ tests/cases/compiler/declarationEmitExpressionInExtends4.ts(14,18): error TS4020
|
||||
}
|
||||
|
||||
class C extends getSomething()<number, string> {
|
||||
~
|
||||
!!! error TS4093: 'extends' clause of exported class 'C' refers to a type whose name cannot be referenced.
|
||||
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
|
||||
!!! error TS2315: Type 'D' is not generic.
|
||||
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
|
||||
!!! error TS4020: 'extends' clause of exported class 'C' has or is using private name 'D'.
|
||||
|
||||
}
|
||||
|
||||
class C2 extends SomeUndefinedFunction()<number, string> {
|
||||
~~
|
||||
!!! error TS4093: 'extends' clause of exported class 'C2' refers to a type whose name cannot be referenced.
|
||||
~~~~~~~~~~~~~~~~~~~~~
|
||||
!!! error TS2304: Cannot find name 'SomeUndefinedFunction'.
|
||||
|
||||
|
||||
@@ -0,0 +1,67 @@
|
||||
//// [declarationEmitExpressionInExtends5.ts]
|
||||
namespace Test
|
||||
{
|
||||
export interface IFace
|
||||
{
|
||||
}
|
||||
|
||||
export class SomeClass implements IFace
|
||||
{
|
||||
}
|
||||
|
||||
export class Derived extends getClass<IFace>()
|
||||
{
|
||||
}
|
||||
|
||||
export function getClass<T>() : new() => T
|
||||
{
|
||||
return SomeClass as (new() => T);
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
//// [declarationEmitExpressionInExtends5.js]
|
||||
var __extends = (this && this.__extends) || (function () {
|
||||
var extendStatics = Object.setPrototypeOf ||
|
||||
({ __proto__: [] } instanceof Array && function (d, b) { d.__proto__ = b; }) ||
|
||||
function (d, b) { for (var p in b) if (b.hasOwnProperty(p)) d[p] = b[p]; };
|
||||
return function (d, b) {
|
||||
extendStatics(d, b);
|
||||
function __() { this.constructor = d; }
|
||||
d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __());
|
||||
};
|
||||
})();
|
||||
var Test;
|
||||
(function (Test) {
|
||||
var SomeClass = (function () {
|
||||
function SomeClass() {
|
||||
}
|
||||
return SomeClass;
|
||||
}());
|
||||
Test.SomeClass = SomeClass;
|
||||
var Derived = (function (_super) {
|
||||
__extends(Derived, _super);
|
||||
function Derived() {
|
||||
return _super !== null && _super.apply(this, arguments) || this;
|
||||
}
|
||||
return Derived;
|
||||
}(getClass()));
|
||||
Test.Derived = Derived;
|
||||
function getClass() {
|
||||
return SomeClass;
|
||||
}
|
||||
Test.getClass = getClass;
|
||||
})(Test || (Test = {}));
|
||||
|
||||
|
||||
//// [declarationEmitExpressionInExtends5.d.ts]
|
||||
declare namespace Test {
|
||||
interface IFace {
|
||||
}
|
||||
class SomeClass implements IFace {
|
||||
}
|
||||
const Derived_base: new () => IFace;
|
||||
class Derived extends Derived_base {
|
||||
}
|
||||
function getClass<T>(): new () => T;
|
||||
}
|
||||
@@ -0,0 +1,33 @@
|
||||
=== tests/cases/compiler/declarationEmitExpressionInExtends5.ts ===
|
||||
namespace Test
|
||||
>Test : Symbol(Test, Decl(declarationEmitExpressionInExtends5.ts, 0, 0))
|
||||
{
|
||||
export interface IFace
|
||||
>IFace : Symbol(IFace, Decl(declarationEmitExpressionInExtends5.ts, 1, 1))
|
||||
{
|
||||
}
|
||||
|
||||
export class SomeClass implements IFace
|
||||
>SomeClass : Symbol(SomeClass, Decl(declarationEmitExpressionInExtends5.ts, 4, 2))
|
||||
>IFace : Symbol(IFace, Decl(declarationEmitExpressionInExtends5.ts, 1, 1))
|
||||
{
|
||||
}
|
||||
|
||||
export class Derived extends getClass<IFace>()
|
||||
>Derived : Symbol(Derived, Decl(declarationEmitExpressionInExtends5.ts, 8, 2))
|
||||
>getClass : Symbol(getClass, Decl(declarationEmitExpressionInExtends5.ts, 12, 2))
|
||||
>IFace : Symbol(IFace, Decl(declarationEmitExpressionInExtends5.ts, 1, 1))
|
||||
{
|
||||
}
|
||||
|
||||
export function getClass<T>() : new() => T
|
||||
>getClass : Symbol(getClass, Decl(declarationEmitExpressionInExtends5.ts, 12, 2))
|
||||
>T : Symbol(T, Decl(declarationEmitExpressionInExtends5.ts, 14, 26))
|
||||
>T : Symbol(T, Decl(declarationEmitExpressionInExtends5.ts, 14, 26))
|
||||
{
|
||||
return SomeClass as (new() => T);
|
||||
>SomeClass : Symbol(SomeClass, Decl(declarationEmitExpressionInExtends5.ts, 4, 2))
|
||||
>T : Symbol(T, Decl(declarationEmitExpressionInExtends5.ts, 14, 26))
|
||||
}
|
||||
}
|
||||
|
||||
@@ -0,0 +1,35 @@
|
||||
=== tests/cases/compiler/declarationEmitExpressionInExtends5.ts ===
|
||||
namespace Test
|
||||
>Test : typeof Test
|
||||
{
|
||||
export interface IFace
|
||||
>IFace : IFace
|
||||
{
|
||||
}
|
||||
|
||||
export class SomeClass implements IFace
|
||||
>SomeClass : SomeClass
|
||||
>IFace : IFace
|
||||
{
|
||||
}
|
||||
|
||||
export class Derived extends getClass<IFace>()
|
||||
>Derived : Derived
|
||||
>getClass<IFace>() : IFace
|
||||
>getClass : <T>() => new () => T
|
||||
>IFace : IFace
|
||||
{
|
||||
}
|
||||
|
||||
export function getClass<T>() : new() => T
|
||||
>getClass : <T>() => new () => T
|
||||
>T : T
|
||||
>T : T
|
||||
{
|
||||
return SomeClass as (new() => T);
|
||||
>SomeClass as (new() => T) : new () => T
|
||||
>SomeClass : typeof SomeClass
|
||||
>T : T
|
||||
}
|
||||
}
|
||||
|
||||
@@ -18,7 +18,7 @@ exports["default"] = {
|
||||
|
||||
|
||||
//// [declarationEmitInferedDefaultExportType.d.ts]
|
||||
declare var _default: {
|
||||
declare const _default: {
|
||||
foo: any[];
|
||||
bar: any;
|
||||
baz: any;
|
||||
|
||||
@@ -16,7 +16,7 @@ module.exports = {
|
||||
|
||||
|
||||
//// [declarationEmitInferedDefaultExportType2.d.ts]
|
||||
declare var _default: {
|
||||
declare const _default: {
|
||||
foo: any[];
|
||||
bar: any;
|
||||
baz: any;
|
||||
|
||||
@@ -0,0 +1,15 @@
|
||||
//// [emitThisInObjectLiteralGetter.ts]
|
||||
const example = {
|
||||
get foo() {
|
||||
return item => this.bar(item);
|
||||
}
|
||||
};
|
||||
|
||||
|
||||
//// [emitThisInObjectLiteralGetter.js]
|
||||
var example = {
|
||||
get foo() {
|
||||
var _this = this;
|
||||
return function (item) { return _this.bar(item); };
|
||||
}
|
||||
};
|
||||
@@ -0,0 +1,13 @@
|
||||
=== tests/cases/compiler/emitThisInObjectLiteralGetter.ts ===
|
||||
const example = {
|
||||
>example : Symbol(example, Decl(emitThisInObjectLiteralGetter.ts, 0, 5))
|
||||
|
||||
get foo() {
|
||||
>foo : Symbol(foo, Decl(emitThisInObjectLiteralGetter.ts, 0, 17))
|
||||
|
||||
return item => this.bar(item);
|
||||
>item : Symbol(item, Decl(emitThisInObjectLiteralGetter.ts, 2, 14))
|
||||
>item : Symbol(item, Decl(emitThisInObjectLiteralGetter.ts, 2, 14))
|
||||
}
|
||||
};
|
||||
|
||||
@@ -0,0 +1,19 @@
|
||||
=== tests/cases/compiler/emitThisInObjectLiteralGetter.ts ===
|
||||
const example = {
|
||||
>example : { readonly foo: (item: any) => any; }
|
||||
>{ get foo() { return item => this.bar(item); }} : { readonly foo: (item: any) => any; }
|
||||
|
||||
get foo() {
|
||||
>foo : (item: any) => any
|
||||
|
||||
return item => this.bar(item);
|
||||
>item => this.bar(item) : (item: any) => any
|
||||
>item : any
|
||||
>this.bar(item) : any
|
||||
>this.bar : any
|
||||
>this : any
|
||||
>bar : any
|
||||
>item : any
|
||||
}
|
||||
};
|
||||
|
||||
@@ -61,18 +61,17 @@ class C9 extends B9 {
|
||||
|
||||
|
||||
//// [C1.js]
|
||||
var __await = (this && this.__await) || function (v) { return this instanceof __await ? (this.v = v, this) : new __await(v); }
|
||||
var __asyncGenerator = (this && this.__asyncGenerator) || function (thisArg, _arguments, generator) {
|
||||
if (!Symbol.asyncIterator) throw new TypeError("Symbol.asyncIterator is not defined.");
|
||||
var g = generator.apply(thisArg, _arguments || []), q = [], c, i;
|
||||
return i = { next: verb("next"), "throw": verb("throw"), "return": verb("return") }, i[Symbol.asyncIterator] = function () { return this; }, i;
|
||||
function verb(n) { return function (v) { return new Promise(function (a, b) { q.push([n, v, a, b]), next(); }); }; }
|
||||
function next() { if (!c && q.length) resume((c = q.shift())[0], c[1]); }
|
||||
function resume(n, v) { try { step(g[n](v)); } catch (e) { settle(c[3], e); } }
|
||||
function step(r) { r.done ? settle(c[2], r) : Promise.resolve(r.value[1]).then(r.value[0] === "yield" ? send : fulfill, reject); }
|
||||
function send(value) { settle(c[2], { value: value, done: false }); }
|
||||
var g = generator.apply(thisArg, _arguments || []), i, q = [];
|
||||
return i = {}, verb("next"), verb("throw"), verb("return"), i[Symbol.asyncIterator] = function () { return this; }, i;
|
||||
function verb(n) { if (g[n]) i[n] = function (v) { return new Promise(function (a, b) { q.push([n, v, a, b]) > 1 || resume(n, v); }); }; }
|
||||
function resume(n, v) { try { step(g[n](v)); } catch (e) { settle(q[0][3], e); } }
|
||||
function step(r) { r.value instanceof __await ? Promise.resolve(r.value.v).then(fulfill, reject) : settle(q[0][2], r); }
|
||||
function fulfill(value) { resume("next", value); }
|
||||
function reject(value) { resume("throw", value); }
|
||||
function settle(f, v) { c = void 0, f(v), next(); }
|
||||
function settle(f, v) { if (f(v), q.shift(), q.length) resume(q[0][0], q[0][1]); }
|
||||
};
|
||||
class C1 {
|
||||
f() {
|
||||
@@ -81,143 +80,137 @@ class C1 {
|
||||
}
|
||||
}
|
||||
//// [C2.js]
|
||||
var __await = (this && this.__await) || function (v) { return this instanceof __await ? (this.v = v, this) : new __await(v); }
|
||||
var __asyncGenerator = (this && this.__asyncGenerator) || function (thisArg, _arguments, generator) {
|
||||
if (!Symbol.asyncIterator) throw new TypeError("Symbol.asyncIterator is not defined.");
|
||||
var g = generator.apply(thisArg, _arguments || []), q = [], c, i;
|
||||
return i = { next: verb("next"), "throw": verb("throw"), "return": verb("return") }, i[Symbol.asyncIterator] = function () { return this; }, i;
|
||||
function verb(n) { return function (v) { return new Promise(function (a, b) { q.push([n, v, a, b]), next(); }); }; }
|
||||
function next() { if (!c && q.length) resume((c = q.shift())[0], c[1]); }
|
||||
function resume(n, v) { try { step(g[n](v)); } catch (e) { settle(c[3], e); } }
|
||||
function step(r) { r.done ? settle(c[2], r) : Promise.resolve(r.value[1]).then(r.value[0] === "yield" ? send : fulfill, reject); }
|
||||
function send(value) { settle(c[2], { value: value, done: false }); }
|
||||
var g = generator.apply(thisArg, _arguments || []), i, q = [];
|
||||
return i = {}, verb("next"), verb("throw"), verb("return"), i[Symbol.asyncIterator] = function () { return this; }, i;
|
||||
function verb(n) { if (g[n]) i[n] = function (v) { return new Promise(function (a, b) { q.push([n, v, a, b]) > 1 || resume(n, v); }); }; }
|
||||
function resume(n, v) { try { step(g[n](v)); } catch (e) { settle(q[0][3], e); } }
|
||||
function step(r) { r.value instanceof __await ? Promise.resolve(r.value.v).then(fulfill, reject) : settle(q[0][2], r); }
|
||||
function fulfill(value) { resume("next", value); }
|
||||
function reject(value) { resume("throw", value); }
|
||||
function settle(f, v) { c = void 0, f(v), next(); }
|
||||
function settle(f, v) { if (f(v), q.shift(), q.length) resume(q[0][0], q[0][1]); }
|
||||
};
|
||||
class C2 {
|
||||
f() {
|
||||
return __asyncGenerator(this, arguments, function* f_1() {
|
||||
const x = yield ["yield"];
|
||||
const x = yield;
|
||||
});
|
||||
}
|
||||
}
|
||||
//// [C3.js]
|
||||
var __await = (this && this.__await) || function (v) { return this instanceof __await ? (this.v = v, this) : new __await(v); }
|
||||
var __asyncGenerator = (this && this.__asyncGenerator) || function (thisArg, _arguments, generator) {
|
||||
if (!Symbol.asyncIterator) throw new TypeError("Symbol.asyncIterator is not defined.");
|
||||
var g = generator.apply(thisArg, _arguments || []), q = [], c, i;
|
||||
return i = { next: verb("next"), "throw": verb("throw"), "return": verb("return") }, i[Symbol.asyncIterator] = function () { return this; }, i;
|
||||
function verb(n) { return function (v) { return new Promise(function (a, b) { q.push([n, v, a, b]), next(); }); }; }
|
||||
function next() { if (!c && q.length) resume((c = q.shift())[0], c[1]); }
|
||||
function resume(n, v) { try { step(g[n](v)); } catch (e) { settle(c[3], e); } }
|
||||
function step(r) { r.done ? settle(c[2], r) : Promise.resolve(r.value[1]).then(r.value[0] === "yield" ? send : fulfill, reject); }
|
||||
function send(value) { settle(c[2], { value: value, done: false }); }
|
||||
var g = generator.apply(thisArg, _arguments || []), i, q = [];
|
||||
return i = {}, verb("next"), verb("throw"), verb("return"), i[Symbol.asyncIterator] = function () { return this; }, i;
|
||||
function verb(n) { if (g[n]) i[n] = function (v) { return new Promise(function (a, b) { q.push([n, v, a, b]) > 1 || resume(n, v); }); }; }
|
||||
function resume(n, v) { try { step(g[n](v)); } catch (e) { settle(q[0][3], e); } }
|
||||
function step(r) { r.value instanceof __await ? Promise.resolve(r.value.v).then(fulfill, reject) : settle(q[0][2], r); }
|
||||
function fulfill(value) { resume("next", value); }
|
||||
function reject(value) { resume("throw", value); }
|
||||
function settle(f, v) { c = void 0, f(v), next(); }
|
||||
function settle(f, v) { if (f(v), q.shift(), q.length) resume(q[0][0], q[0][1]); }
|
||||
};
|
||||
class C3 {
|
||||
f() {
|
||||
return __asyncGenerator(this, arguments, function* f_1() {
|
||||
const x = yield ["yield", 1];
|
||||
const x = yield 1;
|
||||
});
|
||||
}
|
||||
}
|
||||
//// [C4.js]
|
||||
var __asyncDelegator = (this && this.__asyncDelegator) || function (o) {
|
||||
var i = { next: verb("next"), "throw": verb("throw", function (e) { throw e; }), "return": verb("return", function (v) { return { value: v, done: true }; }) }, p;
|
||||
return o = __asyncValues(o), i[Symbol.iterator] = function () { return this; }, i;
|
||||
function verb(n, f) { return function (v) { return v = p && n === "throw" ? f(v) : p && v.done ? v : { value: p ? ["yield", v.value] : ["await", (o[n] || f).call(o, v)], done: false }, p = !p, v; }; }
|
||||
};
|
||||
var __asyncValues = (this && this.__asyncIterator) || function (o) {
|
||||
if (!Symbol.asyncIterator) throw new TypeError("Symbol.asyncIterator is not defined.");
|
||||
var m = o[Symbol.asyncIterator];
|
||||
return m ? m.call(o) : typeof __values === "function" ? __values(o) : o[Symbol.iterator]();
|
||||
};
|
||||
var __await = (this && this.__await) || function (v) { return this instanceof __await ? (this.v = v, this) : new __await(v); }
|
||||
var __asyncDelegator = (this && this.__asyncDelegator) || function (o) {
|
||||
var i, p;
|
||||
return i = {}, verb("next"), verb("throw", function (e) { throw e; }), verb("return"), i[Symbol.iterator] = function () { return this; }, i;
|
||||
function verb(n, f) { if (o[n]) i[n] = function (v) { return (p = !p) ? { value: __await(o[n](v)), done: n === "return" } : f ? f(v) : v; }; }
|
||||
};
|
||||
var __asyncGenerator = (this && this.__asyncGenerator) || function (thisArg, _arguments, generator) {
|
||||
if (!Symbol.asyncIterator) throw new TypeError("Symbol.asyncIterator is not defined.");
|
||||
var g = generator.apply(thisArg, _arguments || []), q = [], c, i;
|
||||
return i = { next: verb("next"), "throw": verb("throw"), "return": verb("return") }, i[Symbol.asyncIterator] = function () { return this; }, i;
|
||||
function verb(n) { return function (v) { return new Promise(function (a, b) { q.push([n, v, a, b]), next(); }); }; }
|
||||
function next() { if (!c && q.length) resume((c = q.shift())[0], c[1]); }
|
||||
function resume(n, v) { try { step(g[n](v)); } catch (e) { settle(c[3], e); } }
|
||||
function step(r) { r.done ? settle(c[2], r) : Promise.resolve(r.value[1]).then(r.value[0] === "yield" ? send : fulfill, reject); }
|
||||
function send(value) { settle(c[2], { value: value, done: false }); }
|
||||
var g = generator.apply(thisArg, _arguments || []), i, q = [];
|
||||
return i = {}, verb("next"), verb("throw"), verb("return"), i[Symbol.asyncIterator] = function () { return this; }, i;
|
||||
function verb(n) { if (g[n]) i[n] = function (v) { return new Promise(function (a, b) { q.push([n, v, a, b]) > 1 || resume(n, v); }); }; }
|
||||
function resume(n, v) { try { step(g[n](v)); } catch (e) { settle(q[0][3], e); } }
|
||||
function step(r) { r.value instanceof __await ? Promise.resolve(r.value.v).then(fulfill, reject) : settle(q[0][2], r); }
|
||||
function fulfill(value) { resume("next", value); }
|
||||
function reject(value) { resume("throw", value); }
|
||||
function settle(f, v) { c = void 0, f(v), next(); }
|
||||
function settle(f, v) { if (f(v), q.shift(), q.length) resume(q[0][0], q[0][1]); }
|
||||
};
|
||||
class C4 {
|
||||
f() {
|
||||
return __asyncGenerator(this, arguments, function* f_1() {
|
||||
const x = yield* __asyncDelegator([1]);
|
||||
const x = yield __await(yield* __asyncDelegator(__asyncValues([1])));
|
||||
});
|
||||
}
|
||||
}
|
||||
//// [C5.js]
|
||||
var __await = (this && this.__await) || function (v) { return this instanceof __await ? (this.v = v, this) : new __await(v); }
|
||||
var __asyncGenerator = (this && this.__asyncGenerator) || function (thisArg, _arguments, generator) {
|
||||
if (!Symbol.asyncIterator) throw new TypeError("Symbol.asyncIterator is not defined.");
|
||||
var g = generator.apply(thisArg, _arguments || []), q = [], c, i;
|
||||
return i = { next: verb("next"), "throw": verb("throw"), "return": verb("return") }, i[Symbol.asyncIterator] = function () { return this; }, i;
|
||||
function verb(n) { return function (v) { return new Promise(function (a, b) { q.push([n, v, a, b]), next(); }); }; }
|
||||
function next() { if (!c && q.length) resume((c = q.shift())[0], c[1]); }
|
||||
function resume(n, v) { try { step(g[n](v)); } catch (e) { settle(c[3], e); } }
|
||||
function step(r) { r.done ? settle(c[2], r) : Promise.resolve(r.value[1]).then(r.value[0] === "yield" ? send : fulfill, reject); }
|
||||
function send(value) { settle(c[2], { value: value, done: false }); }
|
||||
var g = generator.apply(thisArg, _arguments || []), i, q = [];
|
||||
return i = {}, verb("next"), verb("throw"), verb("return"), i[Symbol.asyncIterator] = function () { return this; }, i;
|
||||
function verb(n) { if (g[n]) i[n] = function (v) { return new Promise(function (a, b) { q.push([n, v, a, b]) > 1 || resume(n, v); }); }; }
|
||||
function resume(n, v) { try { step(g[n](v)); } catch (e) { settle(q[0][3], e); } }
|
||||
function step(r) { r.value instanceof __await ? Promise.resolve(r.value.v).then(fulfill, reject) : settle(q[0][2], r); }
|
||||
function fulfill(value) { resume("next", value); }
|
||||
function reject(value) { resume("throw", value); }
|
||||
function settle(f, v) { c = void 0, f(v), next(); }
|
||||
};
|
||||
var __asyncDelegator = (this && this.__asyncDelegator) || function (o) {
|
||||
var i = { next: verb("next"), "throw": verb("throw", function (e) { throw e; }), "return": verb("return", function (v) { return { value: v, done: true }; }) }, p;
|
||||
return o = __asyncValues(o), i[Symbol.iterator] = function () { return this; }, i;
|
||||
function verb(n, f) { return function (v) { return v = p && n === "throw" ? f(v) : p && v.done ? v : { value: p ? ["yield", v.value] : ["await", (o[n] || f).call(o, v)], done: false }, p = !p, v; }; }
|
||||
function settle(f, v) { if (f(v), q.shift(), q.length) resume(q[0][0], q[0][1]); }
|
||||
};
|
||||
var __asyncValues = (this && this.__asyncIterator) || function (o) {
|
||||
if (!Symbol.asyncIterator) throw new TypeError("Symbol.asyncIterator is not defined.");
|
||||
var m = o[Symbol.asyncIterator];
|
||||
return m ? m.call(o) : typeof __values === "function" ? __values(o) : o[Symbol.iterator]();
|
||||
};
|
||||
var __asyncDelegator = (this && this.__asyncDelegator) || function (o) {
|
||||
var i, p;
|
||||
return i = {}, verb("next"), verb("throw", function (e) { throw e; }), verb("return"), i[Symbol.iterator] = function () { return this; }, i;
|
||||
function verb(n, f) { if (o[n]) i[n] = function (v) { return (p = !p) ? { value: __await(o[n](v)), done: n === "return" } : f ? f(v) : v; }; }
|
||||
};
|
||||
class C5 {
|
||||
f() {
|
||||
return __asyncGenerator(this, arguments, function* f_1() {
|
||||
const x = yield* __asyncDelegator((function () { return __asyncGenerator(this, arguments, function* () { yield ["yield", 1]; }); })());
|
||||
const x = yield __await(yield* __asyncDelegator(__asyncValues((function () { return __asyncGenerator(this, arguments, function* () { yield 1; }); })())));
|
||||
});
|
||||
}
|
||||
}
|
||||
//// [C6.js]
|
||||
var __await = (this && this.__await) || function (v) { return this instanceof __await ? (this.v = v, this) : new __await(v); }
|
||||
var __asyncGenerator = (this && this.__asyncGenerator) || function (thisArg, _arguments, generator) {
|
||||
if (!Symbol.asyncIterator) throw new TypeError("Symbol.asyncIterator is not defined.");
|
||||
var g = generator.apply(thisArg, _arguments || []), q = [], c, i;
|
||||
return i = { next: verb("next"), "throw": verb("throw"), "return": verb("return") }, i[Symbol.asyncIterator] = function () { return this; }, i;
|
||||
function verb(n) { return function (v) { return new Promise(function (a, b) { q.push([n, v, a, b]), next(); }); }; }
|
||||
function next() { if (!c && q.length) resume((c = q.shift())[0], c[1]); }
|
||||
function resume(n, v) { try { step(g[n](v)); } catch (e) { settle(c[3], e); } }
|
||||
function step(r) { r.done ? settle(c[2], r) : Promise.resolve(r.value[1]).then(r.value[0] === "yield" ? send : fulfill, reject); }
|
||||
function send(value) { settle(c[2], { value: value, done: false }); }
|
||||
var g = generator.apply(thisArg, _arguments || []), i, q = [];
|
||||
return i = {}, verb("next"), verb("throw"), verb("return"), i[Symbol.asyncIterator] = function () { return this; }, i;
|
||||
function verb(n) { if (g[n]) i[n] = function (v) { return new Promise(function (a, b) { q.push([n, v, a, b]) > 1 || resume(n, v); }); }; }
|
||||
function resume(n, v) { try { step(g[n](v)); } catch (e) { settle(q[0][3], e); } }
|
||||
function step(r) { r.value instanceof __await ? Promise.resolve(r.value.v).then(fulfill, reject) : settle(q[0][2], r); }
|
||||
function fulfill(value) { resume("next", value); }
|
||||
function reject(value) { resume("throw", value); }
|
||||
function settle(f, v) { c = void 0, f(v), next(); }
|
||||
function settle(f, v) { if (f(v), q.shift(), q.length) resume(q[0][0], q[0][1]); }
|
||||
};
|
||||
class C6 {
|
||||
f() {
|
||||
return __asyncGenerator(this, arguments, function* f_1() {
|
||||
const x = yield ["await", 1];
|
||||
const x = yield __await(1);
|
||||
});
|
||||
}
|
||||
}
|
||||
//// [C7.js]
|
||||
var __await = (this && this.__await) || function (v) { return this instanceof __await ? (this.v = v, this) : new __await(v); }
|
||||
var __asyncGenerator = (this && this.__asyncGenerator) || function (thisArg, _arguments, generator) {
|
||||
if (!Symbol.asyncIterator) throw new TypeError("Symbol.asyncIterator is not defined.");
|
||||
var g = generator.apply(thisArg, _arguments || []), q = [], c, i;
|
||||
return i = { next: verb("next"), "throw": verb("throw"), "return": verb("return") }, i[Symbol.asyncIterator] = function () { return this; }, i;
|
||||
function verb(n) { return function (v) { return new Promise(function (a, b) { q.push([n, v, a, b]), next(); }); }; }
|
||||
function next() { if (!c && q.length) resume((c = q.shift())[0], c[1]); }
|
||||
function resume(n, v) { try { step(g[n](v)); } catch (e) { settle(c[3], e); } }
|
||||
function step(r) { r.done ? settle(c[2], r) : Promise.resolve(r.value[1]).then(r.value[0] === "yield" ? send : fulfill, reject); }
|
||||
function send(value) { settle(c[2], { value: value, done: false }); }
|
||||
var g = generator.apply(thisArg, _arguments || []), i, q = [];
|
||||
return i = {}, verb("next"), verb("throw"), verb("return"), i[Symbol.asyncIterator] = function () { return this; }, i;
|
||||
function verb(n) { if (g[n]) i[n] = function (v) { return new Promise(function (a, b) { q.push([n, v, a, b]) > 1 || resume(n, v); }); }; }
|
||||
function resume(n, v) { try { step(g[n](v)); } catch (e) { settle(q[0][3], e); } }
|
||||
function step(r) { r.value instanceof __await ? Promise.resolve(r.value.v).then(fulfill, reject) : settle(q[0][2], r); }
|
||||
function fulfill(value) { resume("next", value); }
|
||||
function reject(value) { resume("throw", value); }
|
||||
function settle(f, v) { c = void 0, f(v), next(); }
|
||||
function settle(f, v) { if (f(v), q.shift(), q.length) resume(q[0][0], q[0][1]); }
|
||||
};
|
||||
class C7 {
|
||||
f() {
|
||||
@@ -227,18 +220,17 @@ class C7 {
|
||||
}
|
||||
}
|
||||
//// [C8.js]
|
||||
var __await = (this && this.__await) || function (v) { return this instanceof __await ? (this.v = v, this) : new __await(v); }
|
||||
var __asyncGenerator = (this && this.__asyncGenerator) || function (thisArg, _arguments, generator) {
|
||||
if (!Symbol.asyncIterator) throw new TypeError("Symbol.asyncIterator is not defined.");
|
||||
var g = generator.apply(thisArg, _arguments || []), q = [], c, i;
|
||||
return i = { next: verb("next"), "throw": verb("throw"), "return": verb("return") }, i[Symbol.asyncIterator] = function () { return this; }, i;
|
||||
function verb(n) { return function (v) { return new Promise(function (a, b) { q.push([n, v, a, b]), next(); }); }; }
|
||||
function next() { if (!c && q.length) resume((c = q.shift())[0], c[1]); }
|
||||
function resume(n, v) { try { step(g[n](v)); } catch (e) { settle(c[3], e); } }
|
||||
function step(r) { r.done ? settle(c[2], r) : Promise.resolve(r.value[1]).then(r.value[0] === "yield" ? send : fulfill, reject); }
|
||||
function send(value) { settle(c[2], { value: value, done: false }); }
|
||||
var g = generator.apply(thisArg, _arguments || []), i, q = [];
|
||||
return i = {}, verb("next"), verb("throw"), verb("return"), i[Symbol.asyncIterator] = function () { return this; }, i;
|
||||
function verb(n) { if (g[n]) i[n] = function (v) { return new Promise(function (a, b) { q.push([n, v, a, b]) > 1 || resume(n, v); }); }; }
|
||||
function resume(n, v) { try { step(g[n](v)); } catch (e) { settle(q[0][3], e); } }
|
||||
function step(r) { r.value instanceof __await ? Promise.resolve(r.value.v).then(fulfill, reject) : settle(q[0][2], r); }
|
||||
function fulfill(value) { resume("next", value); }
|
||||
function reject(value) { resume("throw", value); }
|
||||
function settle(f, v) { c = void 0, f(v), next(); }
|
||||
function settle(f, v) { if (f(v), q.shift(), q.length) resume(q[0][0], q[0][1]); }
|
||||
};
|
||||
class C8 {
|
||||
g() {
|
||||
@@ -250,18 +242,17 @@ class C8 {
|
||||
}
|
||||
}
|
||||
//// [C9.js]
|
||||
var __await = (this && this.__await) || function (v) { return this instanceof __await ? (this.v = v, this) : new __await(v); }
|
||||
var __asyncGenerator = (this && this.__asyncGenerator) || function (thisArg, _arguments, generator) {
|
||||
if (!Symbol.asyncIterator) throw new TypeError("Symbol.asyncIterator is not defined.");
|
||||
var g = generator.apply(thisArg, _arguments || []), q = [], c, i;
|
||||
return i = { next: verb("next"), "throw": verb("throw"), "return": verb("return") }, i[Symbol.asyncIterator] = function () { return this; }, i;
|
||||
function verb(n) { return function (v) { return new Promise(function (a, b) { q.push([n, v, a, b]), next(); }); }; }
|
||||
function next() { if (!c && q.length) resume((c = q.shift())[0], c[1]); }
|
||||
function resume(n, v) { try { step(g[n](v)); } catch (e) { settle(c[3], e); } }
|
||||
function step(r) { r.done ? settle(c[2], r) : Promise.resolve(r.value[1]).then(r.value[0] === "yield" ? send : fulfill, reject); }
|
||||
function send(value) { settle(c[2], { value: value, done: false }); }
|
||||
var g = generator.apply(thisArg, _arguments || []), i, q = [];
|
||||
return i = {}, verb("next"), verb("throw"), verb("return"), i[Symbol.asyncIterator] = function () { return this; }, i;
|
||||
function verb(n) { if (g[n]) i[n] = function (v) { return new Promise(function (a, b) { q.push([n, v, a, b]) > 1 || resume(n, v); }); }; }
|
||||
function resume(n, v) { try { step(g[n](v)); } catch (e) { settle(q[0][3], e); } }
|
||||
function step(r) { r.value instanceof __await ? Promise.resolve(r.value.v).then(fulfill, reject) : settle(q[0][2], r); }
|
||||
function fulfill(value) { resume("next", value); }
|
||||
function reject(value) { resume("throw", value); }
|
||||
function settle(f, v) { c = void 0, f(v), next(); }
|
||||
function settle(f, v) { if (f(v), q.shift(), q.length) resume(q[0][0], q[0][1]); }
|
||||
};
|
||||
class B9 {
|
||||
g() { }
|
||||
|
||||
@@ -88,18 +88,17 @@ var __generator = (this && this.__generator) || function (thisArg, body) {
|
||||
if (op[0] & 5) throw op[1]; return { value: op[0] ? op[1] : void 0, done: true };
|
||||
}
|
||||
};
|
||||
var __await = (this && this.__await) || function (v) { return this instanceof __await ? (this.v = v, this) : new __await(v); }
|
||||
var __asyncGenerator = (this && this.__asyncGenerator) || function (thisArg, _arguments, generator) {
|
||||
if (!Symbol.asyncIterator) throw new TypeError("Symbol.asyncIterator is not defined.");
|
||||
var g = generator.apply(thisArg, _arguments || []), q = [], c, i;
|
||||
return i = { next: verb("next"), "throw": verb("throw"), "return": verb("return") }, i[Symbol.asyncIterator] = function () { return this; }, i;
|
||||
function verb(n) { return function (v) { return new Promise(function (a, b) { q.push([n, v, a, b]), next(); }); }; }
|
||||
function next() { if (!c && q.length) resume((c = q.shift())[0], c[1]); }
|
||||
function resume(n, v) { try { step(g[n](v)); } catch (e) { settle(c[3], e); } }
|
||||
function step(r) { r.done ? settle(c[2], r) : Promise.resolve(r.value[1]).then(r.value[0] === "yield" ? send : fulfill, reject); }
|
||||
function send(value) { settle(c[2], { value: value, done: false }); }
|
||||
var g = generator.apply(thisArg, _arguments || []), i, q = [];
|
||||
return i = {}, verb("next"), verb("throw"), verb("return"), i[Symbol.asyncIterator] = function () { return this; }, i;
|
||||
function verb(n) { if (g[n]) i[n] = function (v) { return new Promise(function (a, b) { q.push([n, v, a, b]) > 1 || resume(n, v); }); }; }
|
||||
function resume(n, v) { try { step(g[n](v)); } catch (e) { settle(q[0][3], e); } }
|
||||
function step(r) { r.value instanceof __await ? Promise.resolve(r.value.v).then(fulfill, reject) : settle(q[0][2], r); }
|
||||
function fulfill(value) { resume("next", value); }
|
||||
function reject(value) { resume("throw", value); }
|
||||
function settle(f, v) { c = void 0, f(v), next(); }
|
||||
function settle(f, v) { if (f(v), q.shift(), q.length) resume(q[0][0], q[0][1]); }
|
||||
};
|
||||
var C1 = (function () {
|
||||
function C1() {
|
||||
@@ -141,18 +140,17 @@ var __generator = (this && this.__generator) || function (thisArg, body) {
|
||||
if (op[0] & 5) throw op[1]; return { value: op[0] ? op[1] : void 0, done: true };
|
||||
}
|
||||
};
|
||||
var __await = (this && this.__await) || function (v) { return this instanceof __await ? (this.v = v, this) : new __await(v); }
|
||||
var __asyncGenerator = (this && this.__asyncGenerator) || function (thisArg, _arguments, generator) {
|
||||
if (!Symbol.asyncIterator) throw new TypeError("Symbol.asyncIterator is not defined.");
|
||||
var g = generator.apply(thisArg, _arguments || []), q = [], c, i;
|
||||
return i = { next: verb("next"), "throw": verb("throw"), "return": verb("return") }, i[Symbol.asyncIterator] = function () { return this; }, i;
|
||||
function verb(n) { return function (v) { return new Promise(function (a, b) { q.push([n, v, a, b]), next(); }); }; }
|
||||
function next() { if (!c && q.length) resume((c = q.shift())[0], c[1]); }
|
||||
function resume(n, v) { try { step(g[n](v)); } catch (e) { settle(c[3], e); } }
|
||||
function step(r) { r.done ? settle(c[2], r) : Promise.resolve(r.value[1]).then(r.value[0] === "yield" ? send : fulfill, reject); }
|
||||
function send(value) { settle(c[2], { value: value, done: false }); }
|
||||
var g = generator.apply(thisArg, _arguments || []), i, q = [];
|
||||
return i = {}, verb("next"), verb("throw"), verb("return"), i[Symbol.asyncIterator] = function () { return this; }, i;
|
||||
function verb(n) { if (g[n]) i[n] = function (v) { return new Promise(function (a, b) { q.push([n, v, a, b]) > 1 || resume(n, v); }); }; }
|
||||
function resume(n, v) { try { step(g[n](v)); } catch (e) { settle(q[0][3], e); } }
|
||||
function step(r) { r.value instanceof __await ? Promise.resolve(r.value.v).then(fulfill, reject) : settle(q[0][2], r); }
|
||||
function fulfill(value) { resume("next", value); }
|
||||
function reject(value) { resume("throw", value); }
|
||||
function settle(f, v) { c = void 0, f(v), next(); }
|
||||
function settle(f, v) { if (f(v), q.shift(), q.length) resume(q[0][0], q[0][1]); }
|
||||
};
|
||||
var C2 = (function () {
|
||||
function C2() {
|
||||
@@ -162,7 +160,7 @@ var C2 = (function () {
|
||||
var x;
|
||||
return __generator(this, function (_a) {
|
||||
switch (_a.label) {
|
||||
case 0: return [4 /*yield*/, ["yield"]];
|
||||
case 0: return [4 /*yield*/];
|
||||
case 1:
|
||||
x = _a.sent();
|
||||
return [2 /*return*/];
|
||||
@@ -200,18 +198,17 @@ var __generator = (this && this.__generator) || function (thisArg, body) {
|
||||
if (op[0] & 5) throw op[1]; return { value: op[0] ? op[1] : void 0, done: true };
|
||||
}
|
||||
};
|
||||
var __await = (this && this.__await) || function (v) { return this instanceof __await ? (this.v = v, this) : new __await(v); }
|
||||
var __asyncGenerator = (this && this.__asyncGenerator) || function (thisArg, _arguments, generator) {
|
||||
if (!Symbol.asyncIterator) throw new TypeError("Symbol.asyncIterator is not defined.");
|
||||
var g = generator.apply(thisArg, _arguments || []), q = [], c, i;
|
||||
return i = { next: verb("next"), "throw": verb("throw"), "return": verb("return") }, i[Symbol.asyncIterator] = function () { return this; }, i;
|
||||
function verb(n) { return function (v) { return new Promise(function (a, b) { q.push([n, v, a, b]), next(); }); }; }
|
||||
function next() { if (!c && q.length) resume((c = q.shift())[0], c[1]); }
|
||||
function resume(n, v) { try { step(g[n](v)); } catch (e) { settle(c[3], e); } }
|
||||
function step(r) { r.done ? settle(c[2], r) : Promise.resolve(r.value[1]).then(r.value[0] === "yield" ? send : fulfill, reject); }
|
||||
function send(value) { settle(c[2], { value: value, done: false }); }
|
||||
var g = generator.apply(thisArg, _arguments || []), i, q = [];
|
||||
return i = {}, verb("next"), verb("throw"), verb("return"), i[Symbol.asyncIterator] = function () { return this; }, i;
|
||||
function verb(n) { if (g[n]) i[n] = function (v) { return new Promise(function (a, b) { q.push([n, v, a, b]) > 1 || resume(n, v); }); }; }
|
||||
function resume(n, v) { try { step(g[n](v)); } catch (e) { settle(q[0][3], e); } }
|
||||
function step(r) { r.value instanceof __await ? Promise.resolve(r.value.v).then(fulfill, reject) : settle(q[0][2], r); }
|
||||
function fulfill(value) { resume("next", value); }
|
||||
function reject(value) { resume("throw", value); }
|
||||
function settle(f, v) { c = void 0, f(v), next(); }
|
||||
function settle(f, v) { if (f(v), q.shift(), q.length) resume(q[0][0], q[0][1]); }
|
||||
};
|
||||
var C3 = (function () {
|
||||
function C3() {
|
||||
@@ -221,7 +218,7 @@ var C3 = (function () {
|
||||
var x;
|
||||
return __generator(this, function (_a) {
|
||||
switch (_a.label) {
|
||||
case 0: return [4 /*yield*/, ["yield", 1]];
|
||||
case 0: return [4 /*yield*/, 1];
|
||||
case 1:
|
||||
x = _a.sent();
|
||||
return [2 /*return*/];
|
||||
@@ -259,28 +256,27 @@ var __generator = (this && this.__generator) || function (thisArg, body) {
|
||||
if (op[0] & 5) throw op[1]; return { value: op[0] ? op[1] : void 0, done: true };
|
||||
}
|
||||
};
|
||||
var __asyncDelegator = (this && this.__asyncDelegator) || function (o) {
|
||||
var i = { next: verb("next"), "throw": verb("throw", function (e) { throw e; }), "return": verb("return", function (v) { return { value: v, done: true }; }) }, p;
|
||||
return o = __asyncValues(o), i[Symbol.iterator] = function () { return this; }, i;
|
||||
function verb(n, f) { return function (v) { return v = p && n === "throw" ? f(v) : p && v.done ? v : { value: p ? ["yield", v.value] : ["await", (o[n] || f).call(o, v)], done: false }, p = !p, v; }; }
|
||||
};
|
||||
var __asyncValues = (this && this.__asyncIterator) || function (o) {
|
||||
if (!Symbol.asyncIterator) throw new TypeError("Symbol.asyncIterator is not defined.");
|
||||
var m = o[Symbol.asyncIterator];
|
||||
return m ? m.call(o) : typeof __values === "function" ? __values(o) : o[Symbol.iterator]();
|
||||
};
|
||||
var __await = (this && this.__await) || function (v) { return this instanceof __await ? (this.v = v, this) : new __await(v); }
|
||||
var __asyncDelegator = (this && this.__asyncDelegator) || function (o) {
|
||||
var i, p;
|
||||
return i = {}, verb("next"), verb("throw", function (e) { throw e; }), verb("return"), i[Symbol.iterator] = function () { return this; }, i;
|
||||
function verb(n, f) { if (o[n]) i[n] = function (v) { return (p = !p) ? { value: __await(o[n](v)), done: n === "return" } : f ? f(v) : v; }; }
|
||||
};
|
||||
var __asyncGenerator = (this && this.__asyncGenerator) || function (thisArg, _arguments, generator) {
|
||||
if (!Symbol.asyncIterator) throw new TypeError("Symbol.asyncIterator is not defined.");
|
||||
var g = generator.apply(thisArg, _arguments || []), q = [], c, i;
|
||||
return i = { next: verb("next"), "throw": verb("throw"), "return": verb("return") }, i[Symbol.asyncIterator] = function () { return this; }, i;
|
||||
function verb(n) { return function (v) { return new Promise(function (a, b) { q.push([n, v, a, b]), next(); }); }; }
|
||||
function next() { if (!c && q.length) resume((c = q.shift())[0], c[1]); }
|
||||
function resume(n, v) { try { step(g[n](v)); } catch (e) { settle(c[3], e); } }
|
||||
function step(r) { r.done ? settle(c[2], r) : Promise.resolve(r.value[1]).then(r.value[0] === "yield" ? send : fulfill, reject); }
|
||||
function send(value) { settle(c[2], { value: value, done: false }); }
|
||||
var g = generator.apply(thisArg, _arguments || []), i, q = [];
|
||||
return i = {}, verb("next"), verb("throw"), verb("return"), i[Symbol.asyncIterator] = function () { return this; }, i;
|
||||
function verb(n) { if (g[n]) i[n] = function (v) { return new Promise(function (a, b) { q.push([n, v, a, b]) > 1 || resume(n, v); }); }; }
|
||||
function resume(n, v) { try { step(g[n](v)); } catch (e) { settle(q[0][3], e); } }
|
||||
function step(r) { r.value instanceof __await ? Promise.resolve(r.value.v).then(fulfill, reject) : settle(q[0][2], r); }
|
||||
function fulfill(value) { resume("next", value); }
|
||||
function reject(value) { resume("throw", value); }
|
||||
function settle(f, v) { c = void 0, f(v), next(); }
|
||||
function settle(f, v) { if (f(v), q.shift(), q.length) resume(q[0][0], q[0][1]); }
|
||||
};
|
||||
var __values = (this && this.__values) || function (o) {
|
||||
var m = typeof Symbol === "function" && o[Symbol.iterator], i = 0;
|
||||
@@ -300,8 +296,9 @@ var C4 = (function () {
|
||||
var x;
|
||||
return __generator(this, function (_a) {
|
||||
switch (_a.label) {
|
||||
case 0: return [5 /*yield**/, __values(__asyncDelegator([1]))];
|
||||
case 1:
|
||||
case 0: return [5 /*yield**/, __values(__asyncDelegator(__asyncValues([1])))];
|
||||
case 1: return [4 /*yield*/, __await.apply(void 0, [_a.sent()])];
|
||||
case 2:
|
||||
x = _a.sent();
|
||||
return [2 /*return*/];
|
||||
}
|
||||
@@ -338,29 +335,28 @@ var __generator = (this && this.__generator) || function (thisArg, body) {
|
||||
if (op[0] & 5) throw op[1]; return { value: op[0] ? op[1] : void 0, done: true };
|
||||
}
|
||||
};
|
||||
var __await = (this && this.__await) || function (v) { return this instanceof __await ? (this.v = v, this) : new __await(v); }
|
||||
var __asyncGenerator = (this && this.__asyncGenerator) || function (thisArg, _arguments, generator) {
|
||||
if (!Symbol.asyncIterator) throw new TypeError("Symbol.asyncIterator is not defined.");
|
||||
var g = generator.apply(thisArg, _arguments || []), q = [], c, i;
|
||||
return i = { next: verb("next"), "throw": verb("throw"), "return": verb("return") }, i[Symbol.asyncIterator] = function () { return this; }, i;
|
||||
function verb(n) { return function (v) { return new Promise(function (a, b) { q.push([n, v, a, b]), next(); }); }; }
|
||||
function next() { if (!c && q.length) resume((c = q.shift())[0], c[1]); }
|
||||
function resume(n, v) { try { step(g[n](v)); } catch (e) { settle(c[3], e); } }
|
||||
function step(r) { r.done ? settle(c[2], r) : Promise.resolve(r.value[1]).then(r.value[0] === "yield" ? send : fulfill, reject); }
|
||||
function send(value) { settle(c[2], { value: value, done: false }); }
|
||||
var g = generator.apply(thisArg, _arguments || []), i, q = [];
|
||||
return i = {}, verb("next"), verb("throw"), verb("return"), i[Symbol.asyncIterator] = function () { return this; }, i;
|
||||
function verb(n) { if (g[n]) i[n] = function (v) { return new Promise(function (a, b) { q.push([n, v, a, b]) > 1 || resume(n, v); }); }; }
|
||||
function resume(n, v) { try { step(g[n](v)); } catch (e) { settle(q[0][3], e); } }
|
||||
function step(r) { r.value instanceof __await ? Promise.resolve(r.value.v).then(fulfill, reject) : settle(q[0][2], r); }
|
||||
function fulfill(value) { resume("next", value); }
|
||||
function reject(value) { resume("throw", value); }
|
||||
function settle(f, v) { c = void 0, f(v), next(); }
|
||||
};
|
||||
var __asyncDelegator = (this && this.__asyncDelegator) || function (o) {
|
||||
var i = { next: verb("next"), "throw": verb("throw", function (e) { throw e; }), "return": verb("return", function (v) { return { value: v, done: true }; }) }, p;
|
||||
return o = __asyncValues(o), i[Symbol.iterator] = function () { return this; }, i;
|
||||
function verb(n, f) { return function (v) { return v = p && n === "throw" ? f(v) : p && v.done ? v : { value: p ? ["yield", v.value] : ["await", (o[n] || f).call(o, v)], done: false }, p = !p, v; }; }
|
||||
function settle(f, v) { if (f(v), q.shift(), q.length) resume(q[0][0], q[0][1]); }
|
||||
};
|
||||
var __asyncValues = (this && this.__asyncIterator) || function (o) {
|
||||
if (!Symbol.asyncIterator) throw new TypeError("Symbol.asyncIterator is not defined.");
|
||||
var m = o[Symbol.asyncIterator];
|
||||
return m ? m.call(o) : typeof __values === "function" ? __values(o) : o[Symbol.iterator]();
|
||||
};
|
||||
var __asyncDelegator = (this && this.__asyncDelegator) || function (o) {
|
||||
var i, p;
|
||||
return i = {}, verb("next"), verb("throw", function (e) { throw e; }), verb("return"), i[Symbol.iterator] = function () { return this; }, i;
|
||||
function verb(n, f) { if (o[n]) i[n] = function (v) { return (p = !p) ? { value: __await(o[n](v)), done: n === "return" } : f ? f(v) : v; }; }
|
||||
};
|
||||
var __values = (this && this.__values) || function (o) {
|
||||
var m = typeof Symbol === "function" && o[Symbol.iterator], i = 0;
|
||||
if (m) return m.call(o);
|
||||
@@ -379,15 +375,16 @@ var C5 = (function () {
|
||||
var x;
|
||||
return __generator(this, function (_a) {
|
||||
switch (_a.label) {
|
||||
case 0: return [5 /*yield**/, __values(__asyncDelegator((function () { return __asyncGenerator(this, arguments, function () { return __generator(this, function (_a) {
|
||||
case 0: return [5 /*yield**/, __values(__asyncDelegator(__asyncValues((function () { return __asyncGenerator(this, arguments, function () { return __generator(this, function (_a) {
|
||||
switch (_a.label) {
|
||||
case 0: return [4 /*yield*/, ["yield", 1]];
|
||||
case 0: return [4 /*yield*/, 1];
|
||||
case 1:
|
||||
_a.sent();
|
||||
return [2 /*return*/];
|
||||
}
|
||||
}); }); })()))];
|
||||
case 1:
|
||||
}); }); })())))];
|
||||
case 1: return [4 /*yield*/, __await.apply(void 0, [_a.sent()])];
|
||||
case 2:
|
||||
x = _a.sent();
|
||||
return [2 /*return*/];
|
||||
}
|
||||
@@ -424,18 +421,17 @@ var __generator = (this && this.__generator) || function (thisArg, body) {
|
||||
if (op[0] & 5) throw op[1]; return { value: op[0] ? op[1] : void 0, done: true };
|
||||
}
|
||||
};
|
||||
var __await = (this && this.__await) || function (v) { return this instanceof __await ? (this.v = v, this) : new __await(v); }
|
||||
var __asyncGenerator = (this && this.__asyncGenerator) || function (thisArg, _arguments, generator) {
|
||||
if (!Symbol.asyncIterator) throw new TypeError("Symbol.asyncIterator is not defined.");
|
||||
var g = generator.apply(thisArg, _arguments || []), q = [], c, i;
|
||||
return i = { next: verb("next"), "throw": verb("throw"), "return": verb("return") }, i[Symbol.asyncIterator] = function () { return this; }, i;
|
||||
function verb(n) { return function (v) { return new Promise(function (a, b) { q.push([n, v, a, b]), next(); }); }; }
|
||||
function next() { if (!c && q.length) resume((c = q.shift())[0], c[1]); }
|
||||
function resume(n, v) { try { step(g[n](v)); } catch (e) { settle(c[3], e); } }
|
||||
function step(r) { r.done ? settle(c[2], r) : Promise.resolve(r.value[1]).then(r.value[0] === "yield" ? send : fulfill, reject); }
|
||||
function send(value) { settle(c[2], { value: value, done: false }); }
|
||||
var g = generator.apply(thisArg, _arguments || []), i, q = [];
|
||||
return i = {}, verb("next"), verb("throw"), verb("return"), i[Symbol.asyncIterator] = function () { return this; }, i;
|
||||
function verb(n) { if (g[n]) i[n] = function (v) { return new Promise(function (a, b) { q.push([n, v, a, b]) > 1 || resume(n, v); }); }; }
|
||||
function resume(n, v) { try { step(g[n](v)); } catch (e) { settle(q[0][3], e); } }
|
||||
function step(r) { r.value instanceof __await ? Promise.resolve(r.value.v).then(fulfill, reject) : settle(q[0][2], r); }
|
||||
function fulfill(value) { resume("next", value); }
|
||||
function reject(value) { resume("throw", value); }
|
||||
function settle(f, v) { c = void 0, f(v), next(); }
|
||||
function settle(f, v) { if (f(v), q.shift(), q.length) resume(q[0][0], q[0][1]); }
|
||||
};
|
||||
var C6 = (function () {
|
||||
function C6() {
|
||||
@@ -445,7 +441,7 @@ var C6 = (function () {
|
||||
var x;
|
||||
return __generator(this, function (_a) {
|
||||
switch (_a.label) {
|
||||
case 0: return [4 /*yield*/, ["await", 1]];
|
||||
case 0: return [4 /*yield*/, __await(1)];
|
||||
case 1:
|
||||
x = _a.sent();
|
||||
return [2 /*return*/];
|
||||
@@ -483,18 +479,17 @@ var __generator = (this && this.__generator) || function (thisArg, body) {
|
||||
if (op[0] & 5) throw op[1]; return { value: op[0] ? op[1] : void 0, done: true };
|
||||
}
|
||||
};
|
||||
var __await = (this && this.__await) || function (v) { return this instanceof __await ? (this.v = v, this) : new __await(v); }
|
||||
var __asyncGenerator = (this && this.__asyncGenerator) || function (thisArg, _arguments, generator) {
|
||||
if (!Symbol.asyncIterator) throw new TypeError("Symbol.asyncIterator is not defined.");
|
||||
var g = generator.apply(thisArg, _arguments || []), q = [], c, i;
|
||||
return i = { next: verb("next"), "throw": verb("throw"), "return": verb("return") }, i[Symbol.asyncIterator] = function () { return this; }, i;
|
||||
function verb(n) { return function (v) { return new Promise(function (a, b) { q.push([n, v, a, b]), next(); }); }; }
|
||||
function next() { if (!c && q.length) resume((c = q.shift())[0], c[1]); }
|
||||
function resume(n, v) { try { step(g[n](v)); } catch (e) { settle(c[3], e); } }
|
||||
function step(r) { r.done ? settle(c[2], r) : Promise.resolve(r.value[1]).then(r.value[0] === "yield" ? send : fulfill, reject); }
|
||||
function send(value) { settle(c[2], { value: value, done: false }); }
|
||||
var g = generator.apply(thisArg, _arguments || []), i, q = [];
|
||||
return i = {}, verb("next"), verb("throw"), verb("return"), i[Symbol.asyncIterator] = function () { return this; }, i;
|
||||
function verb(n) { if (g[n]) i[n] = function (v) { return new Promise(function (a, b) { q.push([n, v, a, b]) > 1 || resume(n, v); }); }; }
|
||||
function resume(n, v) { try { step(g[n](v)); } catch (e) { settle(q[0][3], e); } }
|
||||
function step(r) { r.value instanceof __await ? Promise.resolve(r.value.v).then(fulfill, reject) : settle(q[0][2], r); }
|
||||
function fulfill(value) { resume("next", value); }
|
||||
function reject(value) { resume("throw", value); }
|
||||
function settle(f, v) { c = void 0, f(v), next(); }
|
||||
function settle(f, v) { if (f(v), q.shift(), q.length) resume(q[0][0], q[0][1]); }
|
||||
};
|
||||
var C7 = (function () {
|
||||
function C7() {
|
||||
@@ -536,18 +531,17 @@ var __generator = (this && this.__generator) || function (thisArg, body) {
|
||||
if (op[0] & 5) throw op[1]; return { value: op[0] ? op[1] : void 0, done: true };
|
||||
}
|
||||
};
|
||||
var __await = (this && this.__await) || function (v) { return this instanceof __await ? (this.v = v, this) : new __await(v); }
|
||||
var __asyncGenerator = (this && this.__asyncGenerator) || function (thisArg, _arguments, generator) {
|
||||
if (!Symbol.asyncIterator) throw new TypeError("Symbol.asyncIterator is not defined.");
|
||||
var g = generator.apply(thisArg, _arguments || []), q = [], c, i;
|
||||
return i = { next: verb("next"), "throw": verb("throw"), "return": verb("return") }, i[Symbol.asyncIterator] = function () { return this; }, i;
|
||||
function verb(n) { return function (v) { return new Promise(function (a, b) { q.push([n, v, a, b]), next(); }); }; }
|
||||
function next() { if (!c && q.length) resume((c = q.shift())[0], c[1]); }
|
||||
function resume(n, v) { try { step(g[n](v)); } catch (e) { settle(c[3], e); } }
|
||||
function step(r) { r.done ? settle(c[2], r) : Promise.resolve(r.value[1]).then(r.value[0] === "yield" ? send : fulfill, reject); }
|
||||
function send(value) { settle(c[2], { value: value, done: false }); }
|
||||
var g = generator.apply(thisArg, _arguments || []), i, q = [];
|
||||
return i = {}, verb("next"), verb("throw"), verb("return"), i[Symbol.asyncIterator] = function () { return this; }, i;
|
||||
function verb(n) { if (g[n]) i[n] = function (v) { return new Promise(function (a, b) { q.push([n, v, a, b]) > 1 || resume(n, v); }); }; }
|
||||
function resume(n, v) { try { step(g[n](v)); } catch (e) { settle(q[0][3], e); } }
|
||||
function step(r) { r.value instanceof __await ? Promise.resolve(r.value.v).then(fulfill, reject) : settle(q[0][2], r); }
|
||||
function fulfill(value) { resume("next", value); }
|
||||
function reject(value) { resume("throw", value); }
|
||||
function settle(f, v) { c = void 0, f(v), next(); }
|
||||
function settle(f, v) { if (f(v), q.shift(), q.length) resume(q[0][0], q[0][1]); }
|
||||
};
|
||||
var C8 = (function () {
|
||||
function C8() {
|
||||
@@ -602,18 +596,17 @@ var __generator = (this && this.__generator) || function (thisArg, body) {
|
||||
if (op[0] & 5) throw op[1]; return { value: op[0] ? op[1] : void 0, done: true };
|
||||
}
|
||||
};
|
||||
var __await = (this && this.__await) || function (v) { return this instanceof __await ? (this.v = v, this) : new __await(v); }
|
||||
var __asyncGenerator = (this && this.__asyncGenerator) || function (thisArg, _arguments, generator) {
|
||||
if (!Symbol.asyncIterator) throw new TypeError("Symbol.asyncIterator is not defined.");
|
||||
var g = generator.apply(thisArg, _arguments || []), q = [], c, i;
|
||||
return i = { next: verb("next"), "throw": verb("throw"), "return": verb("return") }, i[Symbol.asyncIterator] = function () { return this; }, i;
|
||||
function verb(n) { return function (v) { return new Promise(function (a, b) { q.push([n, v, a, b]), next(); }); }; }
|
||||
function next() { if (!c && q.length) resume((c = q.shift())[0], c[1]); }
|
||||
function resume(n, v) { try { step(g[n](v)); } catch (e) { settle(c[3], e); } }
|
||||
function step(r) { r.done ? settle(c[2], r) : Promise.resolve(r.value[1]).then(r.value[0] === "yield" ? send : fulfill, reject); }
|
||||
function send(value) { settle(c[2], { value: value, done: false }); }
|
||||
var g = generator.apply(thisArg, _arguments || []), i, q = [];
|
||||
return i = {}, verb("next"), verb("throw"), verb("return"), i[Symbol.asyncIterator] = function () { return this; }, i;
|
||||
function verb(n) { if (g[n]) i[n] = function (v) { return new Promise(function (a, b) { q.push([n, v, a, b]) > 1 || resume(n, v); }); }; }
|
||||
function resume(n, v) { try { step(g[n](v)); } catch (e) { settle(q[0][3], e); } }
|
||||
function step(r) { r.value instanceof __await ? Promise.resolve(r.value.v).then(fulfill, reject) : settle(q[0][2], r); }
|
||||
function fulfill(value) { resume("next", value); }
|
||||
function reject(value) { resume("throw", value); }
|
||||
function settle(f, v) { c = void 0, f(v), next(); }
|
||||
function settle(f, v) { if (f(v), q.shift(), q.length) resume(q[0][0], q[0][1]); }
|
||||
};
|
||||
var B9 = (function () {
|
||||
function B9() {
|
||||
|
||||
@@ -30,151 +30,144 @@ async function * f7() {
|
||||
|
||||
|
||||
//// [F1.js]
|
||||
var __await = (this && this.__await) || function (v) { return this instanceof __await ? (this.v = v, this) : new __await(v); }
|
||||
var __asyncGenerator = (this && this.__asyncGenerator) || function (thisArg, _arguments, generator) {
|
||||
if (!Symbol.asyncIterator) throw new TypeError("Symbol.asyncIterator is not defined.");
|
||||
var g = generator.apply(thisArg, _arguments || []), q = [], c, i;
|
||||
return i = { next: verb("next"), "throw": verb("throw"), "return": verb("return") }, i[Symbol.asyncIterator] = function () { return this; }, i;
|
||||
function verb(n) { return function (v) { return new Promise(function (a, b) { q.push([n, v, a, b]), next(); }); }; }
|
||||
function next() { if (!c && q.length) resume((c = q.shift())[0], c[1]); }
|
||||
function resume(n, v) { try { step(g[n](v)); } catch (e) { settle(c[3], e); } }
|
||||
function step(r) { r.done ? settle(c[2], r) : Promise.resolve(r.value[1]).then(r.value[0] === "yield" ? send : fulfill, reject); }
|
||||
function send(value) { settle(c[2], { value: value, done: false }); }
|
||||
var g = generator.apply(thisArg, _arguments || []), i, q = [];
|
||||
return i = {}, verb("next"), verb("throw"), verb("return"), i[Symbol.asyncIterator] = function () { return this; }, i;
|
||||
function verb(n) { if (g[n]) i[n] = function (v) { return new Promise(function (a, b) { q.push([n, v, a, b]) > 1 || resume(n, v); }); }; }
|
||||
function resume(n, v) { try { step(g[n](v)); } catch (e) { settle(q[0][3], e); } }
|
||||
function step(r) { r.value instanceof __await ? Promise.resolve(r.value.v).then(fulfill, reject) : settle(q[0][2], r); }
|
||||
function fulfill(value) { resume("next", value); }
|
||||
function reject(value) { resume("throw", value); }
|
||||
function settle(f, v) { c = void 0, f(v), next(); }
|
||||
function settle(f, v) { if (f(v), q.shift(), q.length) resume(q[0][0], q[0][1]); }
|
||||
};
|
||||
function f1() {
|
||||
return __asyncGenerator(this, arguments, function* f1_1() {
|
||||
});
|
||||
}
|
||||
//// [F2.js]
|
||||
var __await = (this && this.__await) || function (v) { return this instanceof __await ? (this.v = v, this) : new __await(v); }
|
||||
var __asyncGenerator = (this && this.__asyncGenerator) || function (thisArg, _arguments, generator) {
|
||||
if (!Symbol.asyncIterator) throw new TypeError("Symbol.asyncIterator is not defined.");
|
||||
var g = generator.apply(thisArg, _arguments || []), q = [], c, i;
|
||||
return i = { next: verb("next"), "throw": verb("throw"), "return": verb("return") }, i[Symbol.asyncIterator] = function () { return this; }, i;
|
||||
function verb(n) { return function (v) { return new Promise(function (a, b) { q.push([n, v, a, b]), next(); }); }; }
|
||||
function next() { if (!c && q.length) resume((c = q.shift())[0], c[1]); }
|
||||
function resume(n, v) { try { step(g[n](v)); } catch (e) { settle(c[3], e); } }
|
||||
function step(r) { r.done ? settle(c[2], r) : Promise.resolve(r.value[1]).then(r.value[0] === "yield" ? send : fulfill, reject); }
|
||||
function send(value) { settle(c[2], { value: value, done: false }); }
|
||||
var g = generator.apply(thisArg, _arguments || []), i, q = [];
|
||||
return i = {}, verb("next"), verb("throw"), verb("return"), i[Symbol.asyncIterator] = function () { return this; }, i;
|
||||
function verb(n) { if (g[n]) i[n] = function (v) { return new Promise(function (a, b) { q.push([n, v, a, b]) > 1 || resume(n, v); }); }; }
|
||||
function resume(n, v) { try { step(g[n](v)); } catch (e) { settle(q[0][3], e); } }
|
||||
function step(r) { r.value instanceof __await ? Promise.resolve(r.value.v).then(fulfill, reject) : settle(q[0][2], r); }
|
||||
function fulfill(value) { resume("next", value); }
|
||||
function reject(value) { resume("throw", value); }
|
||||
function settle(f, v) { c = void 0, f(v), next(); }
|
||||
function settle(f, v) { if (f(v), q.shift(), q.length) resume(q[0][0], q[0][1]); }
|
||||
};
|
||||
function f2() {
|
||||
return __asyncGenerator(this, arguments, function* f2_1() {
|
||||
const x = yield ["yield"];
|
||||
const x = yield;
|
||||
});
|
||||
}
|
||||
//// [F3.js]
|
||||
var __await = (this && this.__await) || function (v) { return this instanceof __await ? (this.v = v, this) : new __await(v); }
|
||||
var __asyncGenerator = (this && this.__asyncGenerator) || function (thisArg, _arguments, generator) {
|
||||
if (!Symbol.asyncIterator) throw new TypeError("Symbol.asyncIterator is not defined.");
|
||||
var g = generator.apply(thisArg, _arguments || []), q = [], c, i;
|
||||
return i = { next: verb("next"), "throw": verb("throw"), "return": verb("return") }, i[Symbol.asyncIterator] = function () { return this; }, i;
|
||||
function verb(n) { return function (v) { return new Promise(function (a, b) { q.push([n, v, a, b]), next(); }); }; }
|
||||
function next() { if (!c && q.length) resume((c = q.shift())[0], c[1]); }
|
||||
function resume(n, v) { try { step(g[n](v)); } catch (e) { settle(c[3], e); } }
|
||||
function step(r) { r.done ? settle(c[2], r) : Promise.resolve(r.value[1]).then(r.value[0] === "yield" ? send : fulfill, reject); }
|
||||
function send(value) { settle(c[2], { value: value, done: false }); }
|
||||
var g = generator.apply(thisArg, _arguments || []), i, q = [];
|
||||
return i = {}, verb("next"), verb("throw"), verb("return"), i[Symbol.asyncIterator] = function () { return this; }, i;
|
||||
function verb(n) { if (g[n]) i[n] = function (v) { return new Promise(function (a, b) { q.push([n, v, a, b]) > 1 || resume(n, v); }); }; }
|
||||
function resume(n, v) { try { step(g[n](v)); } catch (e) { settle(q[0][3], e); } }
|
||||
function step(r) { r.value instanceof __await ? Promise.resolve(r.value.v).then(fulfill, reject) : settle(q[0][2], r); }
|
||||
function fulfill(value) { resume("next", value); }
|
||||
function reject(value) { resume("throw", value); }
|
||||
function settle(f, v) { c = void 0, f(v), next(); }
|
||||
function settle(f, v) { if (f(v), q.shift(), q.length) resume(q[0][0], q[0][1]); }
|
||||
};
|
||||
function f3() {
|
||||
return __asyncGenerator(this, arguments, function* f3_1() {
|
||||
const x = yield ["yield", 1];
|
||||
const x = yield 1;
|
||||
});
|
||||
}
|
||||
//// [F4.js]
|
||||
var __asyncDelegator = (this && this.__asyncDelegator) || function (o) {
|
||||
var i = { next: verb("next"), "throw": verb("throw", function (e) { throw e; }), "return": verb("return", function (v) { return { value: v, done: true }; }) }, p;
|
||||
return o = __asyncValues(o), i[Symbol.iterator] = function () { return this; }, i;
|
||||
function verb(n, f) { return function (v) { return v = p && n === "throw" ? f(v) : p && v.done ? v : { value: p ? ["yield", v.value] : ["await", (o[n] || f).call(o, v)], done: false }, p = !p, v; }; }
|
||||
};
|
||||
var __asyncValues = (this && this.__asyncIterator) || function (o) {
|
||||
if (!Symbol.asyncIterator) throw new TypeError("Symbol.asyncIterator is not defined.");
|
||||
var m = o[Symbol.asyncIterator];
|
||||
return m ? m.call(o) : typeof __values === "function" ? __values(o) : o[Symbol.iterator]();
|
||||
};
|
||||
var __await = (this && this.__await) || function (v) { return this instanceof __await ? (this.v = v, this) : new __await(v); }
|
||||
var __asyncDelegator = (this && this.__asyncDelegator) || function (o) {
|
||||
var i, p;
|
||||
return i = {}, verb("next"), verb("throw", function (e) { throw e; }), verb("return"), i[Symbol.iterator] = function () { return this; }, i;
|
||||
function verb(n, f) { if (o[n]) i[n] = function (v) { return (p = !p) ? { value: __await(o[n](v)), done: n === "return" } : f ? f(v) : v; }; }
|
||||
};
|
||||
var __asyncGenerator = (this && this.__asyncGenerator) || function (thisArg, _arguments, generator) {
|
||||
if (!Symbol.asyncIterator) throw new TypeError("Symbol.asyncIterator is not defined.");
|
||||
var g = generator.apply(thisArg, _arguments || []), q = [], c, i;
|
||||
return i = { next: verb("next"), "throw": verb("throw"), "return": verb("return") }, i[Symbol.asyncIterator] = function () { return this; }, i;
|
||||
function verb(n) { return function (v) { return new Promise(function (a, b) { q.push([n, v, a, b]), next(); }); }; }
|
||||
function next() { if (!c && q.length) resume((c = q.shift())[0], c[1]); }
|
||||
function resume(n, v) { try { step(g[n](v)); } catch (e) { settle(c[3], e); } }
|
||||
function step(r) { r.done ? settle(c[2], r) : Promise.resolve(r.value[1]).then(r.value[0] === "yield" ? send : fulfill, reject); }
|
||||
function send(value) { settle(c[2], { value: value, done: false }); }
|
||||
var g = generator.apply(thisArg, _arguments || []), i, q = [];
|
||||
return i = {}, verb("next"), verb("throw"), verb("return"), i[Symbol.asyncIterator] = function () { return this; }, i;
|
||||
function verb(n) { if (g[n]) i[n] = function (v) { return new Promise(function (a, b) { q.push([n, v, a, b]) > 1 || resume(n, v); }); }; }
|
||||
function resume(n, v) { try { step(g[n](v)); } catch (e) { settle(q[0][3], e); } }
|
||||
function step(r) { r.value instanceof __await ? Promise.resolve(r.value.v).then(fulfill, reject) : settle(q[0][2], r); }
|
||||
function fulfill(value) { resume("next", value); }
|
||||
function reject(value) { resume("throw", value); }
|
||||
function settle(f, v) { c = void 0, f(v), next(); }
|
||||
function settle(f, v) { if (f(v), q.shift(), q.length) resume(q[0][0], q[0][1]); }
|
||||
};
|
||||
function f4() {
|
||||
return __asyncGenerator(this, arguments, function* f4_1() {
|
||||
const x = yield* __asyncDelegator([1]);
|
||||
const x = yield __await(yield* __asyncDelegator(__asyncValues([1])));
|
||||
});
|
||||
}
|
||||
//// [F5.js]
|
||||
var __await = (this && this.__await) || function (v) { return this instanceof __await ? (this.v = v, this) : new __await(v); }
|
||||
var __asyncGenerator = (this && this.__asyncGenerator) || function (thisArg, _arguments, generator) {
|
||||
if (!Symbol.asyncIterator) throw new TypeError("Symbol.asyncIterator is not defined.");
|
||||
var g = generator.apply(thisArg, _arguments || []), q = [], c, i;
|
||||
return i = { next: verb("next"), "throw": verb("throw"), "return": verb("return") }, i[Symbol.asyncIterator] = function () { return this; }, i;
|
||||
function verb(n) { return function (v) { return new Promise(function (a, b) { q.push([n, v, a, b]), next(); }); }; }
|
||||
function next() { if (!c && q.length) resume((c = q.shift())[0], c[1]); }
|
||||
function resume(n, v) { try { step(g[n](v)); } catch (e) { settle(c[3], e); } }
|
||||
function step(r) { r.done ? settle(c[2], r) : Promise.resolve(r.value[1]).then(r.value[0] === "yield" ? send : fulfill, reject); }
|
||||
function send(value) { settle(c[2], { value: value, done: false }); }
|
||||
var g = generator.apply(thisArg, _arguments || []), i, q = [];
|
||||
return i = {}, verb("next"), verb("throw"), verb("return"), i[Symbol.asyncIterator] = function () { return this; }, i;
|
||||
function verb(n) { if (g[n]) i[n] = function (v) { return new Promise(function (a, b) { q.push([n, v, a, b]) > 1 || resume(n, v); }); }; }
|
||||
function resume(n, v) { try { step(g[n](v)); } catch (e) { settle(q[0][3], e); } }
|
||||
function step(r) { r.value instanceof __await ? Promise.resolve(r.value.v).then(fulfill, reject) : settle(q[0][2], r); }
|
||||
function fulfill(value) { resume("next", value); }
|
||||
function reject(value) { resume("throw", value); }
|
||||
function settle(f, v) { c = void 0, f(v), next(); }
|
||||
};
|
||||
var __asyncDelegator = (this && this.__asyncDelegator) || function (o) {
|
||||
var i = { next: verb("next"), "throw": verb("throw", function (e) { throw e; }), "return": verb("return", function (v) { return { value: v, done: true }; }) }, p;
|
||||
return o = __asyncValues(o), i[Symbol.iterator] = function () { return this; }, i;
|
||||
function verb(n, f) { return function (v) { return v = p && n === "throw" ? f(v) : p && v.done ? v : { value: p ? ["yield", v.value] : ["await", (o[n] || f).call(o, v)], done: false }, p = !p, v; }; }
|
||||
function settle(f, v) { if (f(v), q.shift(), q.length) resume(q[0][0], q[0][1]); }
|
||||
};
|
||||
var __asyncValues = (this && this.__asyncIterator) || function (o) {
|
||||
if (!Symbol.asyncIterator) throw new TypeError("Symbol.asyncIterator is not defined.");
|
||||
var m = o[Symbol.asyncIterator];
|
||||
return m ? m.call(o) : typeof __values === "function" ? __values(o) : o[Symbol.iterator]();
|
||||
};
|
||||
var __asyncDelegator = (this && this.__asyncDelegator) || function (o) {
|
||||
var i, p;
|
||||
return i = {}, verb("next"), verb("throw", function (e) { throw e; }), verb("return"), i[Symbol.iterator] = function () { return this; }, i;
|
||||
function verb(n, f) { if (o[n]) i[n] = function (v) { return (p = !p) ? { value: __await(o[n](v)), done: n === "return" } : f ? f(v) : v; }; }
|
||||
};
|
||||
function f5() {
|
||||
return __asyncGenerator(this, arguments, function* f5_1() {
|
||||
const x = yield* __asyncDelegator((function () { return __asyncGenerator(this, arguments, function* () { yield ["yield", 1]; }); })());
|
||||
const x = yield __await(yield* __asyncDelegator(__asyncValues((function () { return __asyncGenerator(this, arguments, function* () { yield 1; }); })())));
|
||||
});
|
||||
}
|
||||
//// [F6.js]
|
||||
var __await = (this && this.__await) || function (v) { return this instanceof __await ? (this.v = v, this) : new __await(v); }
|
||||
var __asyncGenerator = (this && this.__asyncGenerator) || function (thisArg, _arguments, generator) {
|
||||
if (!Symbol.asyncIterator) throw new TypeError("Symbol.asyncIterator is not defined.");
|
||||
var g = generator.apply(thisArg, _arguments || []), q = [], c, i;
|
||||
return i = { next: verb("next"), "throw": verb("throw"), "return": verb("return") }, i[Symbol.asyncIterator] = function () { return this; }, i;
|
||||
function verb(n) { return function (v) { return new Promise(function (a, b) { q.push([n, v, a, b]), next(); }); }; }
|
||||
function next() { if (!c && q.length) resume((c = q.shift())[0], c[1]); }
|
||||
function resume(n, v) { try { step(g[n](v)); } catch (e) { settle(c[3], e); } }
|
||||
function step(r) { r.done ? settle(c[2], r) : Promise.resolve(r.value[1]).then(r.value[0] === "yield" ? send : fulfill, reject); }
|
||||
function send(value) { settle(c[2], { value: value, done: false }); }
|
||||
var g = generator.apply(thisArg, _arguments || []), i, q = [];
|
||||
return i = {}, verb("next"), verb("throw"), verb("return"), i[Symbol.asyncIterator] = function () { return this; }, i;
|
||||
function verb(n) { if (g[n]) i[n] = function (v) { return new Promise(function (a, b) { q.push([n, v, a, b]) > 1 || resume(n, v); }); }; }
|
||||
function resume(n, v) { try { step(g[n](v)); } catch (e) { settle(q[0][3], e); } }
|
||||
function step(r) { r.value instanceof __await ? Promise.resolve(r.value.v).then(fulfill, reject) : settle(q[0][2], r); }
|
||||
function fulfill(value) { resume("next", value); }
|
||||
function reject(value) { resume("throw", value); }
|
||||
function settle(f, v) { c = void 0, f(v), next(); }
|
||||
function settle(f, v) { if (f(v), q.shift(), q.length) resume(q[0][0], q[0][1]); }
|
||||
};
|
||||
function f6() {
|
||||
return __asyncGenerator(this, arguments, function* f6_1() {
|
||||
const x = yield ["await", 1];
|
||||
const x = yield __await(1);
|
||||
});
|
||||
}
|
||||
//// [F7.js]
|
||||
var __await = (this && this.__await) || function (v) { return this instanceof __await ? (this.v = v, this) : new __await(v); }
|
||||
var __asyncGenerator = (this && this.__asyncGenerator) || function (thisArg, _arguments, generator) {
|
||||
if (!Symbol.asyncIterator) throw new TypeError("Symbol.asyncIterator is not defined.");
|
||||
var g = generator.apply(thisArg, _arguments || []), q = [], c, i;
|
||||
return i = { next: verb("next"), "throw": verb("throw"), "return": verb("return") }, i[Symbol.asyncIterator] = function () { return this; }, i;
|
||||
function verb(n) { return function (v) { return new Promise(function (a, b) { q.push([n, v, a, b]), next(); }); }; }
|
||||
function next() { if (!c && q.length) resume((c = q.shift())[0], c[1]); }
|
||||
function resume(n, v) { try { step(g[n](v)); } catch (e) { settle(c[3], e); } }
|
||||
function step(r) { r.done ? settle(c[2], r) : Promise.resolve(r.value[1]).then(r.value[0] === "yield" ? send : fulfill, reject); }
|
||||
function send(value) { settle(c[2], { value: value, done: false }); }
|
||||
var g = generator.apply(thisArg, _arguments || []), i, q = [];
|
||||
return i = {}, verb("next"), verb("throw"), verb("return"), i[Symbol.asyncIterator] = function () { return this; }, i;
|
||||
function verb(n) { if (g[n]) i[n] = function (v) { return new Promise(function (a, b) { q.push([n, v, a, b]) > 1 || resume(n, v); }); }; }
|
||||
function resume(n, v) { try { step(g[n](v)); } catch (e) { settle(q[0][3], e); } }
|
||||
function step(r) { r.value instanceof __await ? Promise.resolve(r.value.v).then(fulfill, reject) : settle(q[0][2], r); }
|
||||
function fulfill(value) { resume("next", value); }
|
||||
function reject(value) { resume("throw", value); }
|
||||
function settle(f, v) { c = void 0, f(v), next(); }
|
||||
function settle(f, v) { if (f(v), q.shift(), q.length) resume(q[0][0], q[0][1]); }
|
||||
};
|
||||
function f7() {
|
||||
return __asyncGenerator(this, arguments, function* f7_1() {
|
||||
|
||||
@@ -57,18 +57,17 @@ var __generator = (this && this.__generator) || function (thisArg, body) {
|
||||
if (op[0] & 5) throw op[1]; return { value: op[0] ? op[1] : void 0, done: true };
|
||||
}
|
||||
};
|
||||
var __await = (this && this.__await) || function (v) { return this instanceof __await ? (this.v = v, this) : new __await(v); }
|
||||
var __asyncGenerator = (this && this.__asyncGenerator) || function (thisArg, _arguments, generator) {
|
||||
if (!Symbol.asyncIterator) throw new TypeError("Symbol.asyncIterator is not defined.");
|
||||
var g = generator.apply(thisArg, _arguments || []), q = [], c, i;
|
||||
return i = { next: verb("next"), "throw": verb("throw"), "return": verb("return") }, i[Symbol.asyncIterator] = function () { return this; }, i;
|
||||
function verb(n) { return function (v) { return new Promise(function (a, b) { q.push([n, v, a, b]), next(); }); }; }
|
||||
function next() { if (!c && q.length) resume((c = q.shift())[0], c[1]); }
|
||||
function resume(n, v) { try { step(g[n](v)); } catch (e) { settle(c[3], e); } }
|
||||
function step(r) { r.done ? settle(c[2], r) : Promise.resolve(r.value[1]).then(r.value[0] === "yield" ? send : fulfill, reject); }
|
||||
function send(value) { settle(c[2], { value: value, done: false }); }
|
||||
var g = generator.apply(thisArg, _arguments || []), i, q = [];
|
||||
return i = {}, verb("next"), verb("throw"), verb("return"), i[Symbol.asyncIterator] = function () { return this; }, i;
|
||||
function verb(n) { if (g[n]) i[n] = function (v) { return new Promise(function (a, b) { q.push([n, v, a, b]) > 1 || resume(n, v); }); }; }
|
||||
function resume(n, v) { try { step(g[n](v)); } catch (e) { settle(q[0][3], e); } }
|
||||
function step(r) { r.value instanceof __await ? Promise.resolve(r.value.v).then(fulfill, reject) : settle(q[0][2], r); }
|
||||
function fulfill(value) { resume("next", value); }
|
||||
function reject(value) { resume("throw", value); }
|
||||
function settle(f, v) { c = void 0, f(v), next(); }
|
||||
function settle(f, v) { if (f(v), q.shift(), q.length) resume(q[0][0], q[0][1]); }
|
||||
};
|
||||
function f1() {
|
||||
return __asyncGenerator(this, arguments, function f1_1() {
|
||||
@@ -105,25 +104,24 @@ var __generator = (this && this.__generator) || function (thisArg, body) {
|
||||
if (op[0] & 5) throw op[1]; return { value: op[0] ? op[1] : void 0, done: true };
|
||||
}
|
||||
};
|
||||
var __await = (this && this.__await) || function (v) { return this instanceof __await ? (this.v = v, this) : new __await(v); }
|
||||
var __asyncGenerator = (this && this.__asyncGenerator) || function (thisArg, _arguments, generator) {
|
||||
if (!Symbol.asyncIterator) throw new TypeError("Symbol.asyncIterator is not defined.");
|
||||
var g = generator.apply(thisArg, _arguments || []), q = [], c, i;
|
||||
return i = { next: verb("next"), "throw": verb("throw"), "return": verb("return") }, i[Symbol.asyncIterator] = function () { return this; }, i;
|
||||
function verb(n) { return function (v) { return new Promise(function (a, b) { q.push([n, v, a, b]), next(); }); }; }
|
||||
function next() { if (!c && q.length) resume((c = q.shift())[0], c[1]); }
|
||||
function resume(n, v) { try { step(g[n](v)); } catch (e) { settle(c[3], e); } }
|
||||
function step(r) { r.done ? settle(c[2], r) : Promise.resolve(r.value[1]).then(r.value[0] === "yield" ? send : fulfill, reject); }
|
||||
function send(value) { settle(c[2], { value: value, done: false }); }
|
||||
var g = generator.apply(thisArg, _arguments || []), i, q = [];
|
||||
return i = {}, verb("next"), verb("throw"), verb("return"), i[Symbol.asyncIterator] = function () { return this; }, i;
|
||||
function verb(n) { if (g[n]) i[n] = function (v) { return new Promise(function (a, b) { q.push([n, v, a, b]) > 1 || resume(n, v); }); }; }
|
||||
function resume(n, v) { try { step(g[n](v)); } catch (e) { settle(q[0][3], e); } }
|
||||
function step(r) { r.value instanceof __await ? Promise.resolve(r.value.v).then(fulfill, reject) : settle(q[0][2], r); }
|
||||
function fulfill(value) { resume("next", value); }
|
||||
function reject(value) { resume("throw", value); }
|
||||
function settle(f, v) { c = void 0, f(v), next(); }
|
||||
function settle(f, v) { if (f(v), q.shift(), q.length) resume(q[0][0], q[0][1]); }
|
||||
};
|
||||
function f2() {
|
||||
return __asyncGenerator(this, arguments, function f2_1() {
|
||||
var x;
|
||||
return __generator(this, function (_a) {
|
||||
switch (_a.label) {
|
||||
case 0: return [4 /*yield*/, ["yield"]];
|
||||
case 0: return [4 /*yield*/];
|
||||
case 1:
|
||||
x = _a.sent();
|
||||
return [2 /*return*/];
|
||||
@@ -159,25 +157,24 @@ var __generator = (this && this.__generator) || function (thisArg, body) {
|
||||
if (op[0] & 5) throw op[1]; return { value: op[0] ? op[1] : void 0, done: true };
|
||||
}
|
||||
};
|
||||
var __await = (this && this.__await) || function (v) { return this instanceof __await ? (this.v = v, this) : new __await(v); }
|
||||
var __asyncGenerator = (this && this.__asyncGenerator) || function (thisArg, _arguments, generator) {
|
||||
if (!Symbol.asyncIterator) throw new TypeError("Symbol.asyncIterator is not defined.");
|
||||
var g = generator.apply(thisArg, _arguments || []), q = [], c, i;
|
||||
return i = { next: verb("next"), "throw": verb("throw"), "return": verb("return") }, i[Symbol.asyncIterator] = function () { return this; }, i;
|
||||
function verb(n) { return function (v) { return new Promise(function (a, b) { q.push([n, v, a, b]), next(); }); }; }
|
||||
function next() { if (!c && q.length) resume((c = q.shift())[0], c[1]); }
|
||||
function resume(n, v) { try { step(g[n](v)); } catch (e) { settle(c[3], e); } }
|
||||
function step(r) { r.done ? settle(c[2], r) : Promise.resolve(r.value[1]).then(r.value[0] === "yield" ? send : fulfill, reject); }
|
||||
function send(value) { settle(c[2], { value: value, done: false }); }
|
||||
var g = generator.apply(thisArg, _arguments || []), i, q = [];
|
||||
return i = {}, verb("next"), verb("throw"), verb("return"), i[Symbol.asyncIterator] = function () { return this; }, i;
|
||||
function verb(n) { if (g[n]) i[n] = function (v) { return new Promise(function (a, b) { q.push([n, v, a, b]) > 1 || resume(n, v); }); }; }
|
||||
function resume(n, v) { try { step(g[n](v)); } catch (e) { settle(q[0][3], e); } }
|
||||
function step(r) { r.value instanceof __await ? Promise.resolve(r.value.v).then(fulfill, reject) : settle(q[0][2], r); }
|
||||
function fulfill(value) { resume("next", value); }
|
||||
function reject(value) { resume("throw", value); }
|
||||
function settle(f, v) { c = void 0, f(v), next(); }
|
||||
function settle(f, v) { if (f(v), q.shift(), q.length) resume(q[0][0], q[0][1]); }
|
||||
};
|
||||
function f3() {
|
||||
return __asyncGenerator(this, arguments, function f3_1() {
|
||||
var x;
|
||||
return __generator(this, function (_a) {
|
||||
switch (_a.label) {
|
||||
case 0: return [4 /*yield*/, ["yield", 1]];
|
||||
case 0: return [4 /*yield*/, 1];
|
||||
case 1:
|
||||
x = _a.sent();
|
||||
return [2 /*return*/];
|
||||
@@ -213,28 +210,27 @@ var __generator = (this && this.__generator) || function (thisArg, body) {
|
||||
if (op[0] & 5) throw op[1]; return { value: op[0] ? op[1] : void 0, done: true };
|
||||
}
|
||||
};
|
||||
var __asyncDelegator = (this && this.__asyncDelegator) || function (o) {
|
||||
var i = { next: verb("next"), "throw": verb("throw", function (e) { throw e; }), "return": verb("return", function (v) { return { value: v, done: true }; }) }, p;
|
||||
return o = __asyncValues(o), i[Symbol.iterator] = function () { return this; }, i;
|
||||
function verb(n, f) { return function (v) { return v = p && n === "throw" ? f(v) : p && v.done ? v : { value: p ? ["yield", v.value] : ["await", (o[n] || f).call(o, v)], done: false }, p = !p, v; }; }
|
||||
};
|
||||
var __asyncValues = (this && this.__asyncIterator) || function (o) {
|
||||
if (!Symbol.asyncIterator) throw new TypeError("Symbol.asyncIterator is not defined.");
|
||||
var m = o[Symbol.asyncIterator];
|
||||
return m ? m.call(o) : typeof __values === "function" ? __values(o) : o[Symbol.iterator]();
|
||||
};
|
||||
var __await = (this && this.__await) || function (v) { return this instanceof __await ? (this.v = v, this) : new __await(v); }
|
||||
var __asyncDelegator = (this && this.__asyncDelegator) || function (o) {
|
||||
var i, p;
|
||||
return i = {}, verb("next"), verb("throw", function (e) { throw e; }), verb("return"), i[Symbol.iterator] = function () { return this; }, i;
|
||||
function verb(n, f) { if (o[n]) i[n] = function (v) { return (p = !p) ? { value: __await(o[n](v)), done: n === "return" } : f ? f(v) : v; }; }
|
||||
};
|
||||
var __asyncGenerator = (this && this.__asyncGenerator) || function (thisArg, _arguments, generator) {
|
||||
if (!Symbol.asyncIterator) throw new TypeError("Symbol.asyncIterator is not defined.");
|
||||
var g = generator.apply(thisArg, _arguments || []), q = [], c, i;
|
||||
return i = { next: verb("next"), "throw": verb("throw"), "return": verb("return") }, i[Symbol.asyncIterator] = function () { return this; }, i;
|
||||
function verb(n) { return function (v) { return new Promise(function (a, b) { q.push([n, v, a, b]), next(); }); }; }
|
||||
function next() { if (!c && q.length) resume((c = q.shift())[0], c[1]); }
|
||||
function resume(n, v) { try { step(g[n](v)); } catch (e) { settle(c[3], e); } }
|
||||
function step(r) { r.done ? settle(c[2], r) : Promise.resolve(r.value[1]).then(r.value[0] === "yield" ? send : fulfill, reject); }
|
||||
function send(value) { settle(c[2], { value: value, done: false }); }
|
||||
var g = generator.apply(thisArg, _arguments || []), i, q = [];
|
||||
return i = {}, verb("next"), verb("throw"), verb("return"), i[Symbol.asyncIterator] = function () { return this; }, i;
|
||||
function verb(n) { if (g[n]) i[n] = function (v) { return new Promise(function (a, b) { q.push([n, v, a, b]) > 1 || resume(n, v); }); }; }
|
||||
function resume(n, v) { try { step(g[n](v)); } catch (e) { settle(q[0][3], e); } }
|
||||
function step(r) { r.value instanceof __await ? Promise.resolve(r.value.v).then(fulfill, reject) : settle(q[0][2], r); }
|
||||
function fulfill(value) { resume("next", value); }
|
||||
function reject(value) { resume("throw", value); }
|
||||
function settle(f, v) { c = void 0, f(v), next(); }
|
||||
function settle(f, v) { if (f(v), q.shift(), q.length) resume(q[0][0], q[0][1]); }
|
||||
};
|
||||
var __values = (this && this.__values) || function (o) {
|
||||
var m = typeof Symbol === "function" && o[Symbol.iterator], i = 0;
|
||||
@@ -251,8 +247,9 @@ function f4() {
|
||||
var x;
|
||||
return __generator(this, function (_a) {
|
||||
switch (_a.label) {
|
||||
case 0: return [5 /*yield**/, __values(__asyncDelegator([1]))];
|
||||
case 1:
|
||||
case 0: return [5 /*yield**/, __values(__asyncDelegator(__asyncValues([1])))];
|
||||
case 1: return [4 /*yield*/, __await.apply(void 0, [_a.sent()])];
|
||||
case 2:
|
||||
x = _a.sent();
|
||||
return [2 /*return*/];
|
||||
}
|
||||
@@ -287,29 +284,28 @@ var __generator = (this && this.__generator) || function (thisArg, body) {
|
||||
if (op[0] & 5) throw op[1]; return { value: op[0] ? op[1] : void 0, done: true };
|
||||
}
|
||||
};
|
||||
var __await = (this && this.__await) || function (v) { return this instanceof __await ? (this.v = v, this) : new __await(v); }
|
||||
var __asyncGenerator = (this && this.__asyncGenerator) || function (thisArg, _arguments, generator) {
|
||||
if (!Symbol.asyncIterator) throw new TypeError("Symbol.asyncIterator is not defined.");
|
||||
var g = generator.apply(thisArg, _arguments || []), q = [], c, i;
|
||||
return i = { next: verb("next"), "throw": verb("throw"), "return": verb("return") }, i[Symbol.asyncIterator] = function () { return this; }, i;
|
||||
function verb(n) { return function (v) { return new Promise(function (a, b) { q.push([n, v, a, b]), next(); }); }; }
|
||||
function next() { if (!c && q.length) resume((c = q.shift())[0], c[1]); }
|
||||
function resume(n, v) { try { step(g[n](v)); } catch (e) { settle(c[3], e); } }
|
||||
function step(r) { r.done ? settle(c[2], r) : Promise.resolve(r.value[1]).then(r.value[0] === "yield" ? send : fulfill, reject); }
|
||||
function send(value) { settle(c[2], { value: value, done: false }); }
|
||||
var g = generator.apply(thisArg, _arguments || []), i, q = [];
|
||||
return i = {}, verb("next"), verb("throw"), verb("return"), i[Symbol.asyncIterator] = function () { return this; }, i;
|
||||
function verb(n) { if (g[n]) i[n] = function (v) { return new Promise(function (a, b) { q.push([n, v, a, b]) > 1 || resume(n, v); }); }; }
|
||||
function resume(n, v) { try { step(g[n](v)); } catch (e) { settle(q[0][3], e); } }
|
||||
function step(r) { r.value instanceof __await ? Promise.resolve(r.value.v).then(fulfill, reject) : settle(q[0][2], r); }
|
||||
function fulfill(value) { resume("next", value); }
|
||||
function reject(value) { resume("throw", value); }
|
||||
function settle(f, v) { c = void 0, f(v), next(); }
|
||||
};
|
||||
var __asyncDelegator = (this && this.__asyncDelegator) || function (o) {
|
||||
var i = { next: verb("next"), "throw": verb("throw", function (e) { throw e; }), "return": verb("return", function (v) { return { value: v, done: true }; }) }, p;
|
||||
return o = __asyncValues(o), i[Symbol.iterator] = function () { return this; }, i;
|
||||
function verb(n, f) { return function (v) { return v = p && n === "throw" ? f(v) : p && v.done ? v : { value: p ? ["yield", v.value] : ["await", (o[n] || f).call(o, v)], done: false }, p = !p, v; }; }
|
||||
function settle(f, v) { if (f(v), q.shift(), q.length) resume(q[0][0], q[0][1]); }
|
||||
};
|
||||
var __asyncValues = (this && this.__asyncIterator) || function (o) {
|
||||
if (!Symbol.asyncIterator) throw new TypeError("Symbol.asyncIterator is not defined.");
|
||||
var m = o[Symbol.asyncIterator];
|
||||
return m ? m.call(o) : typeof __values === "function" ? __values(o) : o[Symbol.iterator]();
|
||||
};
|
||||
var __asyncDelegator = (this && this.__asyncDelegator) || function (o) {
|
||||
var i, p;
|
||||
return i = {}, verb("next"), verb("throw", function (e) { throw e; }), verb("return"), i[Symbol.iterator] = function () { return this; }, i;
|
||||
function verb(n, f) { if (o[n]) i[n] = function (v) { return (p = !p) ? { value: __await(o[n](v)), done: n === "return" } : f ? f(v) : v; }; }
|
||||
};
|
||||
var __values = (this && this.__values) || function (o) {
|
||||
var m = typeof Symbol === "function" && o[Symbol.iterator], i = 0;
|
||||
if (m) return m.call(o);
|
||||
@@ -325,15 +321,16 @@ function f5() {
|
||||
var x;
|
||||
return __generator(this, function (_a) {
|
||||
switch (_a.label) {
|
||||
case 0: return [5 /*yield**/, __values(__asyncDelegator((function () { return __asyncGenerator(this, arguments, function () { return __generator(this, function (_a) {
|
||||
case 0: return [5 /*yield**/, __values(__asyncDelegator(__asyncValues((function () { return __asyncGenerator(this, arguments, function () { return __generator(this, function (_a) {
|
||||
switch (_a.label) {
|
||||
case 0: return [4 /*yield*/, ["yield", 1]];
|
||||
case 0: return [4 /*yield*/, 1];
|
||||
case 1:
|
||||
_a.sent();
|
||||
return [2 /*return*/];
|
||||
}
|
||||
}); }); })()))];
|
||||
case 1:
|
||||
}); }); })())))];
|
||||
case 1: return [4 /*yield*/, __await.apply(void 0, [_a.sent()])];
|
||||
case 2:
|
||||
x = _a.sent();
|
||||
return [2 /*return*/];
|
||||
}
|
||||
@@ -368,25 +365,24 @@ var __generator = (this && this.__generator) || function (thisArg, body) {
|
||||
if (op[0] & 5) throw op[1]; return { value: op[0] ? op[1] : void 0, done: true };
|
||||
}
|
||||
};
|
||||
var __await = (this && this.__await) || function (v) { return this instanceof __await ? (this.v = v, this) : new __await(v); }
|
||||
var __asyncGenerator = (this && this.__asyncGenerator) || function (thisArg, _arguments, generator) {
|
||||
if (!Symbol.asyncIterator) throw new TypeError("Symbol.asyncIterator is not defined.");
|
||||
var g = generator.apply(thisArg, _arguments || []), q = [], c, i;
|
||||
return i = { next: verb("next"), "throw": verb("throw"), "return": verb("return") }, i[Symbol.asyncIterator] = function () { return this; }, i;
|
||||
function verb(n) { return function (v) { return new Promise(function (a, b) { q.push([n, v, a, b]), next(); }); }; }
|
||||
function next() { if (!c && q.length) resume((c = q.shift())[0], c[1]); }
|
||||
function resume(n, v) { try { step(g[n](v)); } catch (e) { settle(c[3], e); } }
|
||||
function step(r) { r.done ? settle(c[2], r) : Promise.resolve(r.value[1]).then(r.value[0] === "yield" ? send : fulfill, reject); }
|
||||
function send(value) { settle(c[2], { value: value, done: false }); }
|
||||
var g = generator.apply(thisArg, _arguments || []), i, q = [];
|
||||
return i = {}, verb("next"), verb("throw"), verb("return"), i[Symbol.asyncIterator] = function () { return this; }, i;
|
||||
function verb(n) { if (g[n]) i[n] = function (v) { return new Promise(function (a, b) { q.push([n, v, a, b]) > 1 || resume(n, v); }); }; }
|
||||
function resume(n, v) { try { step(g[n](v)); } catch (e) { settle(q[0][3], e); } }
|
||||
function step(r) { r.value instanceof __await ? Promise.resolve(r.value.v).then(fulfill, reject) : settle(q[0][2], r); }
|
||||
function fulfill(value) { resume("next", value); }
|
||||
function reject(value) { resume("throw", value); }
|
||||
function settle(f, v) { c = void 0, f(v), next(); }
|
||||
function settle(f, v) { if (f(v), q.shift(), q.length) resume(q[0][0], q[0][1]); }
|
||||
};
|
||||
function f6() {
|
||||
return __asyncGenerator(this, arguments, function f6_1() {
|
||||
var x;
|
||||
return __generator(this, function (_a) {
|
||||
switch (_a.label) {
|
||||
case 0: return [4 /*yield*/, ["await", 1]];
|
||||
case 0: return [4 /*yield*/, __await(1)];
|
||||
case 1:
|
||||
x = _a.sent();
|
||||
return [2 /*return*/];
|
||||
@@ -422,18 +418,17 @@ var __generator = (this && this.__generator) || function (thisArg, body) {
|
||||
if (op[0] & 5) throw op[1]; return { value: op[0] ? op[1] : void 0, done: true };
|
||||
}
|
||||
};
|
||||
var __await = (this && this.__await) || function (v) { return this instanceof __await ? (this.v = v, this) : new __await(v); }
|
||||
var __asyncGenerator = (this && this.__asyncGenerator) || function (thisArg, _arguments, generator) {
|
||||
if (!Symbol.asyncIterator) throw new TypeError("Symbol.asyncIterator is not defined.");
|
||||
var g = generator.apply(thisArg, _arguments || []), q = [], c, i;
|
||||
return i = { next: verb("next"), "throw": verb("throw"), "return": verb("return") }, i[Symbol.asyncIterator] = function () { return this; }, i;
|
||||
function verb(n) { return function (v) { return new Promise(function (a, b) { q.push([n, v, a, b]), next(); }); }; }
|
||||
function next() { if (!c && q.length) resume((c = q.shift())[0], c[1]); }
|
||||
function resume(n, v) { try { step(g[n](v)); } catch (e) { settle(c[3], e); } }
|
||||
function step(r) { r.done ? settle(c[2], r) : Promise.resolve(r.value[1]).then(r.value[0] === "yield" ? send : fulfill, reject); }
|
||||
function send(value) { settle(c[2], { value: value, done: false }); }
|
||||
var g = generator.apply(thisArg, _arguments || []), i, q = [];
|
||||
return i = {}, verb("next"), verb("throw"), verb("return"), i[Symbol.asyncIterator] = function () { return this; }, i;
|
||||
function verb(n) { if (g[n]) i[n] = function (v) { return new Promise(function (a, b) { q.push([n, v, a, b]) > 1 || resume(n, v); }); }; }
|
||||
function resume(n, v) { try { step(g[n](v)); } catch (e) { settle(q[0][3], e); } }
|
||||
function step(r) { r.value instanceof __await ? Promise.resolve(r.value.v).then(fulfill, reject) : settle(q[0][2], r); }
|
||||
function fulfill(value) { resume("next", value); }
|
||||
function reject(value) { resume("throw", value); }
|
||||
function settle(f, v) { c = void 0, f(v), next(); }
|
||||
function settle(f, v) { if (f(v), q.shift(), q.length) resume(q[0][0], q[0][1]); }
|
||||
};
|
||||
function f7() {
|
||||
return __asyncGenerator(this, arguments, function f7_1() {
|
||||
|
||||
@@ -30,151 +30,144 @@ const f7 = async function * () {
|
||||
|
||||
|
||||
//// [F1.js]
|
||||
var __await = (this && this.__await) || function (v) { return this instanceof __await ? (this.v = v, this) : new __await(v); }
|
||||
var __asyncGenerator = (this && this.__asyncGenerator) || function (thisArg, _arguments, generator) {
|
||||
if (!Symbol.asyncIterator) throw new TypeError("Symbol.asyncIterator is not defined.");
|
||||
var g = generator.apply(thisArg, _arguments || []), q = [], c, i;
|
||||
return i = { next: verb("next"), "throw": verb("throw"), "return": verb("return") }, i[Symbol.asyncIterator] = function () { return this; }, i;
|
||||
function verb(n) { return function (v) { return new Promise(function (a, b) { q.push([n, v, a, b]), next(); }); }; }
|
||||
function next() { if (!c && q.length) resume((c = q.shift())[0], c[1]); }
|
||||
function resume(n, v) { try { step(g[n](v)); } catch (e) { settle(c[3], e); } }
|
||||
function step(r) { r.done ? settle(c[2], r) : Promise.resolve(r.value[1]).then(r.value[0] === "yield" ? send : fulfill, reject); }
|
||||
function send(value) { settle(c[2], { value: value, done: false }); }
|
||||
var g = generator.apply(thisArg, _arguments || []), i, q = [];
|
||||
return i = {}, verb("next"), verb("throw"), verb("return"), i[Symbol.asyncIterator] = function () { return this; }, i;
|
||||
function verb(n) { if (g[n]) i[n] = function (v) { return new Promise(function (a, b) { q.push([n, v, a, b]) > 1 || resume(n, v); }); }; }
|
||||
function resume(n, v) { try { step(g[n](v)); } catch (e) { settle(q[0][3], e); } }
|
||||
function step(r) { r.value instanceof __await ? Promise.resolve(r.value.v).then(fulfill, reject) : settle(q[0][2], r); }
|
||||
function fulfill(value) { resume("next", value); }
|
||||
function reject(value) { resume("throw", value); }
|
||||
function settle(f, v) { c = void 0, f(v), next(); }
|
||||
function settle(f, v) { if (f(v), q.shift(), q.length) resume(q[0][0], q[0][1]); }
|
||||
};
|
||||
const f1 = function () {
|
||||
return __asyncGenerator(this, arguments, function* () {
|
||||
});
|
||||
};
|
||||
//// [F2.js]
|
||||
var __await = (this && this.__await) || function (v) { return this instanceof __await ? (this.v = v, this) : new __await(v); }
|
||||
var __asyncGenerator = (this && this.__asyncGenerator) || function (thisArg, _arguments, generator) {
|
||||
if (!Symbol.asyncIterator) throw new TypeError("Symbol.asyncIterator is not defined.");
|
||||
var g = generator.apply(thisArg, _arguments || []), q = [], c, i;
|
||||
return i = { next: verb("next"), "throw": verb("throw"), "return": verb("return") }, i[Symbol.asyncIterator] = function () { return this; }, i;
|
||||
function verb(n) { return function (v) { return new Promise(function (a, b) { q.push([n, v, a, b]), next(); }); }; }
|
||||
function next() { if (!c && q.length) resume((c = q.shift())[0], c[1]); }
|
||||
function resume(n, v) { try { step(g[n](v)); } catch (e) { settle(c[3], e); } }
|
||||
function step(r) { r.done ? settle(c[2], r) : Promise.resolve(r.value[1]).then(r.value[0] === "yield" ? send : fulfill, reject); }
|
||||
function send(value) { settle(c[2], { value: value, done: false }); }
|
||||
var g = generator.apply(thisArg, _arguments || []), i, q = [];
|
||||
return i = {}, verb("next"), verb("throw"), verb("return"), i[Symbol.asyncIterator] = function () { return this; }, i;
|
||||
function verb(n) { if (g[n]) i[n] = function (v) { return new Promise(function (a, b) { q.push([n, v, a, b]) > 1 || resume(n, v); }); }; }
|
||||
function resume(n, v) { try { step(g[n](v)); } catch (e) { settle(q[0][3], e); } }
|
||||
function step(r) { r.value instanceof __await ? Promise.resolve(r.value.v).then(fulfill, reject) : settle(q[0][2], r); }
|
||||
function fulfill(value) { resume("next", value); }
|
||||
function reject(value) { resume("throw", value); }
|
||||
function settle(f, v) { c = void 0, f(v), next(); }
|
||||
function settle(f, v) { if (f(v), q.shift(), q.length) resume(q[0][0], q[0][1]); }
|
||||
};
|
||||
const f2 = function () {
|
||||
return __asyncGenerator(this, arguments, function* () {
|
||||
const x = yield ["yield"];
|
||||
const x = yield;
|
||||
});
|
||||
};
|
||||
//// [F3.js]
|
||||
var __await = (this && this.__await) || function (v) { return this instanceof __await ? (this.v = v, this) : new __await(v); }
|
||||
var __asyncGenerator = (this && this.__asyncGenerator) || function (thisArg, _arguments, generator) {
|
||||
if (!Symbol.asyncIterator) throw new TypeError("Symbol.asyncIterator is not defined.");
|
||||
var g = generator.apply(thisArg, _arguments || []), q = [], c, i;
|
||||
return i = { next: verb("next"), "throw": verb("throw"), "return": verb("return") }, i[Symbol.asyncIterator] = function () { return this; }, i;
|
||||
function verb(n) { return function (v) { return new Promise(function (a, b) { q.push([n, v, a, b]), next(); }); }; }
|
||||
function next() { if (!c && q.length) resume((c = q.shift())[0], c[1]); }
|
||||
function resume(n, v) { try { step(g[n](v)); } catch (e) { settle(c[3], e); } }
|
||||
function step(r) { r.done ? settle(c[2], r) : Promise.resolve(r.value[1]).then(r.value[0] === "yield" ? send : fulfill, reject); }
|
||||
function send(value) { settle(c[2], { value: value, done: false }); }
|
||||
var g = generator.apply(thisArg, _arguments || []), i, q = [];
|
||||
return i = {}, verb("next"), verb("throw"), verb("return"), i[Symbol.asyncIterator] = function () { return this; }, i;
|
||||
function verb(n) { if (g[n]) i[n] = function (v) { return new Promise(function (a, b) { q.push([n, v, a, b]) > 1 || resume(n, v); }); }; }
|
||||
function resume(n, v) { try { step(g[n](v)); } catch (e) { settle(q[0][3], e); } }
|
||||
function step(r) { r.value instanceof __await ? Promise.resolve(r.value.v).then(fulfill, reject) : settle(q[0][2], r); }
|
||||
function fulfill(value) { resume("next", value); }
|
||||
function reject(value) { resume("throw", value); }
|
||||
function settle(f, v) { c = void 0, f(v), next(); }
|
||||
function settle(f, v) { if (f(v), q.shift(), q.length) resume(q[0][0], q[0][1]); }
|
||||
};
|
||||
const f3 = function () {
|
||||
return __asyncGenerator(this, arguments, function* () {
|
||||
const x = yield ["yield", 1];
|
||||
const x = yield 1;
|
||||
});
|
||||
};
|
||||
//// [F4.js]
|
||||
var __asyncDelegator = (this && this.__asyncDelegator) || function (o) {
|
||||
var i = { next: verb("next"), "throw": verb("throw", function (e) { throw e; }), "return": verb("return", function (v) { return { value: v, done: true }; }) }, p;
|
||||
return o = __asyncValues(o), i[Symbol.iterator] = function () { return this; }, i;
|
||||
function verb(n, f) { return function (v) { return v = p && n === "throw" ? f(v) : p && v.done ? v : { value: p ? ["yield", v.value] : ["await", (o[n] || f).call(o, v)], done: false }, p = !p, v; }; }
|
||||
};
|
||||
var __asyncValues = (this && this.__asyncIterator) || function (o) {
|
||||
if (!Symbol.asyncIterator) throw new TypeError("Symbol.asyncIterator is not defined.");
|
||||
var m = o[Symbol.asyncIterator];
|
||||
return m ? m.call(o) : typeof __values === "function" ? __values(o) : o[Symbol.iterator]();
|
||||
};
|
||||
var __await = (this && this.__await) || function (v) { return this instanceof __await ? (this.v = v, this) : new __await(v); }
|
||||
var __asyncDelegator = (this && this.__asyncDelegator) || function (o) {
|
||||
var i, p;
|
||||
return i = {}, verb("next"), verb("throw", function (e) { throw e; }), verb("return"), i[Symbol.iterator] = function () { return this; }, i;
|
||||
function verb(n, f) { if (o[n]) i[n] = function (v) { return (p = !p) ? { value: __await(o[n](v)), done: n === "return" } : f ? f(v) : v; }; }
|
||||
};
|
||||
var __asyncGenerator = (this && this.__asyncGenerator) || function (thisArg, _arguments, generator) {
|
||||
if (!Symbol.asyncIterator) throw new TypeError("Symbol.asyncIterator is not defined.");
|
||||
var g = generator.apply(thisArg, _arguments || []), q = [], c, i;
|
||||
return i = { next: verb("next"), "throw": verb("throw"), "return": verb("return") }, i[Symbol.asyncIterator] = function () { return this; }, i;
|
||||
function verb(n) { return function (v) { return new Promise(function (a, b) { q.push([n, v, a, b]), next(); }); }; }
|
||||
function next() { if (!c && q.length) resume((c = q.shift())[0], c[1]); }
|
||||
function resume(n, v) { try { step(g[n](v)); } catch (e) { settle(c[3], e); } }
|
||||
function step(r) { r.done ? settle(c[2], r) : Promise.resolve(r.value[1]).then(r.value[0] === "yield" ? send : fulfill, reject); }
|
||||
function send(value) { settle(c[2], { value: value, done: false }); }
|
||||
var g = generator.apply(thisArg, _arguments || []), i, q = [];
|
||||
return i = {}, verb("next"), verb("throw"), verb("return"), i[Symbol.asyncIterator] = function () { return this; }, i;
|
||||
function verb(n) { if (g[n]) i[n] = function (v) { return new Promise(function (a, b) { q.push([n, v, a, b]) > 1 || resume(n, v); }); }; }
|
||||
function resume(n, v) { try { step(g[n](v)); } catch (e) { settle(q[0][3], e); } }
|
||||
function step(r) { r.value instanceof __await ? Promise.resolve(r.value.v).then(fulfill, reject) : settle(q[0][2], r); }
|
||||
function fulfill(value) { resume("next", value); }
|
||||
function reject(value) { resume("throw", value); }
|
||||
function settle(f, v) { c = void 0, f(v), next(); }
|
||||
function settle(f, v) { if (f(v), q.shift(), q.length) resume(q[0][0], q[0][1]); }
|
||||
};
|
||||
const f4 = function () {
|
||||
return __asyncGenerator(this, arguments, function* () {
|
||||
const x = yield* __asyncDelegator([1]);
|
||||
const x = yield __await(yield* __asyncDelegator(__asyncValues([1])));
|
||||
});
|
||||
};
|
||||
//// [F5.js]
|
||||
var __await = (this && this.__await) || function (v) { return this instanceof __await ? (this.v = v, this) : new __await(v); }
|
||||
var __asyncGenerator = (this && this.__asyncGenerator) || function (thisArg, _arguments, generator) {
|
||||
if (!Symbol.asyncIterator) throw new TypeError("Symbol.asyncIterator is not defined.");
|
||||
var g = generator.apply(thisArg, _arguments || []), q = [], c, i;
|
||||
return i = { next: verb("next"), "throw": verb("throw"), "return": verb("return") }, i[Symbol.asyncIterator] = function () { return this; }, i;
|
||||
function verb(n) { return function (v) { return new Promise(function (a, b) { q.push([n, v, a, b]), next(); }); }; }
|
||||
function next() { if (!c && q.length) resume((c = q.shift())[0], c[1]); }
|
||||
function resume(n, v) { try { step(g[n](v)); } catch (e) { settle(c[3], e); } }
|
||||
function step(r) { r.done ? settle(c[2], r) : Promise.resolve(r.value[1]).then(r.value[0] === "yield" ? send : fulfill, reject); }
|
||||
function send(value) { settle(c[2], { value: value, done: false }); }
|
||||
var g = generator.apply(thisArg, _arguments || []), i, q = [];
|
||||
return i = {}, verb("next"), verb("throw"), verb("return"), i[Symbol.asyncIterator] = function () { return this; }, i;
|
||||
function verb(n) { if (g[n]) i[n] = function (v) { return new Promise(function (a, b) { q.push([n, v, a, b]) > 1 || resume(n, v); }); }; }
|
||||
function resume(n, v) { try { step(g[n](v)); } catch (e) { settle(q[0][3], e); } }
|
||||
function step(r) { r.value instanceof __await ? Promise.resolve(r.value.v).then(fulfill, reject) : settle(q[0][2], r); }
|
||||
function fulfill(value) { resume("next", value); }
|
||||
function reject(value) { resume("throw", value); }
|
||||
function settle(f, v) { c = void 0, f(v), next(); }
|
||||
};
|
||||
var __asyncDelegator = (this && this.__asyncDelegator) || function (o) {
|
||||
var i = { next: verb("next"), "throw": verb("throw", function (e) { throw e; }), "return": verb("return", function (v) { return { value: v, done: true }; }) }, p;
|
||||
return o = __asyncValues(o), i[Symbol.iterator] = function () { return this; }, i;
|
||||
function verb(n, f) { return function (v) { return v = p && n === "throw" ? f(v) : p && v.done ? v : { value: p ? ["yield", v.value] : ["await", (o[n] || f).call(o, v)], done: false }, p = !p, v; }; }
|
||||
function settle(f, v) { if (f(v), q.shift(), q.length) resume(q[0][0], q[0][1]); }
|
||||
};
|
||||
var __asyncValues = (this && this.__asyncIterator) || function (o) {
|
||||
if (!Symbol.asyncIterator) throw new TypeError("Symbol.asyncIterator is not defined.");
|
||||
var m = o[Symbol.asyncIterator];
|
||||
return m ? m.call(o) : typeof __values === "function" ? __values(o) : o[Symbol.iterator]();
|
||||
};
|
||||
var __asyncDelegator = (this && this.__asyncDelegator) || function (o) {
|
||||
var i, p;
|
||||
return i = {}, verb("next"), verb("throw", function (e) { throw e; }), verb("return"), i[Symbol.iterator] = function () { return this; }, i;
|
||||
function verb(n, f) { if (o[n]) i[n] = function (v) { return (p = !p) ? { value: __await(o[n](v)), done: n === "return" } : f ? f(v) : v; }; }
|
||||
};
|
||||
const f5 = function () {
|
||||
return __asyncGenerator(this, arguments, function* () {
|
||||
const x = yield* __asyncDelegator((function () { return __asyncGenerator(this, arguments, function* () { yield ["yield", 1]; }); })());
|
||||
const x = yield __await(yield* __asyncDelegator(__asyncValues((function () { return __asyncGenerator(this, arguments, function* () { yield 1; }); })())));
|
||||
});
|
||||
};
|
||||
//// [F6.js]
|
||||
var __await = (this && this.__await) || function (v) { return this instanceof __await ? (this.v = v, this) : new __await(v); }
|
||||
var __asyncGenerator = (this && this.__asyncGenerator) || function (thisArg, _arguments, generator) {
|
||||
if (!Symbol.asyncIterator) throw new TypeError("Symbol.asyncIterator is not defined.");
|
||||
var g = generator.apply(thisArg, _arguments || []), q = [], c, i;
|
||||
return i = { next: verb("next"), "throw": verb("throw"), "return": verb("return") }, i[Symbol.asyncIterator] = function () { return this; }, i;
|
||||
function verb(n) { return function (v) { return new Promise(function (a, b) { q.push([n, v, a, b]), next(); }); }; }
|
||||
function next() { if (!c && q.length) resume((c = q.shift())[0], c[1]); }
|
||||
function resume(n, v) { try { step(g[n](v)); } catch (e) { settle(c[3], e); } }
|
||||
function step(r) { r.done ? settle(c[2], r) : Promise.resolve(r.value[1]).then(r.value[0] === "yield" ? send : fulfill, reject); }
|
||||
function send(value) { settle(c[2], { value: value, done: false }); }
|
||||
var g = generator.apply(thisArg, _arguments || []), i, q = [];
|
||||
return i = {}, verb("next"), verb("throw"), verb("return"), i[Symbol.asyncIterator] = function () { return this; }, i;
|
||||
function verb(n) { if (g[n]) i[n] = function (v) { return new Promise(function (a, b) { q.push([n, v, a, b]) > 1 || resume(n, v); }); }; }
|
||||
function resume(n, v) { try { step(g[n](v)); } catch (e) { settle(q[0][3], e); } }
|
||||
function step(r) { r.value instanceof __await ? Promise.resolve(r.value.v).then(fulfill, reject) : settle(q[0][2], r); }
|
||||
function fulfill(value) { resume("next", value); }
|
||||
function reject(value) { resume("throw", value); }
|
||||
function settle(f, v) { c = void 0, f(v), next(); }
|
||||
function settle(f, v) { if (f(v), q.shift(), q.length) resume(q[0][0], q[0][1]); }
|
||||
};
|
||||
const f6 = function () {
|
||||
return __asyncGenerator(this, arguments, function* () {
|
||||
const x = yield ["await", 1];
|
||||
const x = yield __await(1);
|
||||
});
|
||||
};
|
||||
//// [F7.js]
|
||||
var __await = (this && this.__await) || function (v) { return this instanceof __await ? (this.v = v, this) : new __await(v); }
|
||||
var __asyncGenerator = (this && this.__asyncGenerator) || function (thisArg, _arguments, generator) {
|
||||
if (!Symbol.asyncIterator) throw new TypeError("Symbol.asyncIterator is not defined.");
|
||||
var g = generator.apply(thisArg, _arguments || []), q = [], c, i;
|
||||
return i = { next: verb("next"), "throw": verb("throw"), "return": verb("return") }, i[Symbol.asyncIterator] = function () { return this; }, i;
|
||||
function verb(n) { return function (v) { return new Promise(function (a, b) { q.push([n, v, a, b]), next(); }); }; }
|
||||
function next() { if (!c && q.length) resume((c = q.shift())[0], c[1]); }
|
||||
function resume(n, v) { try { step(g[n](v)); } catch (e) { settle(c[3], e); } }
|
||||
function step(r) { r.done ? settle(c[2], r) : Promise.resolve(r.value[1]).then(r.value[0] === "yield" ? send : fulfill, reject); }
|
||||
function send(value) { settle(c[2], { value: value, done: false }); }
|
||||
var g = generator.apply(thisArg, _arguments || []), i, q = [];
|
||||
return i = {}, verb("next"), verb("throw"), verb("return"), i[Symbol.asyncIterator] = function () { return this; }, i;
|
||||
function verb(n) { if (g[n]) i[n] = function (v) { return new Promise(function (a, b) { q.push([n, v, a, b]) > 1 || resume(n, v); }); }; }
|
||||
function resume(n, v) { try { step(g[n](v)); } catch (e) { settle(q[0][3], e); } }
|
||||
function step(r) { r.value instanceof __await ? Promise.resolve(r.value.v).then(fulfill, reject) : settle(q[0][2], r); }
|
||||
function fulfill(value) { resume("next", value); }
|
||||
function reject(value) { resume("throw", value); }
|
||||
function settle(f, v) { c = void 0, f(v), next(); }
|
||||
function settle(f, v) { if (f(v), q.shift(), q.length) resume(q[0][0], q[0][1]); }
|
||||
};
|
||||
const f7 = function () {
|
||||
return __asyncGenerator(this, arguments, function* () {
|
||||
|
||||
@@ -57,18 +57,17 @@ var __generator = (this && this.__generator) || function (thisArg, body) {
|
||||
if (op[0] & 5) throw op[1]; return { value: op[0] ? op[1] : void 0, done: true };
|
||||
}
|
||||
};
|
||||
var __await = (this && this.__await) || function (v) { return this instanceof __await ? (this.v = v, this) : new __await(v); }
|
||||
var __asyncGenerator = (this && this.__asyncGenerator) || function (thisArg, _arguments, generator) {
|
||||
if (!Symbol.asyncIterator) throw new TypeError("Symbol.asyncIterator is not defined.");
|
||||
var g = generator.apply(thisArg, _arguments || []), q = [], c, i;
|
||||
return i = { next: verb("next"), "throw": verb("throw"), "return": verb("return") }, i[Symbol.asyncIterator] = function () { return this; }, i;
|
||||
function verb(n) { return function (v) { return new Promise(function (a, b) { q.push([n, v, a, b]), next(); }); }; }
|
||||
function next() { if (!c && q.length) resume((c = q.shift())[0], c[1]); }
|
||||
function resume(n, v) { try { step(g[n](v)); } catch (e) { settle(c[3], e); } }
|
||||
function step(r) { r.done ? settle(c[2], r) : Promise.resolve(r.value[1]).then(r.value[0] === "yield" ? send : fulfill, reject); }
|
||||
function send(value) { settle(c[2], { value: value, done: false }); }
|
||||
var g = generator.apply(thisArg, _arguments || []), i, q = [];
|
||||
return i = {}, verb("next"), verb("throw"), verb("return"), i[Symbol.asyncIterator] = function () { return this; }, i;
|
||||
function verb(n) { if (g[n]) i[n] = function (v) { return new Promise(function (a, b) { q.push([n, v, a, b]) > 1 || resume(n, v); }); }; }
|
||||
function resume(n, v) { try { step(g[n](v)); } catch (e) { settle(q[0][3], e); } }
|
||||
function step(r) { r.value instanceof __await ? Promise.resolve(r.value.v).then(fulfill, reject) : settle(q[0][2], r); }
|
||||
function fulfill(value) { resume("next", value); }
|
||||
function reject(value) { resume("throw", value); }
|
||||
function settle(f, v) { c = void 0, f(v), next(); }
|
||||
function settle(f, v) { if (f(v), q.shift(), q.length) resume(q[0][0], q[0][1]); }
|
||||
};
|
||||
var f1 = function () {
|
||||
return __asyncGenerator(this, arguments, function () {
|
||||
@@ -105,25 +104,24 @@ var __generator = (this && this.__generator) || function (thisArg, body) {
|
||||
if (op[0] & 5) throw op[1]; return { value: op[0] ? op[1] : void 0, done: true };
|
||||
}
|
||||
};
|
||||
var __await = (this && this.__await) || function (v) { return this instanceof __await ? (this.v = v, this) : new __await(v); }
|
||||
var __asyncGenerator = (this && this.__asyncGenerator) || function (thisArg, _arguments, generator) {
|
||||
if (!Symbol.asyncIterator) throw new TypeError("Symbol.asyncIterator is not defined.");
|
||||
var g = generator.apply(thisArg, _arguments || []), q = [], c, i;
|
||||
return i = { next: verb("next"), "throw": verb("throw"), "return": verb("return") }, i[Symbol.asyncIterator] = function () { return this; }, i;
|
||||
function verb(n) { return function (v) { return new Promise(function (a, b) { q.push([n, v, a, b]), next(); }); }; }
|
||||
function next() { if (!c && q.length) resume((c = q.shift())[0], c[1]); }
|
||||
function resume(n, v) { try { step(g[n](v)); } catch (e) { settle(c[3], e); } }
|
||||
function step(r) { r.done ? settle(c[2], r) : Promise.resolve(r.value[1]).then(r.value[0] === "yield" ? send : fulfill, reject); }
|
||||
function send(value) { settle(c[2], { value: value, done: false }); }
|
||||
var g = generator.apply(thisArg, _arguments || []), i, q = [];
|
||||
return i = {}, verb("next"), verb("throw"), verb("return"), i[Symbol.asyncIterator] = function () { return this; }, i;
|
||||
function verb(n) { if (g[n]) i[n] = function (v) { return new Promise(function (a, b) { q.push([n, v, a, b]) > 1 || resume(n, v); }); }; }
|
||||
function resume(n, v) { try { step(g[n](v)); } catch (e) { settle(q[0][3], e); } }
|
||||
function step(r) { r.value instanceof __await ? Promise.resolve(r.value.v).then(fulfill, reject) : settle(q[0][2], r); }
|
||||
function fulfill(value) { resume("next", value); }
|
||||
function reject(value) { resume("throw", value); }
|
||||
function settle(f, v) { c = void 0, f(v), next(); }
|
||||
function settle(f, v) { if (f(v), q.shift(), q.length) resume(q[0][0], q[0][1]); }
|
||||
};
|
||||
var f2 = function () {
|
||||
return __asyncGenerator(this, arguments, function () {
|
||||
var x;
|
||||
return __generator(this, function (_a) {
|
||||
switch (_a.label) {
|
||||
case 0: return [4 /*yield*/, ["yield"]];
|
||||
case 0: return [4 /*yield*/];
|
||||
case 1:
|
||||
x = _a.sent();
|
||||
return [2 /*return*/];
|
||||
@@ -159,25 +157,24 @@ var __generator = (this && this.__generator) || function (thisArg, body) {
|
||||
if (op[0] & 5) throw op[1]; return { value: op[0] ? op[1] : void 0, done: true };
|
||||
}
|
||||
};
|
||||
var __await = (this && this.__await) || function (v) { return this instanceof __await ? (this.v = v, this) : new __await(v); }
|
||||
var __asyncGenerator = (this && this.__asyncGenerator) || function (thisArg, _arguments, generator) {
|
||||
if (!Symbol.asyncIterator) throw new TypeError("Symbol.asyncIterator is not defined.");
|
||||
var g = generator.apply(thisArg, _arguments || []), q = [], c, i;
|
||||
return i = { next: verb("next"), "throw": verb("throw"), "return": verb("return") }, i[Symbol.asyncIterator] = function () { return this; }, i;
|
||||
function verb(n) { return function (v) { return new Promise(function (a, b) { q.push([n, v, a, b]), next(); }); }; }
|
||||
function next() { if (!c && q.length) resume((c = q.shift())[0], c[1]); }
|
||||
function resume(n, v) { try { step(g[n](v)); } catch (e) { settle(c[3], e); } }
|
||||
function step(r) { r.done ? settle(c[2], r) : Promise.resolve(r.value[1]).then(r.value[0] === "yield" ? send : fulfill, reject); }
|
||||
function send(value) { settle(c[2], { value: value, done: false }); }
|
||||
var g = generator.apply(thisArg, _arguments || []), i, q = [];
|
||||
return i = {}, verb("next"), verb("throw"), verb("return"), i[Symbol.asyncIterator] = function () { return this; }, i;
|
||||
function verb(n) { if (g[n]) i[n] = function (v) { return new Promise(function (a, b) { q.push([n, v, a, b]) > 1 || resume(n, v); }); }; }
|
||||
function resume(n, v) { try { step(g[n](v)); } catch (e) { settle(q[0][3], e); } }
|
||||
function step(r) { r.value instanceof __await ? Promise.resolve(r.value.v).then(fulfill, reject) : settle(q[0][2], r); }
|
||||
function fulfill(value) { resume("next", value); }
|
||||
function reject(value) { resume("throw", value); }
|
||||
function settle(f, v) { c = void 0, f(v), next(); }
|
||||
function settle(f, v) { if (f(v), q.shift(), q.length) resume(q[0][0], q[0][1]); }
|
||||
};
|
||||
var f3 = function () {
|
||||
return __asyncGenerator(this, arguments, function () {
|
||||
var x;
|
||||
return __generator(this, function (_a) {
|
||||
switch (_a.label) {
|
||||
case 0: return [4 /*yield*/, ["yield", 1]];
|
||||
case 0: return [4 /*yield*/, 1];
|
||||
case 1:
|
||||
x = _a.sent();
|
||||
return [2 /*return*/];
|
||||
@@ -213,28 +210,27 @@ var __generator = (this && this.__generator) || function (thisArg, body) {
|
||||
if (op[0] & 5) throw op[1]; return { value: op[0] ? op[1] : void 0, done: true };
|
||||
}
|
||||
};
|
||||
var __asyncDelegator = (this && this.__asyncDelegator) || function (o) {
|
||||
var i = { next: verb("next"), "throw": verb("throw", function (e) { throw e; }), "return": verb("return", function (v) { return { value: v, done: true }; }) }, p;
|
||||
return o = __asyncValues(o), i[Symbol.iterator] = function () { return this; }, i;
|
||||
function verb(n, f) { return function (v) { return v = p && n === "throw" ? f(v) : p && v.done ? v : { value: p ? ["yield", v.value] : ["await", (o[n] || f).call(o, v)], done: false }, p = !p, v; }; }
|
||||
};
|
||||
var __asyncValues = (this && this.__asyncIterator) || function (o) {
|
||||
if (!Symbol.asyncIterator) throw new TypeError("Symbol.asyncIterator is not defined.");
|
||||
var m = o[Symbol.asyncIterator];
|
||||
return m ? m.call(o) : typeof __values === "function" ? __values(o) : o[Symbol.iterator]();
|
||||
};
|
||||
var __await = (this && this.__await) || function (v) { return this instanceof __await ? (this.v = v, this) : new __await(v); }
|
||||
var __asyncDelegator = (this && this.__asyncDelegator) || function (o) {
|
||||
var i, p;
|
||||
return i = {}, verb("next"), verb("throw", function (e) { throw e; }), verb("return"), i[Symbol.iterator] = function () { return this; }, i;
|
||||
function verb(n, f) { if (o[n]) i[n] = function (v) { return (p = !p) ? { value: __await(o[n](v)), done: n === "return" } : f ? f(v) : v; }; }
|
||||
};
|
||||
var __asyncGenerator = (this && this.__asyncGenerator) || function (thisArg, _arguments, generator) {
|
||||
if (!Symbol.asyncIterator) throw new TypeError("Symbol.asyncIterator is not defined.");
|
||||
var g = generator.apply(thisArg, _arguments || []), q = [], c, i;
|
||||
return i = { next: verb("next"), "throw": verb("throw"), "return": verb("return") }, i[Symbol.asyncIterator] = function () { return this; }, i;
|
||||
function verb(n) { return function (v) { return new Promise(function (a, b) { q.push([n, v, a, b]), next(); }); }; }
|
||||
function next() { if (!c && q.length) resume((c = q.shift())[0], c[1]); }
|
||||
function resume(n, v) { try { step(g[n](v)); } catch (e) { settle(c[3], e); } }
|
||||
function step(r) { r.done ? settle(c[2], r) : Promise.resolve(r.value[1]).then(r.value[0] === "yield" ? send : fulfill, reject); }
|
||||
function send(value) { settle(c[2], { value: value, done: false }); }
|
||||
var g = generator.apply(thisArg, _arguments || []), i, q = [];
|
||||
return i = {}, verb("next"), verb("throw"), verb("return"), i[Symbol.asyncIterator] = function () { return this; }, i;
|
||||
function verb(n) { if (g[n]) i[n] = function (v) { return new Promise(function (a, b) { q.push([n, v, a, b]) > 1 || resume(n, v); }); }; }
|
||||
function resume(n, v) { try { step(g[n](v)); } catch (e) { settle(q[0][3], e); } }
|
||||
function step(r) { r.value instanceof __await ? Promise.resolve(r.value.v).then(fulfill, reject) : settle(q[0][2], r); }
|
||||
function fulfill(value) { resume("next", value); }
|
||||
function reject(value) { resume("throw", value); }
|
||||
function settle(f, v) { c = void 0, f(v), next(); }
|
||||
function settle(f, v) { if (f(v), q.shift(), q.length) resume(q[0][0], q[0][1]); }
|
||||
};
|
||||
var __values = (this && this.__values) || function (o) {
|
||||
var m = typeof Symbol === "function" && o[Symbol.iterator], i = 0;
|
||||
@@ -251,8 +247,9 @@ var f4 = function () {
|
||||
var x;
|
||||
return __generator(this, function (_a) {
|
||||
switch (_a.label) {
|
||||
case 0: return [5 /*yield**/, __values(__asyncDelegator([1]))];
|
||||
case 1:
|
||||
case 0: return [5 /*yield**/, __values(__asyncDelegator(__asyncValues([1])))];
|
||||
case 1: return [4 /*yield*/, __await.apply(void 0, [_a.sent()])];
|
||||
case 2:
|
||||
x = _a.sent();
|
||||
return [2 /*return*/];
|
||||
}
|
||||
@@ -287,29 +284,28 @@ var __generator = (this && this.__generator) || function (thisArg, body) {
|
||||
if (op[0] & 5) throw op[1]; return { value: op[0] ? op[1] : void 0, done: true };
|
||||
}
|
||||
};
|
||||
var __await = (this && this.__await) || function (v) { return this instanceof __await ? (this.v = v, this) : new __await(v); }
|
||||
var __asyncGenerator = (this && this.__asyncGenerator) || function (thisArg, _arguments, generator) {
|
||||
if (!Symbol.asyncIterator) throw new TypeError("Symbol.asyncIterator is not defined.");
|
||||
var g = generator.apply(thisArg, _arguments || []), q = [], c, i;
|
||||
return i = { next: verb("next"), "throw": verb("throw"), "return": verb("return") }, i[Symbol.asyncIterator] = function () { return this; }, i;
|
||||
function verb(n) { return function (v) { return new Promise(function (a, b) { q.push([n, v, a, b]), next(); }); }; }
|
||||
function next() { if (!c && q.length) resume((c = q.shift())[0], c[1]); }
|
||||
function resume(n, v) { try { step(g[n](v)); } catch (e) { settle(c[3], e); } }
|
||||
function step(r) { r.done ? settle(c[2], r) : Promise.resolve(r.value[1]).then(r.value[0] === "yield" ? send : fulfill, reject); }
|
||||
function send(value) { settle(c[2], { value: value, done: false }); }
|
||||
var g = generator.apply(thisArg, _arguments || []), i, q = [];
|
||||
return i = {}, verb("next"), verb("throw"), verb("return"), i[Symbol.asyncIterator] = function () { return this; }, i;
|
||||
function verb(n) { if (g[n]) i[n] = function (v) { return new Promise(function (a, b) { q.push([n, v, a, b]) > 1 || resume(n, v); }); }; }
|
||||
function resume(n, v) { try { step(g[n](v)); } catch (e) { settle(q[0][3], e); } }
|
||||
function step(r) { r.value instanceof __await ? Promise.resolve(r.value.v).then(fulfill, reject) : settle(q[0][2], r); }
|
||||
function fulfill(value) { resume("next", value); }
|
||||
function reject(value) { resume("throw", value); }
|
||||
function settle(f, v) { c = void 0, f(v), next(); }
|
||||
};
|
||||
var __asyncDelegator = (this && this.__asyncDelegator) || function (o) {
|
||||
var i = { next: verb("next"), "throw": verb("throw", function (e) { throw e; }), "return": verb("return", function (v) { return { value: v, done: true }; }) }, p;
|
||||
return o = __asyncValues(o), i[Symbol.iterator] = function () { return this; }, i;
|
||||
function verb(n, f) { return function (v) { return v = p && n === "throw" ? f(v) : p && v.done ? v : { value: p ? ["yield", v.value] : ["await", (o[n] || f).call(o, v)], done: false }, p = !p, v; }; }
|
||||
function settle(f, v) { if (f(v), q.shift(), q.length) resume(q[0][0], q[0][1]); }
|
||||
};
|
||||
var __asyncValues = (this && this.__asyncIterator) || function (o) {
|
||||
if (!Symbol.asyncIterator) throw new TypeError("Symbol.asyncIterator is not defined.");
|
||||
var m = o[Symbol.asyncIterator];
|
||||
return m ? m.call(o) : typeof __values === "function" ? __values(o) : o[Symbol.iterator]();
|
||||
};
|
||||
var __asyncDelegator = (this && this.__asyncDelegator) || function (o) {
|
||||
var i, p;
|
||||
return i = {}, verb("next"), verb("throw", function (e) { throw e; }), verb("return"), i[Symbol.iterator] = function () { return this; }, i;
|
||||
function verb(n, f) { if (o[n]) i[n] = function (v) { return (p = !p) ? { value: __await(o[n](v)), done: n === "return" } : f ? f(v) : v; }; }
|
||||
};
|
||||
var __values = (this && this.__values) || function (o) {
|
||||
var m = typeof Symbol === "function" && o[Symbol.iterator], i = 0;
|
||||
if (m) return m.call(o);
|
||||
@@ -325,15 +321,16 @@ var f5 = function () {
|
||||
var x;
|
||||
return __generator(this, function (_a) {
|
||||
switch (_a.label) {
|
||||
case 0: return [5 /*yield**/, __values(__asyncDelegator((function () { return __asyncGenerator(this, arguments, function () { return __generator(this, function (_a) {
|
||||
case 0: return [5 /*yield**/, __values(__asyncDelegator(__asyncValues((function () { return __asyncGenerator(this, arguments, function () { return __generator(this, function (_a) {
|
||||
switch (_a.label) {
|
||||
case 0: return [4 /*yield*/, ["yield", 1]];
|
||||
case 0: return [4 /*yield*/, 1];
|
||||
case 1:
|
||||
_a.sent();
|
||||
return [2 /*return*/];
|
||||
}
|
||||
}); }); })()))];
|
||||
case 1:
|
||||
}); }); })())))];
|
||||
case 1: return [4 /*yield*/, __await.apply(void 0, [_a.sent()])];
|
||||
case 2:
|
||||
x = _a.sent();
|
||||
return [2 /*return*/];
|
||||
}
|
||||
@@ -368,25 +365,24 @@ var __generator = (this && this.__generator) || function (thisArg, body) {
|
||||
if (op[0] & 5) throw op[1]; return { value: op[0] ? op[1] : void 0, done: true };
|
||||
}
|
||||
};
|
||||
var __await = (this && this.__await) || function (v) { return this instanceof __await ? (this.v = v, this) : new __await(v); }
|
||||
var __asyncGenerator = (this && this.__asyncGenerator) || function (thisArg, _arguments, generator) {
|
||||
if (!Symbol.asyncIterator) throw new TypeError("Symbol.asyncIterator is not defined.");
|
||||
var g = generator.apply(thisArg, _arguments || []), q = [], c, i;
|
||||
return i = { next: verb("next"), "throw": verb("throw"), "return": verb("return") }, i[Symbol.asyncIterator] = function () { return this; }, i;
|
||||
function verb(n) { return function (v) { return new Promise(function (a, b) { q.push([n, v, a, b]), next(); }); }; }
|
||||
function next() { if (!c && q.length) resume((c = q.shift())[0], c[1]); }
|
||||
function resume(n, v) { try { step(g[n](v)); } catch (e) { settle(c[3], e); } }
|
||||
function step(r) { r.done ? settle(c[2], r) : Promise.resolve(r.value[1]).then(r.value[0] === "yield" ? send : fulfill, reject); }
|
||||
function send(value) { settle(c[2], { value: value, done: false }); }
|
||||
var g = generator.apply(thisArg, _arguments || []), i, q = [];
|
||||
return i = {}, verb("next"), verb("throw"), verb("return"), i[Symbol.asyncIterator] = function () { return this; }, i;
|
||||
function verb(n) { if (g[n]) i[n] = function (v) { return new Promise(function (a, b) { q.push([n, v, a, b]) > 1 || resume(n, v); }); }; }
|
||||
function resume(n, v) { try { step(g[n](v)); } catch (e) { settle(q[0][3], e); } }
|
||||
function step(r) { r.value instanceof __await ? Promise.resolve(r.value.v).then(fulfill, reject) : settle(q[0][2], r); }
|
||||
function fulfill(value) { resume("next", value); }
|
||||
function reject(value) { resume("throw", value); }
|
||||
function settle(f, v) { c = void 0, f(v), next(); }
|
||||
function settle(f, v) { if (f(v), q.shift(), q.length) resume(q[0][0], q[0][1]); }
|
||||
};
|
||||
var f6 = function () {
|
||||
return __asyncGenerator(this, arguments, function () {
|
||||
var x;
|
||||
return __generator(this, function (_a) {
|
||||
switch (_a.label) {
|
||||
case 0: return [4 /*yield*/, ["await", 1]];
|
||||
case 0: return [4 /*yield*/, __await(1)];
|
||||
case 1:
|
||||
x = _a.sent();
|
||||
return [2 /*return*/];
|
||||
@@ -422,18 +418,17 @@ var __generator = (this && this.__generator) || function (thisArg, body) {
|
||||
if (op[0] & 5) throw op[1]; return { value: op[0] ? op[1] : void 0, done: true };
|
||||
}
|
||||
};
|
||||
var __await = (this && this.__await) || function (v) { return this instanceof __await ? (this.v = v, this) : new __await(v); }
|
||||
var __asyncGenerator = (this && this.__asyncGenerator) || function (thisArg, _arguments, generator) {
|
||||
if (!Symbol.asyncIterator) throw new TypeError("Symbol.asyncIterator is not defined.");
|
||||
var g = generator.apply(thisArg, _arguments || []), q = [], c, i;
|
||||
return i = { next: verb("next"), "throw": verb("throw"), "return": verb("return") }, i[Symbol.asyncIterator] = function () { return this; }, i;
|
||||
function verb(n) { return function (v) { return new Promise(function (a, b) { q.push([n, v, a, b]), next(); }); }; }
|
||||
function next() { if (!c && q.length) resume((c = q.shift())[0], c[1]); }
|
||||
function resume(n, v) { try { step(g[n](v)); } catch (e) { settle(c[3], e); } }
|
||||
function step(r) { r.done ? settle(c[2], r) : Promise.resolve(r.value[1]).then(r.value[0] === "yield" ? send : fulfill, reject); }
|
||||
function send(value) { settle(c[2], { value: value, done: false }); }
|
||||
var g = generator.apply(thisArg, _arguments || []), i, q = [];
|
||||
return i = {}, verb("next"), verb("throw"), verb("return"), i[Symbol.asyncIterator] = function () { return this; }, i;
|
||||
function verb(n) { if (g[n]) i[n] = function (v) { return new Promise(function (a, b) { q.push([n, v, a, b]) > 1 || resume(n, v); }); }; }
|
||||
function resume(n, v) { try { step(g[n](v)); } catch (e) { settle(q[0][3], e); } }
|
||||
function step(r) { r.value instanceof __await ? Promise.resolve(r.value.v).then(fulfill, reject) : settle(q[0][2], r); }
|
||||
function fulfill(value) { resume("next", value); }
|
||||
function reject(value) { resume("throw", value); }
|
||||
function settle(f, v) { c = void 0, f(v), next(); }
|
||||
function settle(f, v) { if (f(v), q.shift(), q.length) resume(q[0][0], q[0][1]); }
|
||||
};
|
||||
var f7 = function () {
|
||||
return __asyncGenerator(this, arguments, function () {
|
||||
|
||||
@@ -44,18 +44,17 @@ const o7 = {
|
||||
|
||||
|
||||
//// [O1.js]
|
||||
var __await = (this && this.__await) || function (v) { return this instanceof __await ? (this.v = v, this) : new __await(v); }
|
||||
var __asyncGenerator = (this && this.__asyncGenerator) || function (thisArg, _arguments, generator) {
|
||||
if (!Symbol.asyncIterator) throw new TypeError("Symbol.asyncIterator is not defined.");
|
||||
var g = generator.apply(thisArg, _arguments || []), q = [], c, i;
|
||||
return i = { next: verb("next"), "throw": verb("throw"), "return": verb("return") }, i[Symbol.asyncIterator] = function () { return this; }, i;
|
||||
function verb(n) { return function (v) { return new Promise(function (a, b) { q.push([n, v, a, b]), next(); }); }; }
|
||||
function next() { if (!c && q.length) resume((c = q.shift())[0], c[1]); }
|
||||
function resume(n, v) { try { step(g[n](v)); } catch (e) { settle(c[3], e); } }
|
||||
function step(r) { r.done ? settle(c[2], r) : Promise.resolve(r.value[1]).then(r.value[0] === "yield" ? send : fulfill, reject); }
|
||||
function send(value) { settle(c[2], { value: value, done: false }); }
|
||||
var g = generator.apply(thisArg, _arguments || []), i, q = [];
|
||||
return i = {}, verb("next"), verb("throw"), verb("return"), i[Symbol.asyncIterator] = function () { return this; }, i;
|
||||
function verb(n) { if (g[n]) i[n] = function (v) { return new Promise(function (a, b) { q.push([n, v, a, b]) > 1 || resume(n, v); }); }; }
|
||||
function resume(n, v) { try { step(g[n](v)); } catch (e) { settle(q[0][3], e); } }
|
||||
function step(r) { r.value instanceof __await ? Promise.resolve(r.value.v).then(fulfill, reject) : settle(q[0][2], r); }
|
||||
function fulfill(value) { resume("next", value); }
|
||||
function reject(value) { resume("throw", value); }
|
||||
function settle(f, v) { c = void 0, f(v), next(); }
|
||||
function settle(f, v) { if (f(v), q.shift(), q.length) resume(q[0][0], q[0][1]); }
|
||||
};
|
||||
const o1 = {
|
||||
f() {
|
||||
@@ -64,143 +63,137 @@ const o1 = {
|
||||
}
|
||||
};
|
||||
//// [O2.js]
|
||||
var __await = (this && this.__await) || function (v) { return this instanceof __await ? (this.v = v, this) : new __await(v); }
|
||||
var __asyncGenerator = (this && this.__asyncGenerator) || function (thisArg, _arguments, generator) {
|
||||
if (!Symbol.asyncIterator) throw new TypeError("Symbol.asyncIterator is not defined.");
|
||||
var g = generator.apply(thisArg, _arguments || []), q = [], c, i;
|
||||
return i = { next: verb("next"), "throw": verb("throw"), "return": verb("return") }, i[Symbol.asyncIterator] = function () { return this; }, i;
|
||||
function verb(n) { return function (v) { return new Promise(function (a, b) { q.push([n, v, a, b]), next(); }); }; }
|
||||
function next() { if (!c && q.length) resume((c = q.shift())[0], c[1]); }
|
||||
function resume(n, v) { try { step(g[n](v)); } catch (e) { settle(c[3], e); } }
|
||||
function step(r) { r.done ? settle(c[2], r) : Promise.resolve(r.value[1]).then(r.value[0] === "yield" ? send : fulfill, reject); }
|
||||
function send(value) { settle(c[2], { value: value, done: false }); }
|
||||
var g = generator.apply(thisArg, _arguments || []), i, q = [];
|
||||
return i = {}, verb("next"), verb("throw"), verb("return"), i[Symbol.asyncIterator] = function () { return this; }, i;
|
||||
function verb(n) { if (g[n]) i[n] = function (v) { return new Promise(function (a, b) { q.push([n, v, a, b]) > 1 || resume(n, v); }); }; }
|
||||
function resume(n, v) { try { step(g[n](v)); } catch (e) { settle(q[0][3], e); } }
|
||||
function step(r) { r.value instanceof __await ? Promise.resolve(r.value.v).then(fulfill, reject) : settle(q[0][2], r); }
|
||||
function fulfill(value) { resume("next", value); }
|
||||
function reject(value) { resume("throw", value); }
|
||||
function settle(f, v) { c = void 0, f(v), next(); }
|
||||
function settle(f, v) { if (f(v), q.shift(), q.length) resume(q[0][0], q[0][1]); }
|
||||
};
|
||||
const o2 = {
|
||||
f() {
|
||||
return __asyncGenerator(this, arguments, function* f_1() {
|
||||
const x = yield ["yield"];
|
||||
const x = yield;
|
||||
});
|
||||
}
|
||||
};
|
||||
//// [O3.js]
|
||||
var __await = (this && this.__await) || function (v) { return this instanceof __await ? (this.v = v, this) : new __await(v); }
|
||||
var __asyncGenerator = (this && this.__asyncGenerator) || function (thisArg, _arguments, generator) {
|
||||
if (!Symbol.asyncIterator) throw new TypeError("Symbol.asyncIterator is not defined.");
|
||||
var g = generator.apply(thisArg, _arguments || []), q = [], c, i;
|
||||
return i = { next: verb("next"), "throw": verb("throw"), "return": verb("return") }, i[Symbol.asyncIterator] = function () { return this; }, i;
|
||||
function verb(n) { return function (v) { return new Promise(function (a, b) { q.push([n, v, a, b]), next(); }); }; }
|
||||
function next() { if (!c && q.length) resume((c = q.shift())[0], c[1]); }
|
||||
function resume(n, v) { try { step(g[n](v)); } catch (e) { settle(c[3], e); } }
|
||||
function step(r) { r.done ? settle(c[2], r) : Promise.resolve(r.value[1]).then(r.value[0] === "yield" ? send : fulfill, reject); }
|
||||
function send(value) { settle(c[2], { value: value, done: false }); }
|
||||
var g = generator.apply(thisArg, _arguments || []), i, q = [];
|
||||
return i = {}, verb("next"), verb("throw"), verb("return"), i[Symbol.asyncIterator] = function () { return this; }, i;
|
||||
function verb(n) { if (g[n]) i[n] = function (v) { return new Promise(function (a, b) { q.push([n, v, a, b]) > 1 || resume(n, v); }); }; }
|
||||
function resume(n, v) { try { step(g[n](v)); } catch (e) { settle(q[0][3], e); } }
|
||||
function step(r) { r.value instanceof __await ? Promise.resolve(r.value.v).then(fulfill, reject) : settle(q[0][2], r); }
|
||||
function fulfill(value) { resume("next", value); }
|
||||
function reject(value) { resume("throw", value); }
|
||||
function settle(f, v) { c = void 0, f(v), next(); }
|
||||
function settle(f, v) { if (f(v), q.shift(), q.length) resume(q[0][0], q[0][1]); }
|
||||
};
|
||||
const o3 = {
|
||||
f() {
|
||||
return __asyncGenerator(this, arguments, function* f_1() {
|
||||
const x = yield ["yield", 1];
|
||||
const x = yield 1;
|
||||
});
|
||||
}
|
||||
};
|
||||
//// [O4.js]
|
||||
var __asyncDelegator = (this && this.__asyncDelegator) || function (o) {
|
||||
var i = { next: verb("next"), "throw": verb("throw", function (e) { throw e; }), "return": verb("return", function (v) { return { value: v, done: true }; }) }, p;
|
||||
return o = __asyncValues(o), i[Symbol.iterator] = function () { return this; }, i;
|
||||
function verb(n, f) { return function (v) { return v = p && n === "throw" ? f(v) : p && v.done ? v : { value: p ? ["yield", v.value] : ["await", (o[n] || f).call(o, v)], done: false }, p = !p, v; }; }
|
||||
};
|
||||
var __asyncValues = (this && this.__asyncIterator) || function (o) {
|
||||
if (!Symbol.asyncIterator) throw new TypeError("Symbol.asyncIterator is not defined.");
|
||||
var m = o[Symbol.asyncIterator];
|
||||
return m ? m.call(o) : typeof __values === "function" ? __values(o) : o[Symbol.iterator]();
|
||||
};
|
||||
var __await = (this && this.__await) || function (v) { return this instanceof __await ? (this.v = v, this) : new __await(v); }
|
||||
var __asyncDelegator = (this && this.__asyncDelegator) || function (o) {
|
||||
var i, p;
|
||||
return i = {}, verb("next"), verb("throw", function (e) { throw e; }), verb("return"), i[Symbol.iterator] = function () { return this; }, i;
|
||||
function verb(n, f) { if (o[n]) i[n] = function (v) { return (p = !p) ? { value: __await(o[n](v)), done: n === "return" } : f ? f(v) : v; }; }
|
||||
};
|
||||
var __asyncGenerator = (this && this.__asyncGenerator) || function (thisArg, _arguments, generator) {
|
||||
if (!Symbol.asyncIterator) throw new TypeError("Symbol.asyncIterator is not defined.");
|
||||
var g = generator.apply(thisArg, _arguments || []), q = [], c, i;
|
||||
return i = { next: verb("next"), "throw": verb("throw"), "return": verb("return") }, i[Symbol.asyncIterator] = function () { return this; }, i;
|
||||
function verb(n) { return function (v) { return new Promise(function (a, b) { q.push([n, v, a, b]), next(); }); }; }
|
||||
function next() { if (!c && q.length) resume((c = q.shift())[0], c[1]); }
|
||||
function resume(n, v) { try { step(g[n](v)); } catch (e) { settle(c[3], e); } }
|
||||
function step(r) { r.done ? settle(c[2], r) : Promise.resolve(r.value[1]).then(r.value[0] === "yield" ? send : fulfill, reject); }
|
||||
function send(value) { settle(c[2], { value: value, done: false }); }
|
||||
var g = generator.apply(thisArg, _arguments || []), i, q = [];
|
||||
return i = {}, verb("next"), verb("throw"), verb("return"), i[Symbol.asyncIterator] = function () { return this; }, i;
|
||||
function verb(n) { if (g[n]) i[n] = function (v) { return new Promise(function (a, b) { q.push([n, v, a, b]) > 1 || resume(n, v); }); }; }
|
||||
function resume(n, v) { try { step(g[n](v)); } catch (e) { settle(q[0][3], e); } }
|
||||
function step(r) { r.value instanceof __await ? Promise.resolve(r.value.v).then(fulfill, reject) : settle(q[0][2], r); }
|
||||
function fulfill(value) { resume("next", value); }
|
||||
function reject(value) { resume("throw", value); }
|
||||
function settle(f, v) { c = void 0, f(v), next(); }
|
||||
function settle(f, v) { if (f(v), q.shift(), q.length) resume(q[0][0], q[0][1]); }
|
||||
};
|
||||
const o4 = {
|
||||
f() {
|
||||
return __asyncGenerator(this, arguments, function* f_1() {
|
||||
const x = yield* __asyncDelegator([1]);
|
||||
const x = yield __await(yield* __asyncDelegator(__asyncValues([1])));
|
||||
});
|
||||
}
|
||||
};
|
||||
//// [O5.js]
|
||||
var __await = (this && this.__await) || function (v) { return this instanceof __await ? (this.v = v, this) : new __await(v); }
|
||||
var __asyncGenerator = (this && this.__asyncGenerator) || function (thisArg, _arguments, generator) {
|
||||
if (!Symbol.asyncIterator) throw new TypeError("Symbol.asyncIterator is not defined.");
|
||||
var g = generator.apply(thisArg, _arguments || []), q = [], c, i;
|
||||
return i = { next: verb("next"), "throw": verb("throw"), "return": verb("return") }, i[Symbol.asyncIterator] = function () { return this; }, i;
|
||||
function verb(n) { return function (v) { return new Promise(function (a, b) { q.push([n, v, a, b]), next(); }); }; }
|
||||
function next() { if (!c && q.length) resume((c = q.shift())[0], c[1]); }
|
||||
function resume(n, v) { try { step(g[n](v)); } catch (e) { settle(c[3], e); } }
|
||||
function step(r) { r.done ? settle(c[2], r) : Promise.resolve(r.value[1]).then(r.value[0] === "yield" ? send : fulfill, reject); }
|
||||
function send(value) { settle(c[2], { value: value, done: false }); }
|
||||
var g = generator.apply(thisArg, _arguments || []), i, q = [];
|
||||
return i = {}, verb("next"), verb("throw"), verb("return"), i[Symbol.asyncIterator] = function () { return this; }, i;
|
||||
function verb(n) { if (g[n]) i[n] = function (v) { return new Promise(function (a, b) { q.push([n, v, a, b]) > 1 || resume(n, v); }); }; }
|
||||
function resume(n, v) { try { step(g[n](v)); } catch (e) { settle(q[0][3], e); } }
|
||||
function step(r) { r.value instanceof __await ? Promise.resolve(r.value.v).then(fulfill, reject) : settle(q[0][2], r); }
|
||||
function fulfill(value) { resume("next", value); }
|
||||
function reject(value) { resume("throw", value); }
|
||||
function settle(f, v) { c = void 0, f(v), next(); }
|
||||
};
|
||||
var __asyncDelegator = (this && this.__asyncDelegator) || function (o) {
|
||||
var i = { next: verb("next"), "throw": verb("throw", function (e) { throw e; }), "return": verb("return", function (v) { return { value: v, done: true }; }) }, p;
|
||||
return o = __asyncValues(o), i[Symbol.iterator] = function () { return this; }, i;
|
||||
function verb(n, f) { return function (v) { return v = p && n === "throw" ? f(v) : p && v.done ? v : { value: p ? ["yield", v.value] : ["await", (o[n] || f).call(o, v)], done: false }, p = !p, v; }; }
|
||||
function settle(f, v) { if (f(v), q.shift(), q.length) resume(q[0][0], q[0][1]); }
|
||||
};
|
||||
var __asyncValues = (this && this.__asyncIterator) || function (o) {
|
||||
if (!Symbol.asyncIterator) throw new TypeError("Symbol.asyncIterator is not defined.");
|
||||
var m = o[Symbol.asyncIterator];
|
||||
return m ? m.call(o) : typeof __values === "function" ? __values(o) : o[Symbol.iterator]();
|
||||
};
|
||||
var __asyncDelegator = (this && this.__asyncDelegator) || function (o) {
|
||||
var i, p;
|
||||
return i = {}, verb("next"), verb("throw", function (e) { throw e; }), verb("return"), i[Symbol.iterator] = function () { return this; }, i;
|
||||
function verb(n, f) { if (o[n]) i[n] = function (v) { return (p = !p) ? { value: __await(o[n](v)), done: n === "return" } : f ? f(v) : v; }; }
|
||||
};
|
||||
const o5 = {
|
||||
f() {
|
||||
return __asyncGenerator(this, arguments, function* f_1() {
|
||||
const x = yield* __asyncDelegator((function () { return __asyncGenerator(this, arguments, function* () { yield ["yield", 1]; }); })());
|
||||
const x = yield __await(yield* __asyncDelegator(__asyncValues((function () { return __asyncGenerator(this, arguments, function* () { yield 1; }); })())));
|
||||
});
|
||||
}
|
||||
};
|
||||
//// [O6.js]
|
||||
var __await = (this && this.__await) || function (v) { return this instanceof __await ? (this.v = v, this) : new __await(v); }
|
||||
var __asyncGenerator = (this && this.__asyncGenerator) || function (thisArg, _arguments, generator) {
|
||||
if (!Symbol.asyncIterator) throw new TypeError("Symbol.asyncIterator is not defined.");
|
||||
var g = generator.apply(thisArg, _arguments || []), q = [], c, i;
|
||||
return i = { next: verb("next"), "throw": verb("throw"), "return": verb("return") }, i[Symbol.asyncIterator] = function () { return this; }, i;
|
||||
function verb(n) { return function (v) { return new Promise(function (a, b) { q.push([n, v, a, b]), next(); }); }; }
|
||||
function next() { if (!c && q.length) resume((c = q.shift())[0], c[1]); }
|
||||
function resume(n, v) { try { step(g[n](v)); } catch (e) { settle(c[3], e); } }
|
||||
function step(r) { r.done ? settle(c[2], r) : Promise.resolve(r.value[1]).then(r.value[0] === "yield" ? send : fulfill, reject); }
|
||||
function send(value) { settle(c[2], { value: value, done: false }); }
|
||||
var g = generator.apply(thisArg, _arguments || []), i, q = [];
|
||||
return i = {}, verb("next"), verb("throw"), verb("return"), i[Symbol.asyncIterator] = function () { return this; }, i;
|
||||
function verb(n) { if (g[n]) i[n] = function (v) { return new Promise(function (a, b) { q.push([n, v, a, b]) > 1 || resume(n, v); }); }; }
|
||||
function resume(n, v) { try { step(g[n](v)); } catch (e) { settle(q[0][3], e); } }
|
||||
function step(r) { r.value instanceof __await ? Promise.resolve(r.value.v).then(fulfill, reject) : settle(q[0][2], r); }
|
||||
function fulfill(value) { resume("next", value); }
|
||||
function reject(value) { resume("throw", value); }
|
||||
function settle(f, v) { c = void 0, f(v), next(); }
|
||||
function settle(f, v) { if (f(v), q.shift(), q.length) resume(q[0][0], q[0][1]); }
|
||||
};
|
||||
const o6 = {
|
||||
f() {
|
||||
return __asyncGenerator(this, arguments, function* f_1() {
|
||||
const x = yield ["await", 1];
|
||||
const x = yield __await(1);
|
||||
});
|
||||
}
|
||||
};
|
||||
//// [O7.js]
|
||||
var __await = (this && this.__await) || function (v) { return this instanceof __await ? (this.v = v, this) : new __await(v); }
|
||||
var __asyncGenerator = (this && this.__asyncGenerator) || function (thisArg, _arguments, generator) {
|
||||
if (!Symbol.asyncIterator) throw new TypeError("Symbol.asyncIterator is not defined.");
|
||||
var g = generator.apply(thisArg, _arguments || []), q = [], c, i;
|
||||
return i = { next: verb("next"), "throw": verb("throw"), "return": verb("return") }, i[Symbol.asyncIterator] = function () { return this; }, i;
|
||||
function verb(n) { return function (v) { return new Promise(function (a, b) { q.push([n, v, a, b]), next(); }); }; }
|
||||
function next() { if (!c && q.length) resume((c = q.shift())[0], c[1]); }
|
||||
function resume(n, v) { try { step(g[n](v)); } catch (e) { settle(c[3], e); } }
|
||||
function step(r) { r.done ? settle(c[2], r) : Promise.resolve(r.value[1]).then(r.value[0] === "yield" ? send : fulfill, reject); }
|
||||
function send(value) { settle(c[2], { value: value, done: false }); }
|
||||
var g = generator.apply(thisArg, _arguments || []), i, q = [];
|
||||
return i = {}, verb("next"), verb("throw"), verb("return"), i[Symbol.asyncIterator] = function () { return this; }, i;
|
||||
function verb(n) { if (g[n]) i[n] = function (v) { return new Promise(function (a, b) { q.push([n, v, a, b]) > 1 || resume(n, v); }); }; }
|
||||
function resume(n, v) { try { step(g[n](v)); } catch (e) { settle(q[0][3], e); } }
|
||||
function step(r) { r.value instanceof __await ? Promise.resolve(r.value.v).then(fulfill, reject) : settle(q[0][2], r); }
|
||||
function fulfill(value) { resume("next", value); }
|
||||
function reject(value) { resume("throw", value); }
|
||||
function settle(f, v) { c = void 0, f(v), next(); }
|
||||
function settle(f, v) { if (f(v), q.shift(), q.length) resume(q[0][0], q[0][1]); }
|
||||
};
|
||||
const o7 = {
|
||||
f() {
|
||||
|
||||
@@ -71,18 +71,17 @@ var __generator = (this && this.__generator) || function (thisArg, body) {
|
||||
if (op[0] & 5) throw op[1]; return { value: op[0] ? op[1] : void 0, done: true };
|
||||
}
|
||||
};
|
||||
var __await = (this && this.__await) || function (v) { return this instanceof __await ? (this.v = v, this) : new __await(v); }
|
||||
var __asyncGenerator = (this && this.__asyncGenerator) || function (thisArg, _arguments, generator) {
|
||||
if (!Symbol.asyncIterator) throw new TypeError("Symbol.asyncIterator is not defined.");
|
||||
var g = generator.apply(thisArg, _arguments || []), q = [], c, i;
|
||||
return i = { next: verb("next"), "throw": verb("throw"), "return": verb("return") }, i[Symbol.asyncIterator] = function () { return this; }, i;
|
||||
function verb(n) { return function (v) { return new Promise(function (a, b) { q.push([n, v, a, b]), next(); }); }; }
|
||||
function next() { if (!c && q.length) resume((c = q.shift())[0], c[1]); }
|
||||
function resume(n, v) { try { step(g[n](v)); } catch (e) { settle(c[3], e); } }
|
||||
function step(r) { r.done ? settle(c[2], r) : Promise.resolve(r.value[1]).then(r.value[0] === "yield" ? send : fulfill, reject); }
|
||||
function send(value) { settle(c[2], { value: value, done: false }); }
|
||||
var g = generator.apply(thisArg, _arguments || []), i, q = [];
|
||||
return i = {}, verb("next"), verb("throw"), verb("return"), i[Symbol.asyncIterator] = function () { return this; }, i;
|
||||
function verb(n) { if (g[n]) i[n] = function (v) { return new Promise(function (a, b) { q.push([n, v, a, b]) > 1 || resume(n, v); }); }; }
|
||||
function resume(n, v) { try { step(g[n](v)); } catch (e) { settle(q[0][3], e); } }
|
||||
function step(r) { r.value instanceof __await ? Promise.resolve(r.value.v).then(fulfill, reject) : settle(q[0][2], r); }
|
||||
function fulfill(value) { resume("next", value); }
|
||||
function reject(value) { resume("throw", value); }
|
||||
function settle(f, v) { c = void 0, f(v), next(); }
|
||||
function settle(f, v) { if (f(v), q.shift(), q.length) resume(q[0][0], q[0][1]); }
|
||||
};
|
||||
var o1 = {
|
||||
f: function () {
|
||||
@@ -121,18 +120,17 @@ var __generator = (this && this.__generator) || function (thisArg, body) {
|
||||
if (op[0] & 5) throw op[1]; return { value: op[0] ? op[1] : void 0, done: true };
|
||||
}
|
||||
};
|
||||
var __await = (this && this.__await) || function (v) { return this instanceof __await ? (this.v = v, this) : new __await(v); }
|
||||
var __asyncGenerator = (this && this.__asyncGenerator) || function (thisArg, _arguments, generator) {
|
||||
if (!Symbol.asyncIterator) throw new TypeError("Symbol.asyncIterator is not defined.");
|
||||
var g = generator.apply(thisArg, _arguments || []), q = [], c, i;
|
||||
return i = { next: verb("next"), "throw": verb("throw"), "return": verb("return") }, i[Symbol.asyncIterator] = function () { return this; }, i;
|
||||
function verb(n) { return function (v) { return new Promise(function (a, b) { q.push([n, v, a, b]), next(); }); }; }
|
||||
function next() { if (!c && q.length) resume((c = q.shift())[0], c[1]); }
|
||||
function resume(n, v) { try { step(g[n](v)); } catch (e) { settle(c[3], e); } }
|
||||
function step(r) { r.done ? settle(c[2], r) : Promise.resolve(r.value[1]).then(r.value[0] === "yield" ? send : fulfill, reject); }
|
||||
function send(value) { settle(c[2], { value: value, done: false }); }
|
||||
var g = generator.apply(thisArg, _arguments || []), i, q = [];
|
||||
return i = {}, verb("next"), verb("throw"), verb("return"), i[Symbol.asyncIterator] = function () { return this; }, i;
|
||||
function verb(n) { if (g[n]) i[n] = function (v) { return new Promise(function (a, b) { q.push([n, v, a, b]) > 1 || resume(n, v); }); }; }
|
||||
function resume(n, v) { try { step(g[n](v)); } catch (e) { settle(q[0][3], e); } }
|
||||
function step(r) { r.value instanceof __await ? Promise.resolve(r.value.v).then(fulfill, reject) : settle(q[0][2], r); }
|
||||
function fulfill(value) { resume("next", value); }
|
||||
function reject(value) { resume("throw", value); }
|
||||
function settle(f, v) { c = void 0, f(v), next(); }
|
||||
function settle(f, v) { if (f(v), q.shift(), q.length) resume(q[0][0], q[0][1]); }
|
||||
};
|
||||
var o2 = {
|
||||
f: function () {
|
||||
@@ -140,7 +138,7 @@ var o2 = {
|
||||
var x;
|
||||
return __generator(this, function (_a) {
|
||||
switch (_a.label) {
|
||||
case 0: return [4 /*yield*/, ["yield"]];
|
||||
case 0: return [4 /*yield*/];
|
||||
case 1:
|
||||
x = _a.sent();
|
||||
return [2 /*return*/];
|
||||
@@ -177,18 +175,17 @@ var __generator = (this && this.__generator) || function (thisArg, body) {
|
||||
if (op[0] & 5) throw op[1]; return { value: op[0] ? op[1] : void 0, done: true };
|
||||
}
|
||||
};
|
||||
var __await = (this && this.__await) || function (v) { return this instanceof __await ? (this.v = v, this) : new __await(v); }
|
||||
var __asyncGenerator = (this && this.__asyncGenerator) || function (thisArg, _arguments, generator) {
|
||||
if (!Symbol.asyncIterator) throw new TypeError("Symbol.asyncIterator is not defined.");
|
||||
var g = generator.apply(thisArg, _arguments || []), q = [], c, i;
|
||||
return i = { next: verb("next"), "throw": verb("throw"), "return": verb("return") }, i[Symbol.asyncIterator] = function () { return this; }, i;
|
||||
function verb(n) { return function (v) { return new Promise(function (a, b) { q.push([n, v, a, b]), next(); }); }; }
|
||||
function next() { if (!c && q.length) resume((c = q.shift())[0], c[1]); }
|
||||
function resume(n, v) { try { step(g[n](v)); } catch (e) { settle(c[3], e); } }
|
||||
function step(r) { r.done ? settle(c[2], r) : Promise.resolve(r.value[1]).then(r.value[0] === "yield" ? send : fulfill, reject); }
|
||||
function send(value) { settle(c[2], { value: value, done: false }); }
|
||||
var g = generator.apply(thisArg, _arguments || []), i, q = [];
|
||||
return i = {}, verb("next"), verb("throw"), verb("return"), i[Symbol.asyncIterator] = function () { return this; }, i;
|
||||
function verb(n) { if (g[n]) i[n] = function (v) { return new Promise(function (a, b) { q.push([n, v, a, b]) > 1 || resume(n, v); }); }; }
|
||||
function resume(n, v) { try { step(g[n](v)); } catch (e) { settle(q[0][3], e); } }
|
||||
function step(r) { r.value instanceof __await ? Promise.resolve(r.value.v).then(fulfill, reject) : settle(q[0][2], r); }
|
||||
function fulfill(value) { resume("next", value); }
|
||||
function reject(value) { resume("throw", value); }
|
||||
function settle(f, v) { c = void 0, f(v), next(); }
|
||||
function settle(f, v) { if (f(v), q.shift(), q.length) resume(q[0][0], q[0][1]); }
|
||||
};
|
||||
var o3 = {
|
||||
f: function () {
|
||||
@@ -196,7 +193,7 @@ var o3 = {
|
||||
var x;
|
||||
return __generator(this, function (_a) {
|
||||
switch (_a.label) {
|
||||
case 0: return [4 /*yield*/, ["yield", 1]];
|
||||
case 0: return [4 /*yield*/, 1];
|
||||
case 1:
|
||||
x = _a.sent();
|
||||
return [2 /*return*/];
|
||||
@@ -233,28 +230,27 @@ var __generator = (this && this.__generator) || function (thisArg, body) {
|
||||
if (op[0] & 5) throw op[1]; return { value: op[0] ? op[1] : void 0, done: true };
|
||||
}
|
||||
};
|
||||
var __asyncDelegator = (this && this.__asyncDelegator) || function (o) {
|
||||
var i = { next: verb("next"), "throw": verb("throw", function (e) { throw e; }), "return": verb("return", function (v) { return { value: v, done: true }; }) }, p;
|
||||
return o = __asyncValues(o), i[Symbol.iterator] = function () { return this; }, i;
|
||||
function verb(n, f) { return function (v) { return v = p && n === "throw" ? f(v) : p && v.done ? v : { value: p ? ["yield", v.value] : ["await", (o[n] || f).call(o, v)], done: false }, p = !p, v; }; }
|
||||
};
|
||||
var __asyncValues = (this && this.__asyncIterator) || function (o) {
|
||||
if (!Symbol.asyncIterator) throw new TypeError("Symbol.asyncIterator is not defined.");
|
||||
var m = o[Symbol.asyncIterator];
|
||||
return m ? m.call(o) : typeof __values === "function" ? __values(o) : o[Symbol.iterator]();
|
||||
};
|
||||
var __await = (this && this.__await) || function (v) { return this instanceof __await ? (this.v = v, this) : new __await(v); }
|
||||
var __asyncDelegator = (this && this.__asyncDelegator) || function (o) {
|
||||
var i, p;
|
||||
return i = {}, verb("next"), verb("throw", function (e) { throw e; }), verb("return"), i[Symbol.iterator] = function () { return this; }, i;
|
||||
function verb(n, f) { if (o[n]) i[n] = function (v) { return (p = !p) ? { value: __await(o[n](v)), done: n === "return" } : f ? f(v) : v; }; }
|
||||
};
|
||||
var __asyncGenerator = (this && this.__asyncGenerator) || function (thisArg, _arguments, generator) {
|
||||
if (!Symbol.asyncIterator) throw new TypeError("Symbol.asyncIterator is not defined.");
|
||||
var g = generator.apply(thisArg, _arguments || []), q = [], c, i;
|
||||
return i = { next: verb("next"), "throw": verb("throw"), "return": verb("return") }, i[Symbol.asyncIterator] = function () { return this; }, i;
|
||||
function verb(n) { return function (v) { return new Promise(function (a, b) { q.push([n, v, a, b]), next(); }); }; }
|
||||
function next() { if (!c && q.length) resume((c = q.shift())[0], c[1]); }
|
||||
function resume(n, v) { try { step(g[n](v)); } catch (e) { settle(c[3], e); } }
|
||||
function step(r) { r.done ? settle(c[2], r) : Promise.resolve(r.value[1]).then(r.value[0] === "yield" ? send : fulfill, reject); }
|
||||
function send(value) { settle(c[2], { value: value, done: false }); }
|
||||
var g = generator.apply(thisArg, _arguments || []), i, q = [];
|
||||
return i = {}, verb("next"), verb("throw"), verb("return"), i[Symbol.asyncIterator] = function () { return this; }, i;
|
||||
function verb(n) { if (g[n]) i[n] = function (v) { return new Promise(function (a, b) { q.push([n, v, a, b]) > 1 || resume(n, v); }); }; }
|
||||
function resume(n, v) { try { step(g[n](v)); } catch (e) { settle(q[0][3], e); } }
|
||||
function step(r) { r.value instanceof __await ? Promise.resolve(r.value.v).then(fulfill, reject) : settle(q[0][2], r); }
|
||||
function fulfill(value) { resume("next", value); }
|
||||
function reject(value) { resume("throw", value); }
|
||||
function settle(f, v) { c = void 0, f(v), next(); }
|
||||
function settle(f, v) { if (f(v), q.shift(), q.length) resume(q[0][0], q[0][1]); }
|
||||
};
|
||||
var __values = (this && this.__values) || function (o) {
|
||||
var m = typeof Symbol === "function" && o[Symbol.iterator], i = 0;
|
||||
@@ -272,8 +268,9 @@ var o4 = {
|
||||
var x;
|
||||
return __generator(this, function (_a) {
|
||||
switch (_a.label) {
|
||||
case 0: return [5 /*yield**/, __values(__asyncDelegator([1]))];
|
||||
case 1:
|
||||
case 0: return [5 /*yield**/, __values(__asyncDelegator(__asyncValues([1])))];
|
||||
case 1: return [4 /*yield*/, __await.apply(void 0, [_a.sent()])];
|
||||
case 2:
|
||||
x = _a.sent();
|
||||
return [2 /*return*/];
|
||||
}
|
||||
@@ -309,29 +306,28 @@ var __generator = (this && this.__generator) || function (thisArg, body) {
|
||||
if (op[0] & 5) throw op[1]; return { value: op[0] ? op[1] : void 0, done: true };
|
||||
}
|
||||
};
|
||||
var __await = (this && this.__await) || function (v) { return this instanceof __await ? (this.v = v, this) : new __await(v); }
|
||||
var __asyncGenerator = (this && this.__asyncGenerator) || function (thisArg, _arguments, generator) {
|
||||
if (!Symbol.asyncIterator) throw new TypeError("Symbol.asyncIterator is not defined.");
|
||||
var g = generator.apply(thisArg, _arguments || []), q = [], c, i;
|
||||
return i = { next: verb("next"), "throw": verb("throw"), "return": verb("return") }, i[Symbol.asyncIterator] = function () { return this; }, i;
|
||||
function verb(n) { return function (v) { return new Promise(function (a, b) { q.push([n, v, a, b]), next(); }); }; }
|
||||
function next() { if (!c && q.length) resume((c = q.shift())[0], c[1]); }
|
||||
function resume(n, v) { try { step(g[n](v)); } catch (e) { settle(c[3], e); } }
|
||||
function step(r) { r.done ? settle(c[2], r) : Promise.resolve(r.value[1]).then(r.value[0] === "yield" ? send : fulfill, reject); }
|
||||
function send(value) { settle(c[2], { value: value, done: false }); }
|
||||
var g = generator.apply(thisArg, _arguments || []), i, q = [];
|
||||
return i = {}, verb("next"), verb("throw"), verb("return"), i[Symbol.asyncIterator] = function () { return this; }, i;
|
||||
function verb(n) { if (g[n]) i[n] = function (v) { return new Promise(function (a, b) { q.push([n, v, a, b]) > 1 || resume(n, v); }); }; }
|
||||
function resume(n, v) { try { step(g[n](v)); } catch (e) { settle(q[0][3], e); } }
|
||||
function step(r) { r.value instanceof __await ? Promise.resolve(r.value.v).then(fulfill, reject) : settle(q[0][2], r); }
|
||||
function fulfill(value) { resume("next", value); }
|
||||
function reject(value) { resume("throw", value); }
|
||||
function settle(f, v) { c = void 0, f(v), next(); }
|
||||
};
|
||||
var __asyncDelegator = (this && this.__asyncDelegator) || function (o) {
|
||||
var i = { next: verb("next"), "throw": verb("throw", function (e) { throw e; }), "return": verb("return", function (v) { return { value: v, done: true }; }) }, p;
|
||||
return o = __asyncValues(o), i[Symbol.iterator] = function () { return this; }, i;
|
||||
function verb(n, f) { return function (v) { return v = p && n === "throw" ? f(v) : p && v.done ? v : { value: p ? ["yield", v.value] : ["await", (o[n] || f).call(o, v)], done: false }, p = !p, v; }; }
|
||||
function settle(f, v) { if (f(v), q.shift(), q.length) resume(q[0][0], q[0][1]); }
|
||||
};
|
||||
var __asyncValues = (this && this.__asyncIterator) || function (o) {
|
||||
if (!Symbol.asyncIterator) throw new TypeError("Symbol.asyncIterator is not defined.");
|
||||
var m = o[Symbol.asyncIterator];
|
||||
return m ? m.call(o) : typeof __values === "function" ? __values(o) : o[Symbol.iterator]();
|
||||
};
|
||||
var __asyncDelegator = (this && this.__asyncDelegator) || function (o) {
|
||||
var i, p;
|
||||
return i = {}, verb("next"), verb("throw", function (e) { throw e; }), verb("return"), i[Symbol.iterator] = function () { return this; }, i;
|
||||
function verb(n, f) { if (o[n]) i[n] = function (v) { return (p = !p) ? { value: __await(o[n](v)), done: n === "return" } : f ? f(v) : v; }; }
|
||||
};
|
||||
var __values = (this && this.__values) || function (o) {
|
||||
var m = typeof Symbol === "function" && o[Symbol.iterator], i = 0;
|
||||
if (m) return m.call(o);
|
||||
@@ -348,15 +344,16 @@ var o5 = {
|
||||
var x;
|
||||
return __generator(this, function (_a) {
|
||||
switch (_a.label) {
|
||||
case 0: return [5 /*yield**/, __values(__asyncDelegator((function () { return __asyncGenerator(this, arguments, function () { return __generator(this, function (_a) {
|
||||
case 0: return [5 /*yield**/, __values(__asyncDelegator(__asyncValues((function () { return __asyncGenerator(this, arguments, function () { return __generator(this, function (_a) {
|
||||
switch (_a.label) {
|
||||
case 0: return [4 /*yield*/, ["yield", 1]];
|
||||
case 0: return [4 /*yield*/, 1];
|
||||
case 1:
|
||||
_a.sent();
|
||||
return [2 /*return*/];
|
||||
}
|
||||
}); }); })()))];
|
||||
case 1:
|
||||
}); }); })())))];
|
||||
case 1: return [4 /*yield*/, __await.apply(void 0, [_a.sent()])];
|
||||
case 2:
|
||||
x = _a.sent();
|
||||
return [2 /*return*/];
|
||||
}
|
||||
@@ -392,18 +389,17 @@ var __generator = (this && this.__generator) || function (thisArg, body) {
|
||||
if (op[0] & 5) throw op[1]; return { value: op[0] ? op[1] : void 0, done: true };
|
||||
}
|
||||
};
|
||||
var __await = (this && this.__await) || function (v) { return this instanceof __await ? (this.v = v, this) : new __await(v); }
|
||||
var __asyncGenerator = (this && this.__asyncGenerator) || function (thisArg, _arguments, generator) {
|
||||
if (!Symbol.asyncIterator) throw new TypeError("Symbol.asyncIterator is not defined.");
|
||||
var g = generator.apply(thisArg, _arguments || []), q = [], c, i;
|
||||
return i = { next: verb("next"), "throw": verb("throw"), "return": verb("return") }, i[Symbol.asyncIterator] = function () { return this; }, i;
|
||||
function verb(n) { return function (v) { return new Promise(function (a, b) { q.push([n, v, a, b]), next(); }); }; }
|
||||
function next() { if (!c && q.length) resume((c = q.shift())[0], c[1]); }
|
||||
function resume(n, v) { try { step(g[n](v)); } catch (e) { settle(c[3], e); } }
|
||||
function step(r) { r.done ? settle(c[2], r) : Promise.resolve(r.value[1]).then(r.value[0] === "yield" ? send : fulfill, reject); }
|
||||
function send(value) { settle(c[2], { value: value, done: false }); }
|
||||
var g = generator.apply(thisArg, _arguments || []), i, q = [];
|
||||
return i = {}, verb("next"), verb("throw"), verb("return"), i[Symbol.asyncIterator] = function () { return this; }, i;
|
||||
function verb(n) { if (g[n]) i[n] = function (v) { return new Promise(function (a, b) { q.push([n, v, a, b]) > 1 || resume(n, v); }); }; }
|
||||
function resume(n, v) { try { step(g[n](v)); } catch (e) { settle(q[0][3], e); } }
|
||||
function step(r) { r.value instanceof __await ? Promise.resolve(r.value.v).then(fulfill, reject) : settle(q[0][2], r); }
|
||||
function fulfill(value) { resume("next", value); }
|
||||
function reject(value) { resume("throw", value); }
|
||||
function settle(f, v) { c = void 0, f(v), next(); }
|
||||
function settle(f, v) { if (f(v), q.shift(), q.length) resume(q[0][0], q[0][1]); }
|
||||
};
|
||||
var o6 = {
|
||||
f: function () {
|
||||
@@ -411,7 +407,7 @@ var o6 = {
|
||||
var x;
|
||||
return __generator(this, function (_a) {
|
||||
switch (_a.label) {
|
||||
case 0: return [4 /*yield*/, ["await", 1]];
|
||||
case 0: return [4 /*yield*/, __await(1)];
|
||||
case 1:
|
||||
x = _a.sent();
|
||||
return [2 /*return*/];
|
||||
@@ -448,18 +444,17 @@ var __generator = (this && this.__generator) || function (thisArg, body) {
|
||||
if (op[0] & 5) throw op[1]; return { value: op[0] ? op[1] : void 0, done: true };
|
||||
}
|
||||
};
|
||||
var __await = (this && this.__await) || function (v) { return this instanceof __await ? (this.v = v, this) : new __await(v); }
|
||||
var __asyncGenerator = (this && this.__asyncGenerator) || function (thisArg, _arguments, generator) {
|
||||
if (!Symbol.asyncIterator) throw new TypeError("Symbol.asyncIterator is not defined.");
|
||||
var g = generator.apply(thisArg, _arguments || []), q = [], c, i;
|
||||
return i = { next: verb("next"), "throw": verb("throw"), "return": verb("return") }, i[Symbol.asyncIterator] = function () { return this; }, i;
|
||||
function verb(n) { return function (v) { return new Promise(function (a, b) { q.push([n, v, a, b]), next(); }); }; }
|
||||
function next() { if (!c && q.length) resume((c = q.shift())[0], c[1]); }
|
||||
function resume(n, v) { try { step(g[n](v)); } catch (e) { settle(c[3], e); } }
|
||||
function step(r) { r.done ? settle(c[2], r) : Promise.resolve(r.value[1]).then(r.value[0] === "yield" ? send : fulfill, reject); }
|
||||
function send(value) { settle(c[2], { value: value, done: false }); }
|
||||
var g = generator.apply(thisArg, _arguments || []), i, q = [];
|
||||
return i = {}, verb("next"), verb("throw"), verb("return"), i[Symbol.asyncIterator] = function () { return this; }, i;
|
||||
function verb(n) { if (g[n]) i[n] = function (v) { return new Promise(function (a, b) { q.push([n, v, a, b]) > 1 || resume(n, v); }); }; }
|
||||
function resume(n, v) { try { step(g[n](v)); } catch (e) { settle(q[0][3], e); } }
|
||||
function step(r) { r.value instanceof __await ? Promise.resolve(r.value.v).then(fulfill, reject) : settle(q[0][2], r); }
|
||||
function fulfill(value) { resume("next", value); }
|
||||
function reject(value) { resume("throw", value); }
|
||||
function settle(f, v) { c = void 0, f(v), next(); }
|
||||
function settle(f, v) { if (f(v), q.shift(), q.length) resume(q[0][0], q[0][1]); }
|
||||
};
|
||||
var o7 = {
|
||||
f: function () {
|
||||
|
||||
@@ -43,8 +43,8 @@ function f1() {
|
||||
return __awaiter(this, void 0, void 0, function* () {
|
||||
let y;
|
||||
try {
|
||||
for (var y_1 = __asyncValues(y), y_1_1 = yield y_1.next(); !y_1_1.done; y_1_1 = yield y_1.next()) {
|
||||
const x = y_1_1.value;
|
||||
for (var y_1 = __asyncValues(y), y_1_1; y_1_1 = yield y_1.next(), !y_1_1.done;) {
|
||||
const x = yield y_1_1.value;
|
||||
}
|
||||
}
|
||||
catch (e_1_1) { e_1 = { error: e_1_1 }; }
|
||||
@@ -75,8 +75,8 @@ function f2() {
|
||||
return __awaiter(this, void 0, void 0, function* () {
|
||||
let x, y;
|
||||
try {
|
||||
for (var y_1 = __asyncValues(y), y_1_1 = yield y_1.next(); !y_1_1.done; y_1_1 = yield y_1.next()) {
|
||||
x = y_1_1.value;
|
||||
for (var y_1 = __asyncValues(y), y_1_1; y_1_1 = yield y_1.next(), !y_1_1.done;) {
|
||||
x = yield y_1_1.value;
|
||||
}
|
||||
}
|
||||
catch (e_1_1) { e_1 = { error: e_1_1 }; }
|
||||
@@ -95,31 +95,30 @@ var __asyncValues = (this && this.__asyncIterator) || function (o) {
|
||||
var m = o[Symbol.asyncIterator];
|
||||
return m ? m.call(o) : typeof __values === "function" ? __values(o) : o[Symbol.iterator]();
|
||||
};
|
||||
var __await = (this && this.__await) || function (v) { return this instanceof __await ? (this.v = v, this) : new __await(v); }
|
||||
var __asyncGenerator = (this && this.__asyncGenerator) || function (thisArg, _arguments, generator) {
|
||||
if (!Symbol.asyncIterator) throw new TypeError("Symbol.asyncIterator is not defined.");
|
||||
var g = generator.apply(thisArg, _arguments || []), q = [], c, i;
|
||||
return i = { next: verb("next"), "throw": verb("throw"), "return": verb("return") }, i[Symbol.asyncIterator] = function () { return this; }, i;
|
||||
function verb(n) { return function (v) { return new Promise(function (a, b) { q.push([n, v, a, b]), next(); }); }; }
|
||||
function next() { if (!c && q.length) resume((c = q.shift())[0], c[1]); }
|
||||
function resume(n, v) { try { step(g[n](v)); } catch (e) { settle(c[3], e); } }
|
||||
function step(r) { r.done ? settle(c[2], r) : Promise.resolve(r.value[1]).then(r.value[0] === "yield" ? send : fulfill, reject); }
|
||||
function send(value) { settle(c[2], { value: value, done: false }); }
|
||||
var g = generator.apply(thisArg, _arguments || []), i, q = [];
|
||||
return i = {}, verb("next"), verb("throw"), verb("return"), i[Symbol.asyncIterator] = function () { return this; }, i;
|
||||
function verb(n) { if (g[n]) i[n] = function (v) { return new Promise(function (a, b) { q.push([n, v, a, b]) > 1 || resume(n, v); }); }; }
|
||||
function resume(n, v) { try { step(g[n](v)); } catch (e) { settle(q[0][3], e); } }
|
||||
function step(r) { r.value instanceof __await ? Promise.resolve(r.value.v).then(fulfill, reject) : settle(q[0][2], r); }
|
||||
function fulfill(value) { resume("next", value); }
|
||||
function reject(value) { resume("throw", value); }
|
||||
function settle(f, v) { c = void 0, f(v), next(); }
|
||||
function settle(f, v) { if (f(v), q.shift(), q.length) resume(q[0][0], q[0][1]); }
|
||||
};
|
||||
function f3() {
|
||||
return __asyncGenerator(this, arguments, function* f3_1() {
|
||||
let y;
|
||||
try {
|
||||
for (var y_1 = __asyncValues(y), y_1_1 = yield ["await", y_1.next()]; !y_1_1.done; y_1_1 = yield ["await", y_1.next()]) {
|
||||
const x = y_1_1.value;
|
||||
for (var y_1 = __asyncValues(y), y_1_1; y_1_1 = yield __await(y_1.next()), !y_1_1.done;) {
|
||||
const x = yield __await(y_1_1.value);
|
||||
}
|
||||
}
|
||||
catch (e_1_1) { e_1 = { error: e_1_1 }; }
|
||||
finally {
|
||||
try {
|
||||
if (y_1_1 && !y_1_1.done && (_a = y_1.return)) yield ["await", _a.call(y_1)];
|
||||
if (y_1_1 && !y_1_1.done && (_a = y_1.return)) yield __await(_a.call(y_1));
|
||||
}
|
||||
finally { if (e_1) throw e_1.error; }
|
||||
}
|
||||
@@ -132,31 +131,30 @@ var __asyncValues = (this && this.__asyncIterator) || function (o) {
|
||||
var m = o[Symbol.asyncIterator];
|
||||
return m ? m.call(o) : typeof __values === "function" ? __values(o) : o[Symbol.iterator]();
|
||||
};
|
||||
var __await = (this && this.__await) || function (v) { return this instanceof __await ? (this.v = v, this) : new __await(v); }
|
||||
var __asyncGenerator = (this && this.__asyncGenerator) || function (thisArg, _arguments, generator) {
|
||||
if (!Symbol.asyncIterator) throw new TypeError("Symbol.asyncIterator is not defined.");
|
||||
var g = generator.apply(thisArg, _arguments || []), q = [], c, i;
|
||||
return i = { next: verb("next"), "throw": verb("throw"), "return": verb("return") }, i[Symbol.asyncIterator] = function () { return this; }, i;
|
||||
function verb(n) { return function (v) { return new Promise(function (a, b) { q.push([n, v, a, b]), next(); }); }; }
|
||||
function next() { if (!c && q.length) resume((c = q.shift())[0], c[1]); }
|
||||
function resume(n, v) { try { step(g[n](v)); } catch (e) { settle(c[3], e); } }
|
||||
function step(r) { r.done ? settle(c[2], r) : Promise.resolve(r.value[1]).then(r.value[0] === "yield" ? send : fulfill, reject); }
|
||||
function send(value) { settle(c[2], { value: value, done: false }); }
|
||||
var g = generator.apply(thisArg, _arguments || []), i, q = [];
|
||||
return i = {}, verb("next"), verb("throw"), verb("return"), i[Symbol.asyncIterator] = function () { return this; }, i;
|
||||
function verb(n) { if (g[n]) i[n] = function (v) { return new Promise(function (a, b) { q.push([n, v, a, b]) > 1 || resume(n, v); }); }; }
|
||||
function resume(n, v) { try { step(g[n](v)); } catch (e) { settle(q[0][3], e); } }
|
||||
function step(r) { r.value instanceof __await ? Promise.resolve(r.value.v).then(fulfill, reject) : settle(q[0][2], r); }
|
||||
function fulfill(value) { resume("next", value); }
|
||||
function reject(value) { resume("throw", value); }
|
||||
function settle(f, v) { c = void 0, f(v), next(); }
|
||||
function settle(f, v) { if (f(v), q.shift(), q.length) resume(q[0][0], q[0][1]); }
|
||||
};
|
||||
function f4() {
|
||||
return __asyncGenerator(this, arguments, function* f4_1() {
|
||||
let x, y;
|
||||
try {
|
||||
for (var y_1 = __asyncValues(y), y_1_1 = yield ["await", y_1.next()]; !y_1_1.done; y_1_1 = yield ["await", y_1.next()]) {
|
||||
x = y_1_1.value;
|
||||
for (var y_1 = __asyncValues(y), y_1_1; y_1_1 = yield __await(y_1.next()), !y_1_1.done;) {
|
||||
x = yield __await(y_1_1.value);
|
||||
}
|
||||
}
|
||||
catch (e_1_1) { e_1 = { error: e_1_1 }; }
|
||||
finally {
|
||||
try {
|
||||
if (y_1_1 && !y_1_1.done && (_a = y_1.return)) yield ["await", _a.call(y_1)];
|
||||
if (y_1_1 && !y_1_1.done && (_a = y_1.return)) yield __await(_a.call(y_1));
|
||||
}
|
||||
finally { if (e_1) throw e_1.error; }
|
||||
}
|
||||
|
||||
@@ -74,18 +74,15 @@ function f1() {
|
||||
case 0:
|
||||
_b.trys.push([0, 6, 7, 12]);
|
||||
y_1 = __asyncValues(y);
|
||||
return [4 /*yield*/, y_1.next()];
|
||||
case 1:
|
||||
y_1_1 = _b.sent();
|
||||
_b.label = 2;
|
||||
_b.label = 1;
|
||||
case 1: return [4 /*yield*/, y_1.next()];
|
||||
case 2:
|
||||
if (!!y_1_1.done) return [3 /*break*/, 5];
|
||||
x = y_1_1.value;
|
||||
_b.label = 3;
|
||||
case 3: return [4 /*yield*/, y_1.next()];
|
||||
case 4:
|
||||
y_1_1 = _b.sent();
|
||||
return [3 /*break*/, 2];
|
||||
if (!(y_1_1 = _b.sent(), !y_1_1.done)) return [3 /*break*/, 5];
|
||||
return [4 /*yield*/, y_1_1.value];
|
||||
case 3:
|
||||
x = _b.sent();
|
||||
_b.label = 4;
|
||||
case 4: return [3 /*break*/, 1];
|
||||
case 5: return [3 /*break*/, 12];
|
||||
case 6:
|
||||
e_1_1 = _b.sent();
|
||||
@@ -157,18 +154,15 @@ function f2() {
|
||||
case 0:
|
||||
_b.trys.push([0, 6, 7, 12]);
|
||||
y_1 = __asyncValues(y);
|
||||
return [4 /*yield*/, y_1.next()];
|
||||
case 1:
|
||||
y_1_1 = _b.sent();
|
||||
_b.label = 2;
|
||||
_b.label = 1;
|
||||
case 1: return [4 /*yield*/, y_1.next()];
|
||||
case 2:
|
||||
if (!!y_1_1.done) return [3 /*break*/, 5];
|
||||
x = y_1_1.value;
|
||||
_b.label = 3;
|
||||
case 3: return [4 /*yield*/, y_1.next()];
|
||||
case 4:
|
||||
y_1_1 = _b.sent();
|
||||
return [3 /*break*/, 2];
|
||||
if (!(y_1_1 = _b.sent(), !y_1_1.done)) return [3 /*break*/, 5];
|
||||
return [4 /*yield*/, y_1_1.value];
|
||||
case 3:
|
||||
x = _b.sent();
|
||||
_b.label = 4;
|
||||
case 4: return [3 /*break*/, 1];
|
||||
case 5: return [3 /*break*/, 12];
|
||||
case 6:
|
||||
e_1_1 = _b.sent();
|
||||
@@ -224,18 +218,17 @@ var __asyncValues = (this && this.__asyncIterator) || function (o) {
|
||||
var m = o[Symbol.asyncIterator];
|
||||
return m ? m.call(o) : typeof __values === "function" ? __values(o) : o[Symbol.iterator]();
|
||||
};
|
||||
var __await = (this && this.__await) || function (v) { return this instanceof __await ? (this.v = v, this) : new __await(v); }
|
||||
var __asyncGenerator = (this && this.__asyncGenerator) || function (thisArg, _arguments, generator) {
|
||||
if (!Symbol.asyncIterator) throw new TypeError("Symbol.asyncIterator is not defined.");
|
||||
var g = generator.apply(thisArg, _arguments || []), q = [], c, i;
|
||||
return i = { next: verb("next"), "throw": verb("throw"), "return": verb("return") }, i[Symbol.asyncIterator] = function () { return this; }, i;
|
||||
function verb(n) { return function (v) { return new Promise(function (a, b) { q.push([n, v, a, b]), next(); }); }; }
|
||||
function next() { if (!c && q.length) resume((c = q.shift())[0], c[1]); }
|
||||
function resume(n, v) { try { step(g[n](v)); } catch (e) { settle(c[3], e); } }
|
||||
function step(r) { r.done ? settle(c[2], r) : Promise.resolve(r.value[1]).then(r.value[0] === "yield" ? send : fulfill, reject); }
|
||||
function send(value) { settle(c[2], { value: value, done: false }); }
|
||||
var g = generator.apply(thisArg, _arguments || []), i, q = [];
|
||||
return i = {}, verb("next"), verb("throw"), verb("return"), i[Symbol.asyncIterator] = function () { return this; }, i;
|
||||
function verb(n) { if (g[n]) i[n] = function (v) { return new Promise(function (a, b) { q.push([n, v, a, b]) > 1 || resume(n, v); }); }; }
|
||||
function resume(n, v) { try { step(g[n](v)); } catch (e) { settle(q[0][3], e); } }
|
||||
function step(r) { r.value instanceof __await ? Promise.resolve(r.value.v).then(fulfill, reject) : settle(q[0][2], r); }
|
||||
function fulfill(value) { resume("next", value); }
|
||||
function reject(value) { resume("throw", value); }
|
||||
function settle(f, v) { c = void 0, f(v), next(); }
|
||||
function settle(f, v) { if (f(v), q.shift(), q.length) resume(q[0][0], q[0][1]); }
|
||||
};
|
||||
function f3() {
|
||||
return __asyncGenerator(this, arguments, function f3_1() {
|
||||
@@ -245,18 +238,15 @@ function f3() {
|
||||
case 0:
|
||||
_b.trys.push([0, 6, 7, 12]);
|
||||
y_1 = __asyncValues(y);
|
||||
return [4 /*yield*/, ["await", y_1.next()]];
|
||||
case 1:
|
||||
y_1_1 = _b.sent();
|
||||
_b.label = 2;
|
||||
_b.label = 1;
|
||||
case 1: return [4 /*yield*/, __await(y_1.next())];
|
||||
case 2:
|
||||
if (!!y_1_1.done) return [3 /*break*/, 5];
|
||||
x = y_1_1.value;
|
||||
_b.label = 3;
|
||||
case 3: return [4 /*yield*/, ["await", y_1.next()]];
|
||||
case 4:
|
||||
y_1_1 = _b.sent();
|
||||
return [3 /*break*/, 2];
|
||||
if (!(y_1_1 = _b.sent(), !y_1_1.done)) return [3 /*break*/, 5];
|
||||
return [4 /*yield*/, __await(y_1_1.value)];
|
||||
case 3:
|
||||
x = _b.sent();
|
||||
_b.label = 4;
|
||||
case 4: return [3 /*break*/, 1];
|
||||
case 5: return [3 /*break*/, 12];
|
||||
case 6:
|
||||
e_1_1 = _b.sent();
|
||||
@@ -265,7 +255,7 @@ function f3() {
|
||||
case 7:
|
||||
_b.trys.push([7, , 10, 11]);
|
||||
if (!(y_1_1 && !y_1_1.done && (_a = y_1.return))) return [3 /*break*/, 9];
|
||||
return [4 /*yield*/, ["await", _a.call(y_1)]];
|
||||
return [4 /*yield*/, __await(_a.call(y_1))];
|
||||
case 8:
|
||||
_b.sent();
|
||||
_b.label = 9;
|
||||
@@ -312,18 +302,17 @@ var __asyncValues = (this && this.__asyncIterator) || function (o) {
|
||||
var m = o[Symbol.asyncIterator];
|
||||
return m ? m.call(o) : typeof __values === "function" ? __values(o) : o[Symbol.iterator]();
|
||||
};
|
||||
var __await = (this && this.__await) || function (v) { return this instanceof __await ? (this.v = v, this) : new __await(v); }
|
||||
var __asyncGenerator = (this && this.__asyncGenerator) || function (thisArg, _arguments, generator) {
|
||||
if (!Symbol.asyncIterator) throw new TypeError("Symbol.asyncIterator is not defined.");
|
||||
var g = generator.apply(thisArg, _arguments || []), q = [], c, i;
|
||||
return i = { next: verb("next"), "throw": verb("throw"), "return": verb("return") }, i[Symbol.asyncIterator] = function () { return this; }, i;
|
||||
function verb(n) { return function (v) { return new Promise(function (a, b) { q.push([n, v, a, b]), next(); }); }; }
|
||||
function next() { if (!c && q.length) resume((c = q.shift())[0], c[1]); }
|
||||
function resume(n, v) { try { step(g[n](v)); } catch (e) { settle(c[3], e); } }
|
||||
function step(r) { r.done ? settle(c[2], r) : Promise.resolve(r.value[1]).then(r.value[0] === "yield" ? send : fulfill, reject); }
|
||||
function send(value) { settle(c[2], { value: value, done: false }); }
|
||||
var g = generator.apply(thisArg, _arguments || []), i, q = [];
|
||||
return i = {}, verb("next"), verb("throw"), verb("return"), i[Symbol.asyncIterator] = function () { return this; }, i;
|
||||
function verb(n) { if (g[n]) i[n] = function (v) { return new Promise(function (a, b) { q.push([n, v, a, b]) > 1 || resume(n, v); }); }; }
|
||||
function resume(n, v) { try { step(g[n](v)); } catch (e) { settle(q[0][3], e); } }
|
||||
function step(r) { r.value instanceof __await ? Promise.resolve(r.value.v).then(fulfill, reject) : settle(q[0][2], r); }
|
||||
function fulfill(value) { resume("next", value); }
|
||||
function reject(value) { resume("throw", value); }
|
||||
function settle(f, v) { c = void 0, f(v), next(); }
|
||||
function settle(f, v) { if (f(v), q.shift(), q.length) resume(q[0][0], q[0][1]); }
|
||||
};
|
||||
function f4() {
|
||||
return __asyncGenerator(this, arguments, function f4_1() {
|
||||
@@ -333,18 +322,15 @@ function f4() {
|
||||
case 0:
|
||||
_b.trys.push([0, 6, 7, 12]);
|
||||
y_1 = __asyncValues(y);
|
||||
return [4 /*yield*/, ["await", y_1.next()]];
|
||||
case 1:
|
||||
y_1_1 = _b.sent();
|
||||
_b.label = 2;
|
||||
_b.label = 1;
|
||||
case 1: return [4 /*yield*/, __await(y_1.next())];
|
||||
case 2:
|
||||
if (!!y_1_1.done) return [3 /*break*/, 5];
|
||||
x = y_1_1.value;
|
||||
_b.label = 3;
|
||||
case 3: return [4 /*yield*/, ["await", y_1.next()]];
|
||||
case 4:
|
||||
y_1_1 = _b.sent();
|
||||
return [3 /*break*/, 2];
|
||||
if (!(y_1_1 = _b.sent(), !y_1_1.done)) return [3 /*break*/, 5];
|
||||
return [4 /*yield*/, __await(y_1_1.value)];
|
||||
case 3:
|
||||
x = _b.sent();
|
||||
_b.label = 4;
|
||||
case 4: return [3 /*break*/, 1];
|
||||
case 5: return [3 /*break*/, 12];
|
||||
case 6:
|
||||
e_1_1 = _b.sent();
|
||||
@@ -353,7 +339,7 @@ function f4() {
|
||||
case 7:
|
||||
_b.trys.push([7, , 10, 11]);
|
||||
if (!(y_1_1 && !y_1_1.done && (_a = y_1.return))) return [3 /*break*/, 9];
|
||||
return [4 /*yield*/, ["await", _a.call(y_1)]];
|
||||
return [4 /*yield*/, __await(_a.call(y_1))];
|
||||
case 8:
|
||||
_b.sent();
|
||||
_b.label = 9;
|
||||
|
||||
@@ -9,5 +9,5 @@ exports.default = (1 + 2);
|
||||
|
||||
|
||||
//// [es5ExportDefaultExpression.d.ts]
|
||||
declare var _default: number;
|
||||
declare const _default: number;
|
||||
export default _default;
|
||||
|
||||
@@ -7,5 +7,5 @@ export default (1 + 2);
|
||||
|
||||
|
||||
//// [es6ExportDefaultExpression.d.ts]
|
||||
declare var _default: number;
|
||||
declare const _default: number;
|
||||
export default _default;
|
||||
|
||||
@@ -48,6 +48,6 @@ var x1 = es6ImportDefaultBindingFollowedWithNamedImport_0_5.m;
|
||||
export declare var a: number;
|
||||
export declare var x: number;
|
||||
export declare var m: number;
|
||||
declare var _default: {};
|
||||
declare const _default: {};
|
||||
export default _default;
|
||||
//// [es6ImportDefaultBindingFollowedWithNamedImport_1.d.ts]
|
||||
|
||||
+1
-1
@@ -47,7 +47,7 @@ define(["require", "exports", "server", "server", "server", "server", "server"],
|
||||
export declare var a: number;
|
||||
export declare var x: number;
|
||||
export declare var m: number;
|
||||
declare var _default: {};
|
||||
declare const _default: {};
|
||||
export default _default;
|
||||
//// [client.d.ts]
|
||||
export declare var x1: number;
|
||||
|
||||
@@ -1,39 +0,0 @@
|
||||
tests/cases/compiler/FinalClass.ts(4,14): error TS4093: 'extends' clause of exported class 'MyExtendedClass' refers to a type whose name cannot be referenced.
|
||||
|
||||
|
||||
==== tests/cases/compiler/BaseClass.ts (0 errors) ====
|
||||
export type Constructor<T> = new (...args: any[]) => T;
|
||||
|
||||
export class MyBaseClass<T> {
|
||||
baseProperty: string;
|
||||
constructor(value: T) {}
|
||||
}
|
||||
==== tests/cases/compiler/MixinClass.ts (0 errors) ====
|
||||
import { Constructor, MyBaseClass } from './BaseClass';
|
||||
|
||||
export interface MyMixin {
|
||||
mixinProperty: string;
|
||||
}
|
||||
|
||||
export function MyMixin<T extends Constructor<MyBaseClass<any>>>(base: T): T & Constructor<MyMixin> {
|
||||
return class extends base {
|
||||
mixinProperty: string;
|
||||
}
|
||||
}
|
||||
==== tests/cases/compiler/FinalClass.ts (1 errors) ====
|
||||
import { MyBaseClass } from './BaseClass';
|
||||
import { MyMixin } from './MixinClass';
|
||||
|
||||
export class MyExtendedClass extends MyMixin(MyBaseClass)<string> {
|
||||
~~~~~~~~~~~~~~~
|
||||
!!! error TS4093: 'extends' clause of exported class 'MyExtendedClass' refers to a type whose name cannot be referenced.
|
||||
extendedClassProperty: number;
|
||||
}
|
||||
==== tests/cases/compiler/Main.ts (0 errors) ====
|
||||
import { MyExtendedClass } from './FinalClass';
|
||||
import { MyMixin } from './MixinClass';
|
||||
|
||||
const myExtendedClass = new MyExtendedClass('string');
|
||||
|
||||
const AnotherMixedClass = MyMixin(MyExtendedClass);
|
||||
|
||||
@@ -111,4 +111,11 @@ export interface MyMixin {
|
||||
mixinProperty: string;
|
||||
}
|
||||
export declare function MyMixin<T extends Constructor<MyBaseClass<any>>>(base: T): T & Constructor<MyMixin>;
|
||||
//// [FinalClass.d.ts]
|
||||
import { MyBaseClass } from './BaseClass';
|
||||
import { MyMixin } from './MixinClass';
|
||||
declare const MyExtendedClass_base: typeof MyBaseClass & (new (...args: any[]) => MyMixin);
|
||||
export declare class MyExtendedClass extends MyExtendedClass_base<string> {
|
||||
extendedClassProperty: number;
|
||||
}
|
||||
//// [Main.d.ts]
|
||||
|
||||
@@ -0,0 +1,79 @@
|
||||
=== tests/cases/compiler/BaseClass.ts ===
|
||||
export type Constructor<T> = new (...args: any[]) => T;
|
||||
>Constructor : Symbol(Constructor, Decl(BaseClass.ts, 0, 0))
|
||||
>T : Symbol(T, Decl(BaseClass.ts, 0, 24))
|
||||
>args : Symbol(args, Decl(BaseClass.ts, 0, 34))
|
||||
>T : Symbol(T, Decl(BaseClass.ts, 0, 24))
|
||||
|
||||
export class MyBaseClass<T> {
|
||||
>MyBaseClass : Symbol(MyBaseClass, Decl(BaseClass.ts, 0, 55))
|
||||
>T : Symbol(T, Decl(BaseClass.ts, 2, 25))
|
||||
|
||||
baseProperty: string;
|
||||
>baseProperty : Symbol(MyBaseClass.baseProperty, Decl(BaseClass.ts, 2, 29))
|
||||
|
||||
constructor(value: T) {}
|
||||
>value : Symbol(value, Decl(BaseClass.ts, 4, 16))
|
||||
>T : Symbol(T, Decl(BaseClass.ts, 2, 25))
|
||||
}
|
||||
=== tests/cases/compiler/MixinClass.ts ===
|
||||
import { Constructor, MyBaseClass } from './BaseClass';
|
||||
>Constructor : Symbol(Constructor, Decl(MixinClass.ts, 0, 8))
|
||||
>MyBaseClass : Symbol(MyBaseClass, Decl(MixinClass.ts, 0, 21))
|
||||
|
||||
export interface MyMixin {
|
||||
>MyMixin : Symbol(MyMixin, Decl(MixinClass.ts, 0, 55), Decl(MixinClass.ts, 4, 1))
|
||||
|
||||
mixinProperty: string;
|
||||
>mixinProperty : Symbol(MyMixin.mixinProperty, Decl(MixinClass.ts, 2, 26))
|
||||
}
|
||||
|
||||
export function MyMixin<T extends Constructor<MyBaseClass<any>>>(base: T): T & Constructor<MyMixin> {
|
||||
>MyMixin : Symbol(MyMixin, Decl(MixinClass.ts, 0, 55), Decl(MixinClass.ts, 4, 1))
|
||||
>T : Symbol(T, Decl(MixinClass.ts, 6, 24))
|
||||
>Constructor : Symbol(Constructor, Decl(MixinClass.ts, 0, 8))
|
||||
>MyBaseClass : Symbol(MyBaseClass, Decl(MixinClass.ts, 0, 21))
|
||||
>base : Symbol(base, Decl(MixinClass.ts, 6, 65))
|
||||
>T : Symbol(T, Decl(MixinClass.ts, 6, 24))
|
||||
>T : Symbol(T, Decl(MixinClass.ts, 6, 24))
|
||||
>Constructor : Symbol(Constructor, Decl(MixinClass.ts, 0, 8))
|
||||
>MyMixin : Symbol(MyMixin, Decl(MixinClass.ts, 0, 55), Decl(MixinClass.ts, 4, 1))
|
||||
|
||||
return class extends base {
|
||||
>base : Symbol(base, Decl(MixinClass.ts, 6, 65))
|
||||
|
||||
mixinProperty: string;
|
||||
>mixinProperty : Symbol((Anonymous class).mixinProperty, Decl(MixinClass.ts, 7, 31))
|
||||
}
|
||||
}
|
||||
=== tests/cases/compiler/FinalClass.ts ===
|
||||
import { MyBaseClass } from './BaseClass';
|
||||
>MyBaseClass : Symbol(MyBaseClass, Decl(FinalClass.ts, 0, 8))
|
||||
|
||||
import { MyMixin } from './MixinClass';
|
||||
>MyMixin : Symbol(MyMixin, Decl(FinalClass.ts, 1, 8))
|
||||
|
||||
export class MyExtendedClass extends MyMixin(MyBaseClass)<string> {
|
||||
>MyExtendedClass : Symbol(MyExtendedClass, Decl(FinalClass.ts, 1, 39))
|
||||
>MyMixin : Symbol(MyMixin, Decl(FinalClass.ts, 1, 8))
|
||||
>MyBaseClass : Symbol(MyBaseClass, Decl(FinalClass.ts, 0, 8))
|
||||
|
||||
extendedClassProperty: number;
|
||||
>extendedClassProperty : Symbol(MyExtendedClass.extendedClassProperty, Decl(FinalClass.ts, 3, 67))
|
||||
}
|
||||
=== tests/cases/compiler/Main.ts ===
|
||||
import { MyExtendedClass } from './FinalClass';
|
||||
>MyExtendedClass : Symbol(MyExtendedClass, Decl(Main.ts, 0, 8))
|
||||
|
||||
import { MyMixin } from './MixinClass';
|
||||
>MyMixin : Symbol(MyMixin, Decl(Main.ts, 1, 8))
|
||||
|
||||
const myExtendedClass = new MyExtendedClass('string');
|
||||
>myExtendedClass : Symbol(myExtendedClass, Decl(Main.ts, 3, 5))
|
||||
>MyExtendedClass : Symbol(MyExtendedClass, Decl(Main.ts, 0, 8))
|
||||
|
||||
const AnotherMixedClass = MyMixin(MyExtendedClass);
|
||||
>AnotherMixedClass : Symbol(AnotherMixedClass, Decl(Main.ts, 5, 5))
|
||||
>MyMixin : Symbol(MyMixin, Decl(Main.ts, 1, 8))
|
||||
>MyExtendedClass : Symbol(MyExtendedClass, Decl(Main.ts, 0, 8))
|
||||
|
||||
@@ -0,0 +1,84 @@
|
||||
=== tests/cases/compiler/BaseClass.ts ===
|
||||
export type Constructor<T> = new (...args: any[]) => T;
|
||||
>Constructor : Constructor<T>
|
||||
>T : T
|
||||
>args : any[]
|
||||
>T : T
|
||||
|
||||
export class MyBaseClass<T> {
|
||||
>MyBaseClass : MyBaseClass<T>
|
||||
>T : T
|
||||
|
||||
baseProperty: string;
|
||||
>baseProperty : string
|
||||
|
||||
constructor(value: T) {}
|
||||
>value : T
|
||||
>T : T
|
||||
}
|
||||
=== tests/cases/compiler/MixinClass.ts ===
|
||||
import { Constructor, MyBaseClass } from './BaseClass';
|
||||
>Constructor : any
|
||||
>MyBaseClass : typeof MyBaseClass
|
||||
|
||||
export interface MyMixin {
|
||||
>MyMixin : MyMixin
|
||||
|
||||
mixinProperty: string;
|
||||
>mixinProperty : string
|
||||
}
|
||||
|
||||
export function MyMixin<T extends Constructor<MyBaseClass<any>>>(base: T): T & Constructor<MyMixin> {
|
||||
>MyMixin : <T extends Constructor<MyBaseClass<any>>>(base: T) => T & Constructor<MyMixin>
|
||||
>T : T
|
||||
>Constructor : Constructor<T>
|
||||
>MyBaseClass : MyBaseClass<T>
|
||||
>base : T
|
||||
>T : T
|
||||
>T : T
|
||||
>Constructor : Constructor<T>
|
||||
>MyMixin : MyMixin
|
||||
|
||||
return class extends base {
|
||||
>class extends base { mixinProperty: string; } : { new (...args: any[]): (Anonymous class); prototype: MyMixin<any>.(Anonymous class); } & T
|
||||
>base : MyBaseClass<any>
|
||||
|
||||
mixinProperty: string;
|
||||
>mixinProperty : string
|
||||
}
|
||||
}
|
||||
=== tests/cases/compiler/FinalClass.ts ===
|
||||
import { MyBaseClass } from './BaseClass';
|
||||
>MyBaseClass : typeof MyBaseClass
|
||||
|
||||
import { MyMixin } from './MixinClass';
|
||||
>MyMixin : <T extends new (...args: any[]) => MyBaseClass<any>>(base: T) => T & (new (...args: any[]) => MyMixin)
|
||||
|
||||
export class MyExtendedClass extends MyMixin(MyBaseClass)<string> {
|
||||
>MyExtendedClass : MyExtendedClass
|
||||
>MyMixin(MyBaseClass) : MyBaseClass<string> & MyMixin
|
||||
>MyMixin : <T extends new (...args: any[]) => MyBaseClass<any>>(base: T) => T & (new (...args: any[]) => MyMixin)
|
||||
>MyBaseClass : typeof MyBaseClass
|
||||
|
||||
extendedClassProperty: number;
|
||||
>extendedClassProperty : number
|
||||
}
|
||||
=== tests/cases/compiler/Main.ts ===
|
||||
import { MyExtendedClass } from './FinalClass';
|
||||
>MyExtendedClass : typeof MyExtendedClass
|
||||
|
||||
import { MyMixin } from './MixinClass';
|
||||
>MyMixin : <T extends new (...args: any[]) => MyBaseClass<any>>(base: T) => T & (new (...args: any[]) => MyMixin)
|
||||
|
||||
const myExtendedClass = new MyExtendedClass('string');
|
||||
>myExtendedClass : MyExtendedClass
|
||||
>new MyExtendedClass('string') : MyExtendedClass
|
||||
>MyExtendedClass : typeof MyExtendedClass
|
||||
>'string' : "string"
|
||||
|
||||
const AnotherMixedClass = MyMixin(MyExtendedClass);
|
||||
>AnotherMixedClass : typeof MyExtendedClass & (new (...args: any[]) => MyMixin)
|
||||
>MyMixin(MyExtendedClass) : typeof MyExtendedClass & (new (...args: any[]) => MyMixin)
|
||||
>MyMixin : <T extends new (...args: any[]) => MyBaseClass<any>>(base: T) => T & (new (...args: any[]) => MyMixin)
|
||||
>MyExtendedClass : typeof MyExtendedClass
|
||||
|
||||
@@ -0,0 +1,27 @@
|
||||
tests/cases/compiler/main.ts(1,25): error TS2343: This syntax requires an imported helper named '__asyncGenerator', but module 'tslib' has no exported member '__asyncGenerator'.
|
||||
tests/cases/compiler/main.ts(1,25): error TS2343: This syntax requires an imported helper named '__await', but module 'tslib' has no exported member '__await'.
|
||||
tests/cases/compiler/main.ts(1,25): error TS2343: This syntax requires an imported helper named '__generator', but module 'tslib' has no exported member '__generator'.
|
||||
tests/cases/compiler/main.ts(4,5): error TS2343: This syntax requires an imported helper named '__asyncDelegator', but module 'tslib' has no exported member '__asyncDelegator'.
|
||||
tests/cases/compiler/main.ts(4,5): error TS2343: This syntax requires an imported helper named '__asyncValues', but module 'tslib' has no exported member '__asyncValues'.
|
||||
|
||||
|
||||
==== tests/cases/compiler/main.ts (5 errors) ====
|
||||
export async function * f() {
|
||||
~
|
||||
!!! error TS2343: This syntax requires an imported helper named '__asyncGenerator', but module 'tslib' has no exported member '__asyncGenerator'.
|
||||
~
|
||||
!!! error TS2343: This syntax requires an imported helper named '__await', but module 'tslib' has no exported member '__await'.
|
||||
~
|
||||
!!! error TS2343: This syntax requires an imported helper named '__generator', but module 'tslib' has no exported member '__generator'.
|
||||
await 1;
|
||||
yield 2;
|
||||
yield* [3];
|
||||
~~~~~~~~~~
|
||||
!!! error TS2343: This syntax requires an imported helper named '__asyncDelegator', but module 'tslib' has no exported member '__asyncDelegator'.
|
||||
~~~~~~~~~~
|
||||
!!! error TS2343: This syntax requires an imported helper named '__asyncValues', but module 'tslib' has no exported member '__asyncValues'.
|
||||
}
|
||||
|
||||
==== tests/cases/compiler/tslib.d.ts (0 errors) ====
|
||||
export {}
|
||||
|
||||
@@ -0,0 +1,37 @@
|
||||
//// [tests/cases/compiler/importHelpersNoHelpersForAsyncGenerators.ts] ////
|
||||
|
||||
//// [main.ts]
|
||||
export async function * f() {
|
||||
await 1;
|
||||
yield 2;
|
||||
yield* [3];
|
||||
}
|
||||
|
||||
//// [tslib.d.ts]
|
||||
export {}
|
||||
|
||||
|
||||
//// [main.js]
|
||||
"use strict";
|
||||
Object.defineProperty(exports, "__esModule", { value: true });
|
||||
var tslib_1 = require("tslib");
|
||||
function f() {
|
||||
return tslib_1.__asyncGenerator(this, arguments, function f_1() {
|
||||
return tslib_1.__generator(this, function (_a) {
|
||||
switch (_a.label) {
|
||||
case 0: return [4 /*yield*/, tslib_1.__await(1)];
|
||||
case 1:
|
||||
_a.sent();
|
||||
return [4 /*yield*/, 2];
|
||||
case 2:
|
||||
_a.sent();
|
||||
return [5 /*yield**/, tslib_1.__values(tslib_1.__asyncDelegator(tslib_1.__asyncValues([3])))];
|
||||
case 3: return [4 /*yield*/, tslib_1.__await.apply(void 0, [_a.sent()])];
|
||||
case 4:
|
||||
_a.sent();
|
||||
return [2 /*return*/];
|
||||
}
|
||||
});
|
||||
});
|
||||
}
|
||||
exports.f = f;
|
||||
Some files were not shown because too many files have changed in this diff Show More
Reference in New Issue
Block a user