mirror of
https://github.com/microsoft/TypeScript.git
synced 2025-11-18 17:21:48 +00:00
Merge branch 'master' into mergedDeclarationClassInterface
This commit is contained in:
@@ -123,6 +123,7 @@ var harnessSources = [
|
||||
return path.join(harnessDirectory, f);
|
||||
}).concat([
|
||||
"incrementalParser.ts",
|
||||
"jsDocParsing.ts",
|
||||
"services/colorization.ts",
|
||||
"services/documentRegistry.ts",
|
||||
"services/preProcessFile.ts",
|
||||
|
||||
+1
-1
@@ -2,7 +2,7 @@
|
||||
"name": "typescript",
|
||||
"author": "Microsoft Corp.",
|
||||
"homepage": "http://typescriptlang.org/",
|
||||
"version": "1.5.2",
|
||||
"version": "1.5.3",
|
||||
"license": "Apache-2.0",
|
||||
"description": "TypeScript is a language for application scale JavaScript development",
|
||||
"keywords": [
|
||||
|
||||
@@ -539,17 +539,17 @@ module ts {
|
||||
bindBlockScopedDeclaration(<Declaration>node, SymbolFlags.Class, isAmbientContext(node) ? SymbolFlags.AmbientClassExcludes : SymbolFlags.ClassExcludes);
|
||||
break;
|
||||
case SyntaxKind.InterfaceDeclaration:
|
||||
bindDeclaration(<Declaration>node, SymbolFlags.Interface, SymbolFlags.InterfaceExcludes, /*isBlockScopeContainer*/ false);
|
||||
bindBlockScopedDeclaration(<Declaration>node, SymbolFlags.Interface, SymbolFlags.InterfaceExcludes);
|
||||
break;
|
||||
case SyntaxKind.TypeAliasDeclaration:
|
||||
bindDeclaration(<Declaration>node, SymbolFlags.TypeAlias, SymbolFlags.TypeAliasExcludes, /*isBlockScopeContainer*/ false);
|
||||
bindBlockScopedDeclaration(<Declaration>node, SymbolFlags.TypeAlias, SymbolFlags.TypeAliasExcludes);
|
||||
break;
|
||||
case SyntaxKind.EnumDeclaration:
|
||||
if (isConst(node)) {
|
||||
bindDeclaration(<Declaration>node, SymbolFlags.ConstEnum, SymbolFlags.ConstEnumExcludes, /*isBlockScopeContainer*/ false);
|
||||
bindBlockScopedDeclaration(<Declaration>node, SymbolFlags.ConstEnum, SymbolFlags.ConstEnumExcludes);
|
||||
}
|
||||
else {
|
||||
bindDeclaration(<Declaration>node, SymbolFlags.RegularEnum, SymbolFlags.RegularEnumExcludes, /*isBlockScopeContainer*/ false);
|
||||
bindBlockScopedDeclaration(<Declaration>node, SymbolFlags.RegularEnum, SymbolFlags.RegularEnumExcludes);
|
||||
}
|
||||
break;
|
||||
case SyntaxKind.ModuleDeclaration:
|
||||
|
||||
+529
-277
File diff suppressed because it is too large
Load Diff
+15
-2
@@ -129,6 +129,16 @@ module ts {
|
||||
}
|
||||
}
|
||||
|
||||
export function rangeEquals<T>(array1: T[], array2: T[], pos: number, end: number) {
|
||||
while (pos < end) {
|
||||
if (array1[pos] !== array2[pos]) {
|
||||
return false;
|
||||
}
|
||||
pos++;
|
||||
}
|
||||
return true;
|
||||
}
|
||||
|
||||
/**
|
||||
* Returns the last element of an array if non-empty, undefined otherwise.
|
||||
*/
|
||||
@@ -312,8 +322,11 @@ module ts {
|
||||
|
||||
Debug.assert(start >= 0, "start must be non-negative, is " + start);
|
||||
Debug.assert(length >= 0, "length must be non-negative, is " + length);
|
||||
Debug.assert(start <= file.text.length, `start must be within the bounds of the file. ${ start } > ${ file.text.length }`);
|
||||
Debug.assert(end <= file.text.length, `end must be the bounds of the file. ${ end } > ${ file.text.length }`);
|
||||
|
||||
if (file) {
|
||||
Debug.assert(start <= file.text.length, `start must be within the bounds of the file. ${ start } > ${ file.text.length }`);
|
||||
Debug.assert(end <= file.text.length, `end must be the bounds of the file. ${ end } > ${ file.text.length }`);
|
||||
}
|
||||
|
||||
let text = getLocaleSpecificMessage(message.key);
|
||||
|
||||
|
||||
@@ -120,7 +120,7 @@ module ts {
|
||||
Unterminated_template_literal: { code: 1160, category: DiagnosticCategory.Error, key: "Unterminated template literal." },
|
||||
Unterminated_regular_expression_literal: { code: 1161, category: DiagnosticCategory.Error, key: "Unterminated regular expression literal." },
|
||||
An_object_member_cannot_be_declared_optional: { code: 1162, category: DiagnosticCategory.Error, key: "An object member cannot be declared optional." },
|
||||
yield_expression_must_be_contained_within_a_generator_declaration: { code: 1163, category: DiagnosticCategory.Error, key: "'yield' expression must be contained_within a generator declaration." },
|
||||
A_yield_expression_is_only_allowed_in_a_generator_body: { code: 1163, category: DiagnosticCategory.Error, key: "A 'yield' expression is only allowed in a generator body." },
|
||||
Computed_property_names_are_not_allowed_in_enums: { code: 1164, category: DiagnosticCategory.Error, key: "Computed property names are not allowed in enums." },
|
||||
A_computed_property_name_in_an_ambient_context_must_directly_refer_to_a_built_in_symbol: { code: 1165, category: DiagnosticCategory.Error, key: "A computed property name in an ambient context must directly refer to a built-in symbol." },
|
||||
A_computed_property_name_in_a_class_property_declaration_must_directly_refer_to_a_built_in_symbol: { code: 1166, category: DiagnosticCategory.Error, key: "A computed property name in a class property declaration must directly refer to a built-in symbol." },
|
||||
@@ -174,6 +174,10 @@ module ts {
|
||||
Type_expected_0_is_a_reserved_word_in_strict_mode: { code: 1215, category: DiagnosticCategory.Error, key: "Type expected. '{0}' is a reserved word in strict mode" },
|
||||
Type_expected_0_is_a_reserved_word_in_strict_mode_Class_definitions_are_automatically_in_strict_mode: { code: 1216, category: DiagnosticCategory.Error, key: "Type expected. '{0}' is a reserved word in strict mode. Class definitions are automatically in strict mode." },
|
||||
Export_assignment_is_not_supported_when_module_flag_is_system: { code: 1218, category: DiagnosticCategory.Error, key: "Export assignment is not supported when '--module' flag is 'system'." },
|
||||
Generators_are_only_available_when_targeting_ECMAScript_6_or_higher: { code: 1219, category: DiagnosticCategory.Error, key: "Generators are only available when targeting ECMAScript 6 or higher." },
|
||||
Generators_are_not_allowed_in_an_ambient_context: { code: 1220, category: DiagnosticCategory.Error, key: "Generators are not allowed in an ambient context." },
|
||||
An_overload_signature_cannot_be_declared_as_a_generator: { code: 1221, category: DiagnosticCategory.Error, key: "An overload signature cannot be declared as a generator." },
|
||||
_0_tag_already_specified: { code: 1222, category: DiagnosticCategory.Error, key: "'{0}' tag already specified." },
|
||||
Duplicate_identifier_0: { code: 2300, category: DiagnosticCategory.Error, key: "Duplicate identifier '{0}'." },
|
||||
Initializer_of_instance_member_variable_0_cannot_reference_identifier_1_declared_in_the_constructor: { code: 2301, category: DiagnosticCategory.Error, key: "Initializer of instance member variable '{0}' cannot reference identifier '{1}' declared in the constructor." },
|
||||
Static_members_cannot_reference_class_type_parameters: { code: 2302, category: DiagnosticCategory.Error, key: "Static members cannot reference class type parameters." },
|
||||
@@ -365,6 +369,8 @@ module ts {
|
||||
A_rest_element_cannot_contain_a_binding_pattern: { code: 2501, category: DiagnosticCategory.Error, key: "A rest element cannot contain a binding pattern." },
|
||||
_0_is_referenced_directly_or_indirectly_in_its_own_type_annotation: { code: 2502, category: DiagnosticCategory.Error, key: "'{0}' is referenced directly or indirectly in its own type annotation." },
|
||||
Cannot_find_namespace_0: { code: 2503, category: DiagnosticCategory.Error, key: "Cannot find namespace '{0}'." },
|
||||
No_best_common_type_exists_among_yield_expressions: { code: 2504, category: DiagnosticCategory.Error, key: "No best common type exists among yield expressions." },
|
||||
A_generator_cannot_have_a_void_type_annotation: { code: 2505, category: DiagnosticCategory.Error, key: "A generator cannot have a 'void' type annotation." },
|
||||
Import_declaration_0_is_using_private_name_1: { code: 4000, category: DiagnosticCategory.Error, key: "Import declaration '{0}' is using private name '{1}'." },
|
||||
Type_parameter_0_of_exported_class_has_or_is_using_private_name_1: { code: 4002, category: DiagnosticCategory.Error, key: "Type parameter '{0}' of exported class has or is using private name '{1}'." },
|
||||
Type_parameter_0_of_exported_interface_has_or_is_using_private_name_1: { code: 4004, category: DiagnosticCategory.Error, key: "Type parameter '{0}' of exported interface has or is using private name '{1}'." },
|
||||
@@ -522,6 +528,7 @@ module ts {
|
||||
_0_implicitly_has_type_any_because_it_is_does_not_have_a_type_annotation_and_is_referenced_directly_or_indirectly_in_its_own_initializer: { code: 7022, category: DiagnosticCategory.Error, key: "'{0}' implicitly has type 'any' because it is does not have a type annotation and is referenced directly or indirectly in its own initializer." },
|
||||
_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: { code: 7023, category: DiagnosticCategory.Error, key: "'{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." },
|
||||
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: { code: 7024, category: DiagnosticCategory.Error, key: "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." },
|
||||
Generator_implicitly_has_type_0_because_it_does_not_yield_any_values_Consider_supplying_a_return_type: { code: 7025, category: DiagnosticCategory.Error, key: "Generator implicitly has type '{0}' because it does not yield any values. Consider supplying a return type." },
|
||||
You_cannot_rename_this_element: { code: 8000, category: DiagnosticCategory.Error, key: "You cannot rename this element." },
|
||||
You_cannot_rename_elements_that_are_defined_in_the_standard_TypeScript_library: { code: 8001, category: DiagnosticCategory.Error, key: "You cannot rename elements that are defined in the standard TypeScript library." },
|
||||
import_can_only_be_used_in_a_ts_file: { code: 8002, category: DiagnosticCategory.Error, key: "'import ... =' can only be used in a .ts file." },
|
||||
@@ -535,15 +542,11 @@ module ts {
|
||||
types_can_only_be_used_in_a_ts_file: { code: 8010, category: DiagnosticCategory.Error, key: "'types' can only be used in a .ts file." },
|
||||
type_arguments_can_only_be_used_in_a_ts_file: { code: 8011, category: DiagnosticCategory.Error, key: "'type arguments' can only be used in a .ts file." },
|
||||
parameter_modifiers_can_only_be_used_in_a_ts_file: { code: 8012, category: DiagnosticCategory.Error, key: "'parameter modifiers' can only be used in a .ts file." },
|
||||
can_only_be_used_in_a_ts_file: { code: 8013, category: DiagnosticCategory.Error, key: "'?' can only be used in a .ts file." },
|
||||
property_declarations_can_only_be_used_in_a_ts_file: { code: 8014, category: DiagnosticCategory.Error, key: "'property declarations' can only be used in a .ts file." },
|
||||
enum_declarations_can_only_be_used_in_a_ts_file: { code: 8015, category: DiagnosticCategory.Error, key: "'enum declarations' can only be used in a .ts file." },
|
||||
type_assertion_expressions_can_only_be_used_in_a_ts_file: { code: 8016, category: DiagnosticCategory.Error, key: "'type assertion expressions' can only be used in a .ts file." },
|
||||
decorators_can_only_be_used_in_a_ts_file: { code: 8017, category: DiagnosticCategory.Error, key: "'decorators' can only be used in a .ts file." },
|
||||
yield_expressions_are_not_currently_supported: { code: 9000, category: DiagnosticCategory.Error, key: "'yield' expressions are not currently supported." },
|
||||
Generators_are_not_currently_supported: { code: 9001, category: DiagnosticCategory.Error, key: "Generators are not currently supported." },
|
||||
Only_identifiers_Slashqualified_names_with_optional_type_arguments_are_currently_supported_in_a_class_extends_clauses: { code: 9002, category: DiagnosticCategory.Error, key: "Only identifiers/qualified-names with optional type arguments are currently supported in a class 'extends' clauses." },
|
||||
class_expressions_are_not_currently_supported: { code: 9003, category: DiagnosticCategory.Error, key: "'class' expressions are not currently supported." },
|
||||
class_declarations_are_only_supported_directly_inside_a_module_or_as_a_top_level_declaration: { code: 9004, category: DiagnosticCategory.Error, key: "'class' declarations are only supported directly inside a module or as a top level declaration." },
|
||||
};
|
||||
}
|
||||
@@ -467,7 +467,7 @@
|
||||
"category": "Error",
|
||||
"code": 1162
|
||||
},
|
||||
"'yield' expression must be contained_within a generator declaration.": {
|
||||
"A 'yield' expression is only allowed in a generator body.": {
|
||||
"category": "Error",
|
||||
"code": 1163
|
||||
},
|
||||
@@ -682,8 +682,25 @@
|
||||
"Export assignment is not supported when '--module' flag is 'system'.": {
|
||||
"category": "Error",
|
||||
"code": 1218
|
||||
},
|
||||
"Generators are only available when targeting ECMAScript 6 or higher.": {
|
||||
"category": "Error",
|
||||
"code": 1219
|
||||
},
|
||||
"Generators are not allowed in an ambient context.": {
|
||||
"category": "Error",
|
||||
"code": 1220
|
||||
},
|
||||
"An overload signature cannot be declared as a generator.": {
|
||||
"category": "Error",
|
||||
"code": 1221
|
||||
},
|
||||
|
||||
|
||||
"'{0}' tag already specified.": {
|
||||
"category": "Error",
|
||||
"code": 1222
|
||||
},
|
||||
"Duplicate identifier '{0}'.": {
|
||||
"category": "Error",
|
||||
"code": 2300
|
||||
@@ -1439,15 +1456,23 @@
|
||||
"A rest element cannot contain a binding pattern.": {
|
||||
"category": "Error",
|
||||
"code": 2501
|
||||
},
|
||||
},
|
||||
"'{0}' is referenced directly or indirectly in its own type annotation.": {
|
||||
"category": "Error",
|
||||
"code": 2502
|
||||
},
|
||||
},
|
||||
"Cannot find namespace '{0}'.": {
|
||||
"category": "Error",
|
||||
"code": 2503
|
||||
},
|
||||
"No best common type exists among yield expressions.": {
|
||||
"category": "Error",
|
||||
"code": 2504
|
||||
},
|
||||
"A generator cannot have a 'void' type annotation.": {
|
||||
"category": "Error",
|
||||
"code": 2505
|
||||
},
|
||||
|
||||
"Import declaration '{0}' is using private name '{1}'.": {
|
||||
"category": "Error",
|
||||
@@ -2080,6 +2105,10 @@
|
||||
"category": "Error",
|
||||
"code": 7024
|
||||
},
|
||||
"Generator implicitly has type '{0}' because it does not yield any values. Consider supplying a return type.": {
|
||||
"category": "Error",
|
||||
"code": 7025
|
||||
},
|
||||
"You cannot rename this element.": {
|
||||
"category": "Error",
|
||||
"code": 8000
|
||||
@@ -2132,10 +2161,6 @@
|
||||
"category": "Error",
|
||||
"code": 8012
|
||||
},
|
||||
"'?' can only be used in a .ts file.": {
|
||||
"category": "Error",
|
||||
"code": 8013
|
||||
},
|
||||
"'property declarations' can only be used in a .ts file.": {
|
||||
"category": "Error",
|
||||
"code": 8014
|
||||
@@ -2153,14 +2178,6 @@
|
||||
"code": 8017
|
||||
},
|
||||
|
||||
"'yield' expressions are not currently supported.": {
|
||||
"category": "Error",
|
||||
"code": 9000
|
||||
},
|
||||
"Generators are not currently supported.": {
|
||||
"category": "Error",
|
||||
"code": 9001
|
||||
},
|
||||
"Only identifiers/qualified-names with optional type arguments are currently supported in a class 'extends' clauses.": {
|
||||
"category": "Error",
|
||||
"code": 9002
|
||||
@@ -2168,9 +2185,5 @@
|
||||
"'class' expressions are not currently supported.": {
|
||||
"category": "Error",
|
||||
"code": 9003
|
||||
},
|
||||
"'class' declarations are only supported directly inside a module or as a top level declaration.": {
|
||||
"category": "Error",
|
||||
"code": 9004
|
||||
}
|
||||
}
|
||||
|
||||
+1085
-339
File diff suppressed because it is too large
Load Diff
+20
-6
@@ -598,12 +598,26 @@ module ts {
|
||||
ch > CharacterCodes.maxAsciiCharacter && isUnicodeIdentifierPart(ch, languageVersion);
|
||||
}
|
||||
|
||||
/** Creates a scanner over a (possibly unspecified) range of a piece of text. */
|
||||
export function createScanner(languageVersion: ScriptTarget, skipTrivia: boolean, text?: string, onError?: ErrorCallback, start?: number, length?: number): Scanner {
|
||||
let pos: number; // Current position (end position of text of current token)
|
||||
let end: number; // end of text
|
||||
let startPos: number; // Start position of whitespace before current token
|
||||
let tokenPos: number; // Start position of text of current token
|
||||
/* @internal */
|
||||
// Creates a scanner over a (possibly unspecified) range of a piece of text.
|
||||
export function createScanner(languageVersion: ScriptTarget,
|
||||
skipTrivia: boolean,
|
||||
text?: string,
|
||||
onError?: ErrorCallback,
|
||||
start?: number,
|
||||
length?: number): Scanner {
|
||||
// Current position (end position of text of current token)
|
||||
let pos: number;
|
||||
|
||||
// end of text
|
||||
let end: number;
|
||||
|
||||
// Start position of whitespace before current token
|
||||
let startPos: number;
|
||||
|
||||
// Start position of text of current token
|
||||
let tokenPos: number;
|
||||
|
||||
let token: SyntaxKind;
|
||||
let tokenValue: string;
|
||||
let precedingLineBreak: boolean;
|
||||
|
||||
+1
-1
@@ -231,7 +231,7 @@ module ts {
|
||||
var directories: string[] = [];
|
||||
for (let current of files) {
|
||||
var name = combinePaths(path, current);
|
||||
var stat = _fs.lstatSync(name);
|
||||
var stat = _fs.statSync(name);
|
||||
if (stat.isFile()) {
|
||||
if (!extension || fileExtensionIs(name, extension)) {
|
||||
result.push(name);
|
||||
|
||||
+156
-14
@@ -270,6 +270,32 @@ module ts {
|
||||
// Top-level nodes
|
||||
SourceFile,
|
||||
|
||||
// JSDoc nodes.
|
||||
JSDocTypeExpression,
|
||||
// The * type.
|
||||
JSDocAllType,
|
||||
// The ? type.
|
||||
JSDocUnknownType,
|
||||
JSDocArrayType,
|
||||
JSDocUnionType,
|
||||
JSDocTupleType,
|
||||
JSDocNullableType,
|
||||
JSDocNonNullableType,
|
||||
JSDocRecordType,
|
||||
JSDocRecordMember,
|
||||
JSDocTypeReference,
|
||||
JSDocOptionalType,
|
||||
JSDocFunctionType,
|
||||
JSDocVariadicType,
|
||||
JSDocConstructorType,
|
||||
JSDocThisType,
|
||||
JSDocComment,
|
||||
JSDocTag,
|
||||
JSDocParameterTag,
|
||||
JSDocReturnTag,
|
||||
JSDocTypeTag,
|
||||
JSDocTemplateTag,
|
||||
|
||||
// Synthesized list
|
||||
SyntaxList,
|
||||
// Enum value count
|
||||
@@ -324,6 +350,8 @@ module ts {
|
||||
|
||||
/* @internal */
|
||||
export const enum ParserContextFlags {
|
||||
None = 0,
|
||||
|
||||
// Set if this node was parsed in strict mode. Used for grammar error checks, as well as
|
||||
// checking if the node can be reused in incremental settings.
|
||||
StrictMode = 1 << 0,
|
||||
@@ -345,6 +373,10 @@ module ts {
|
||||
// error.
|
||||
ThisNodeHasError = 1 << 5,
|
||||
|
||||
// This node was parsed in a JavaScript file and can be processed differently. For example
|
||||
// its type can be specified usign a JSDoc comment.
|
||||
JavaScriptFile = 1 << 6,
|
||||
|
||||
// Context flags set directly by the parser.
|
||||
ParserGeneratedFlags = StrictMode | DisallowIn | Yield | GeneratorParameter | Decorator | ThisNodeHasError,
|
||||
|
||||
@@ -352,10 +384,10 @@ module ts {
|
||||
|
||||
// Used during incremental parsing to determine if this node or any of its children had an
|
||||
// error. Computed only once and then cached.
|
||||
ThisNodeOrAnySubNodesHasError = 1 << 6,
|
||||
ThisNodeOrAnySubNodesHasError = 1 << 7,
|
||||
|
||||
// Used to know if we've computed data from children and cached it in this node.
|
||||
HasAggregatedChildData = 1 << 7
|
||||
HasAggregatedChildData = 1 << 8
|
||||
}
|
||||
|
||||
/* @internal */
|
||||
@@ -371,14 +403,15 @@ module ts {
|
||||
// Specific context the parser was in when this node was created. Normally undefined.
|
||||
// Only set when the parser was in some interesting context (like async/yield).
|
||||
/* @internal */ parserContextFlags?: ParserContextFlags;
|
||||
decorators?: NodeArray<Decorator>; // Array of decorators (in document order)
|
||||
modifiers?: ModifiersArray; // Array of modifiers
|
||||
/* @internal */ id?: number; // Unique id (used to look up NodeLinks)
|
||||
parent?: Node; // Parent node (initialized by binding)
|
||||
/* @internal */ symbol?: Symbol; // Symbol declared by node (initialized by binding)
|
||||
/* @internal */ locals?: SymbolTable; // Locals associated with node (initialized by binding)
|
||||
/* @internal */ nextContainer?: Node; // Next container in declaration order (initialized by binding)
|
||||
/* @internal */ localSymbol?: Symbol; // Local symbol declared by node (initialized by binding only for exported nodes)
|
||||
decorators?: NodeArray<Decorator>; // Array of decorators (in document order)
|
||||
modifiers?: ModifiersArray; // Array of modifiers
|
||||
/* @internal */ id?: number; // Unique id (used to look up NodeLinks)
|
||||
parent?: Node; // Parent node (initialized by binding
|
||||
/* @internal */ jsDocComment?: JSDocComment; // JSDoc for the node, if it has any. Only for .js files.
|
||||
/* @internal */ symbol?: Symbol; // Symbol declared by node (initialized by binding)
|
||||
/* @internal */ locals?: SymbolTable; // Locals associated with node (initialized by binding)
|
||||
/* @internal */ nextContainer?: Node; // Next container in declaration order (initialized by binding)
|
||||
/* @internal */ localSymbol?: Symbol; // Local symbol declared by node (initialized by binding only for exported nodes)
|
||||
}
|
||||
|
||||
export interface NodeArray<T> extends Array<T>, TextRange {
|
||||
@@ -660,7 +693,7 @@ module ts {
|
||||
|
||||
export interface YieldExpression extends Expression {
|
||||
asteriskToken?: Node;
|
||||
expression: Expression;
|
||||
expression?: Expression;
|
||||
}
|
||||
|
||||
export interface BinaryExpression extends Expression {
|
||||
@@ -884,7 +917,7 @@ module ts {
|
||||
_classElementBrand: any;
|
||||
}
|
||||
|
||||
export interface InterfaceDeclaration extends Declaration, ModuleElement {
|
||||
export interface InterfaceDeclaration extends Declaration, Statement {
|
||||
name: Identifier;
|
||||
typeParameters?: NodeArray<TypeParameterDeclaration>;
|
||||
heritageClauses?: NodeArray<HeritageClause>;
|
||||
@@ -896,7 +929,7 @@ module ts {
|
||||
types?: NodeArray<ExpressionWithTypeArguments>;
|
||||
}
|
||||
|
||||
export interface TypeAliasDeclaration extends Declaration, ModuleElement {
|
||||
export interface TypeAliasDeclaration extends Declaration, Statement {
|
||||
name: Identifier;
|
||||
type: TypeNode;
|
||||
}
|
||||
@@ -908,7 +941,7 @@ module ts {
|
||||
initializer?: Expression;
|
||||
}
|
||||
|
||||
export interface EnumDeclaration extends Declaration, ModuleElement {
|
||||
export interface EnumDeclaration extends Declaration, Statement {
|
||||
name: Identifier;
|
||||
members: NodeArray<EnumMember>;
|
||||
}
|
||||
@@ -992,6 +1025,106 @@ module ts {
|
||||
kind: SyntaxKind;
|
||||
}
|
||||
|
||||
// represents a top level: { type } expression in a JSDoc comment.
|
||||
export interface JSDocTypeExpression extends Node {
|
||||
type: JSDocType;
|
||||
}
|
||||
|
||||
export interface JSDocType extends TypeNode {
|
||||
_jsDocTypeBrand: any;
|
||||
}
|
||||
|
||||
export interface JSDocAllType extends JSDocType {
|
||||
_JSDocAllTypeBrand: any;
|
||||
}
|
||||
|
||||
export interface JSDocUnknownType extends JSDocType {
|
||||
_JSDocUnknownTypeBrand: any;
|
||||
}
|
||||
|
||||
export interface JSDocArrayType extends JSDocType {
|
||||
elementType: JSDocType;
|
||||
}
|
||||
|
||||
export interface JSDocUnionType extends JSDocType {
|
||||
types: NodeArray<JSDocType>;
|
||||
}
|
||||
|
||||
export interface JSDocTupleType extends JSDocType {
|
||||
types: NodeArray<JSDocType>;
|
||||
}
|
||||
|
||||
export interface JSDocNonNullableType extends JSDocType {
|
||||
type: JSDocType;
|
||||
}
|
||||
|
||||
export interface JSDocNullableType extends JSDocType {
|
||||
type: JSDocType;
|
||||
}
|
||||
|
||||
export interface JSDocRecordType extends JSDocType, TypeLiteralNode {
|
||||
members: NodeArray<JSDocRecordMember>;
|
||||
}
|
||||
|
||||
export interface JSDocTypeReference extends JSDocType {
|
||||
name: EntityName;
|
||||
typeArguments: NodeArray<JSDocType>
|
||||
}
|
||||
|
||||
export interface JSDocOptionalType extends JSDocType {
|
||||
type: JSDocType;
|
||||
}
|
||||
|
||||
export interface JSDocFunctionType extends JSDocType, SignatureDeclaration {
|
||||
parameters: NodeArray<ParameterDeclaration>;
|
||||
type: JSDocType;
|
||||
}
|
||||
|
||||
export interface JSDocVariadicType extends JSDocType {
|
||||
type: JSDocType;
|
||||
}
|
||||
|
||||
export interface JSDocConstructorType extends JSDocType {
|
||||
type: JSDocType;
|
||||
}
|
||||
|
||||
export interface JSDocThisType extends JSDocType {
|
||||
type: JSDocType;
|
||||
}
|
||||
|
||||
export interface JSDocRecordMember extends PropertyDeclaration {
|
||||
name: Identifier | LiteralExpression,
|
||||
type?: JSDocType
|
||||
}
|
||||
|
||||
export interface JSDocComment extends Node {
|
||||
tags: NodeArray<JSDocTag>;
|
||||
}
|
||||
|
||||
export interface JSDocTag extends Node {
|
||||
atToken: Node;
|
||||
tagName: Identifier;
|
||||
}
|
||||
|
||||
export interface JSDocTemplateTag extends JSDocTag {
|
||||
typeParameters: NodeArray<TypeParameterDeclaration>;
|
||||
}
|
||||
|
||||
export interface JSDocReturnTag extends JSDocTag {
|
||||
typeExpression: JSDocTypeExpression;
|
||||
}
|
||||
|
||||
export interface JSDocTypeTag extends JSDocTag {
|
||||
typeExpression: JSDocTypeExpression;
|
||||
}
|
||||
|
||||
export interface JSDocParameterTag extends JSDocTag {
|
||||
preParameterName?: Identifier;
|
||||
typeExpression?: JSDocTypeExpression;
|
||||
postParameterName?: Identifier;
|
||||
isBracketed: boolean;
|
||||
}
|
||||
|
||||
// Source files are declarations when they are external modules.
|
||||
export interface SourceFile extends Declaration {
|
||||
statements: NodeArray<ModuleElement>;
|
||||
@@ -1494,6 +1627,8 @@ module ts {
|
||||
// Class and interface types (TypeFlags.Class and TypeFlags.Interface)
|
||||
export interface InterfaceType extends ObjectType {
|
||||
typeParameters: TypeParameter[]; // Type parameters (undefined if non-generic)
|
||||
outerTypeParameters: TypeParameter[]; // Outer type parameters (undefined if none)
|
||||
localTypeParameters: TypeParameter[]; // Local type parameters (undefined if none)
|
||||
}
|
||||
|
||||
export interface InterfaceTypeWithBaseTypes extends InterfaceType {
|
||||
@@ -1544,6 +1679,13 @@ module ts {
|
||||
numberIndexType: Type; // Numeric index type
|
||||
}
|
||||
|
||||
// Just a place to cache element types of iterables and iterators
|
||||
/* @internal */
|
||||
export interface IterableOrIteratorType extends ObjectType, UnionType {
|
||||
iterableElementType?: Type;
|
||||
iteratorElementType?: Type;
|
||||
}
|
||||
|
||||
// Type parameters (TypeFlags.TypeParameter)
|
||||
export interface TypeParameter extends Type {
|
||||
constraint: Type; // Constraint
|
||||
|
||||
+221
-1
@@ -408,6 +408,93 @@ module ts {
|
||||
|
||||
export let fullTripleSlashReferencePathRegEx = /^(\/\/\/\s*<reference\s+path\s*=\s*)('|")(.+?)\2.*?\/>/
|
||||
|
||||
export function isTypeNode(node: Node): boolean {
|
||||
if (SyntaxKind.FirstTypeNode <= node.kind && node.kind <= SyntaxKind.LastTypeNode) {
|
||||
return true;
|
||||
}
|
||||
|
||||
switch (node.kind) {
|
||||
case SyntaxKind.AnyKeyword:
|
||||
case SyntaxKind.NumberKeyword:
|
||||
case SyntaxKind.StringKeyword:
|
||||
case SyntaxKind.BooleanKeyword:
|
||||
case SyntaxKind.SymbolKeyword:
|
||||
return true;
|
||||
case SyntaxKind.VoidKeyword:
|
||||
return node.parent.kind !== SyntaxKind.VoidExpression;
|
||||
case SyntaxKind.StringLiteral:
|
||||
// Specialized signatures can have string literals as their parameters' type names
|
||||
return node.parent.kind === SyntaxKind.Parameter;
|
||||
case SyntaxKind.ExpressionWithTypeArguments:
|
||||
return true;
|
||||
|
||||
// Identifiers and qualified names may be type nodes, depending on their context. Climb
|
||||
// above them to find the lowest container
|
||||
case SyntaxKind.Identifier:
|
||||
// If the identifier is the RHS of a qualified name, then it's a type iff its parent is.
|
||||
if (node.parent.kind === SyntaxKind.QualifiedName && (<QualifiedName>node.parent).right === node) {
|
||||
node = node.parent;
|
||||
}
|
||||
else if (node.parent.kind === SyntaxKind.PropertyAccessExpression && (<PropertyAccessExpression>node.parent).name === node) {
|
||||
node = node.parent;
|
||||
}
|
||||
// fall through
|
||||
case SyntaxKind.QualifiedName:
|
||||
case SyntaxKind.PropertyAccessExpression:
|
||||
// At this point, node is either a qualified name or an identifier
|
||||
Debug.assert(node.kind === SyntaxKind.Identifier || node.kind === SyntaxKind.QualifiedName || node.kind === SyntaxKind.PropertyAccessExpression,
|
||||
"'node' was expected to be a qualified name, identifier or property access in 'isTypeNode'.");
|
||||
|
||||
let parent = node.parent;
|
||||
if (parent.kind === SyntaxKind.TypeQuery) {
|
||||
return false;
|
||||
}
|
||||
// Do not recursively call isTypeNode on the parent. In the example:
|
||||
//
|
||||
// let a: A.B.C;
|
||||
//
|
||||
// Calling isTypeNode would consider the qualified name A.B a type node. Only C or
|
||||
// A.B.C is a type node.
|
||||
if (SyntaxKind.FirstTypeNode <= parent.kind && parent.kind <= SyntaxKind.LastTypeNode) {
|
||||
return true;
|
||||
}
|
||||
switch (parent.kind) {
|
||||
case SyntaxKind.ExpressionWithTypeArguments:
|
||||
return true;
|
||||
case SyntaxKind.TypeParameter:
|
||||
return node === (<TypeParameterDeclaration>parent).constraint;
|
||||
case SyntaxKind.PropertyDeclaration:
|
||||
case SyntaxKind.PropertySignature:
|
||||
case SyntaxKind.Parameter:
|
||||
case SyntaxKind.VariableDeclaration:
|
||||
return node === (<VariableLikeDeclaration>parent).type;
|
||||
case SyntaxKind.FunctionDeclaration:
|
||||
case SyntaxKind.FunctionExpression:
|
||||
case SyntaxKind.ArrowFunction:
|
||||
case SyntaxKind.Constructor:
|
||||
case SyntaxKind.MethodDeclaration:
|
||||
case SyntaxKind.MethodSignature:
|
||||
case SyntaxKind.GetAccessor:
|
||||
case SyntaxKind.SetAccessor:
|
||||
return node === (<FunctionLikeDeclaration>parent).type;
|
||||
case SyntaxKind.CallSignature:
|
||||
case SyntaxKind.ConstructSignature:
|
||||
case SyntaxKind.IndexSignature:
|
||||
return node === (<SignatureDeclaration>parent).type;
|
||||
case SyntaxKind.TypeAssertionExpression:
|
||||
return node === (<TypeAssertion>parent).type;
|
||||
case SyntaxKind.CallExpression:
|
||||
case SyntaxKind.NewExpression:
|
||||
return (<CallExpression>parent).typeArguments && indexOf((<CallExpression>parent).typeArguments, node) >= 0;
|
||||
case SyntaxKind.TaggedTemplateExpression:
|
||||
// TODO (drosen): TaggedTemplateExpressions may eventually support type arguments.
|
||||
return false;
|
||||
}
|
||||
}
|
||||
|
||||
return false;
|
||||
}
|
||||
|
||||
// Warning: This has the same semantics as the forEach family of functions,
|
||||
// in that traversal terminates in the event that 'visitor' supplies a truthy value.
|
||||
export function forEachReturnStatement<T>(body: Block, visitor: (stmt: ReturnStatement) => T): T {
|
||||
@@ -438,6 +525,46 @@ module ts {
|
||||
}
|
||||
}
|
||||
|
||||
export function forEachYieldExpression(body: Block, visitor: (expr: YieldExpression) => void): void {
|
||||
|
||||
return traverse(body);
|
||||
|
||||
function traverse(node: Node): void {
|
||||
switch (node.kind) {
|
||||
case SyntaxKind.YieldExpression:
|
||||
visitor(<YieldExpression>node);
|
||||
let operand = (<YieldExpression>node).expression;
|
||||
if (operand) {
|
||||
traverse(operand);
|
||||
}
|
||||
case SyntaxKind.EnumDeclaration:
|
||||
case SyntaxKind.InterfaceDeclaration:
|
||||
case SyntaxKind.ModuleDeclaration:
|
||||
case SyntaxKind.TypeAliasDeclaration:
|
||||
case SyntaxKind.ClassDeclaration:
|
||||
// These are not allowed inside a generator now, but eventually they may be allowed
|
||||
// as local types. Regardless, any yield statements contained within them should be
|
||||
// skipped in this traversal.
|
||||
return;
|
||||
default:
|
||||
if (isFunctionLike(node)) {
|
||||
let name = (<FunctionLikeDeclaration>node).name;
|
||||
if (name && name.kind === SyntaxKind.ComputedPropertyName) {
|
||||
// Note that we will not include methods/accessors of a class because they would require
|
||||
// first descending into the class. This is by design.
|
||||
traverse((<ComputedPropertyName>name).expression);
|
||||
return;
|
||||
}
|
||||
}
|
||||
else if (!isTypeNode(node)) {
|
||||
// This is the general case, which should include mostly expressions and statements.
|
||||
// Also includes NodeArrays.
|
||||
forEachChild(node, traverse);
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
export function isVariableLike(node: Node): boolean {
|
||||
if (node) {
|
||||
switch (node.kind) {
|
||||
@@ -468,6 +595,12 @@ module ts {
|
||||
return false;
|
||||
}
|
||||
|
||||
export function isClassLike(node: Node): boolean {
|
||||
if (node) {
|
||||
return node.kind === SyntaxKind.ClassDeclaration || node.kind === SyntaxKind.ClassExpression;
|
||||
}
|
||||
}
|
||||
|
||||
export function isFunctionLike(node: Node): boolean {
|
||||
if (node) {
|
||||
switch (node.kind) {
|
||||
@@ -733,6 +866,7 @@ module ts {
|
||||
case SyntaxKind.TemplateExpression:
|
||||
case SyntaxKind.NoSubstitutionTemplateLiteral:
|
||||
case SyntaxKind.OmittedExpression:
|
||||
case SyntaxKind.YieldExpression:
|
||||
return true;
|
||||
case SyntaxKind.QualifiedName:
|
||||
while (node.parent.kind === SyntaxKind.QualifiedName) {
|
||||
@@ -830,7 +964,7 @@ module ts {
|
||||
}
|
||||
|
||||
export function hasDotDotDotToken(node: Node) {
|
||||
return node && node.kind === SyntaxKind.Parameter && (<ParameterDeclaration>node).dotDotDotToken !== undefined;
|
||||
return node && node.kind === SyntaxKind.Parameter && (<ParameterDeclaration>node).dotDotDotToken !== undefined;
|
||||
}
|
||||
|
||||
export function hasQuestionToken(node: Node) {
|
||||
@@ -856,6 +990,78 @@ module ts {
|
||||
return s.parameters.length > 0 && lastOrUndefined(s.parameters).dotDotDotToken !== undefined;
|
||||
}
|
||||
|
||||
export function isJSDocConstructSignature(node: Node) {
|
||||
return node.kind === SyntaxKind.JSDocFunctionType &&
|
||||
(<JSDocFunctionType>node).parameters.length > 0 &&
|
||||
(<JSDocFunctionType>node).parameters[0].type.kind === SyntaxKind.JSDocConstructorType;
|
||||
}
|
||||
|
||||
function getJSDocTag(node: Node, kind: SyntaxKind): JSDocTag {
|
||||
if (node && node.jsDocComment) {
|
||||
for (let tag of node.jsDocComment.tags) {
|
||||
if (tag.kind === kind) {
|
||||
return tag;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
export function getJSDocTypeTag(node: Node): JSDocTypeTag {
|
||||
return <JSDocTypeTag>getJSDocTag(node, SyntaxKind.JSDocTypeTag);
|
||||
}
|
||||
|
||||
export function getJSDocReturnTag(node: Node): JSDocReturnTag {
|
||||
return <JSDocReturnTag>getJSDocTag(node, SyntaxKind.JSDocReturnTag);
|
||||
}
|
||||
|
||||
export function getJSDocTemplateTag(node: Node): JSDocTemplateTag {
|
||||
return <JSDocTemplateTag>getJSDocTag(node, SyntaxKind.JSDocTemplateTag);
|
||||
}
|
||||
|
||||
export function getCorrespondingJSDocParameterTag(parameter: ParameterDeclaration): JSDocParameterTag {
|
||||
if (parameter.name && parameter.name.kind === SyntaxKind.Identifier) {
|
||||
// If it's a parameter, see if the parent has a jsdoc comment with an @param
|
||||
// annotation.
|
||||
let parameterName = (<Identifier>parameter.name).text;
|
||||
|
||||
let docComment = parameter.parent.jsDocComment;
|
||||
if (docComment) {
|
||||
return <JSDocParameterTag>forEach(docComment.tags, t => {
|
||||
if (t.kind === SyntaxKind.JSDocParameterTag) {
|
||||
let parameterTag = <JSDocParameterTag>t;
|
||||
let name = parameterTag.preParameterName || parameterTag.postParameterName;
|
||||
if (name.text === parameterName) {
|
||||
return t;
|
||||
}
|
||||
}
|
||||
});
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
export function hasRestParameter(s: SignatureDeclaration): boolean {
|
||||
return isRestParameter(lastOrUndefined(s.parameters));
|
||||
}
|
||||
|
||||
export function isRestParameter(node: ParameterDeclaration) {
|
||||
if (node) {
|
||||
if (node.parserContextFlags & ParserContextFlags.JavaScriptFile) {
|
||||
if (node.type && node.type.kind === SyntaxKind.JSDocVariadicType) {
|
||||
return true;
|
||||
}
|
||||
|
||||
let paramTag = getCorrespondingJSDocParameterTag(node);
|
||||
if (paramTag && paramTag.typeExpression) {
|
||||
return paramTag.typeExpression.type.kind === SyntaxKind.JSDocVariadicType;
|
||||
}
|
||||
}
|
||||
|
||||
return node.dotDotDotToken !== undefined;
|
||||
}
|
||||
|
||||
return false;
|
||||
}
|
||||
|
||||
export function isLiteralKind(kind: SyntaxKind): boolean {
|
||||
return SyntaxKind.FirstLiteralToken <= kind && kind <= SyntaxKind.LastLiteralToken;
|
||||
}
|
||||
@@ -1707,6 +1913,10 @@ module ts {
|
||||
return symbol && symbol.valueDeclaration && (symbol.valueDeclaration.flags & NodeFlags.Default) ? symbol.valueDeclaration.localSymbol : undefined;
|
||||
}
|
||||
|
||||
export function isJavaScript(fileName: string) {
|
||||
return fileExtensionIs(fileName, ".js");
|
||||
}
|
||||
|
||||
/**
|
||||
* Replace each instance of non-ascii characters by one, two, three, or four escape sequences
|
||||
* representing the UTF-8 encoding of the character, and return the expanded char code list.
|
||||
@@ -2000,4 +2210,14 @@ module ts {
|
||||
|
||||
return createTextChangeRange(createTextSpanFromBounds(oldStartN, oldEndN), /*newLength:*/ newEndN - oldStartN);
|
||||
}
|
||||
|
||||
export function getTypeParameterOwner(d: Declaration): Declaration {
|
||||
if (d && d.kind === SyntaxKind.TypeParameter) {
|
||||
for (let current: Node = d; current; current = current.parent) {
|
||||
if (isFunctionLike(current) || isClassLike(current) || current.kind === SyntaxKind.InterfaceDeclaration) {
|
||||
return <Declaration>current;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -798,8 +798,17 @@ module FourSlash {
|
||||
return "\nActual " + name + ":\n\t" + actualValue + "\nExpected value:\n\t" + expectedValue;
|
||||
}
|
||||
|
||||
public getSyntacticDiagnostics(expected: string) {
|
||||
var diagnostics = this.languageService.getSyntacticDiagnostics(this.activeFile.fileName);
|
||||
this.testDiagnostics(expected, diagnostics);
|
||||
}
|
||||
|
||||
public getSemanticDiagnostics(expected: string) {
|
||||
var diagnostics = this.languageService.getSemanticDiagnostics(this.activeFile.fileName);
|
||||
this.testDiagnostics(expected, diagnostics);
|
||||
}
|
||||
|
||||
private testDiagnostics(expected: string, diagnostics: ts.Diagnostic[]) {
|
||||
var realized = ts.realizeDiagnostics(diagnostics, "\r\n");
|
||||
var actual = JSON.stringify(realized, null, " ");
|
||||
assert.equal(actual, expected);
|
||||
|
||||
+13
-3
@@ -193,12 +193,16 @@ module Utils {
|
||||
};
|
||||
}
|
||||
|
||||
export function sourceFileToJSON(file: ts.SourceFile): string {
|
||||
export function sourceFileToJSON(file: ts.Node): string {
|
||||
return JSON.stringify(file,(k, v) => {
|
||||
return isNodeOrArray(v) ? serializeNode(v) : v;
|
||||
}, " ");
|
||||
|
||||
function getKindName(k: number): string {
|
||||
function getKindName(k: number | string): string {
|
||||
if (typeof k === "string") {
|
||||
return k;
|
||||
}
|
||||
|
||||
return (<any>ts).SyntaxKind[k]
|
||||
}
|
||||
|
||||
@@ -231,7 +235,9 @@ module Utils {
|
||||
|
||||
function serializeNode(n: ts.Node): any {
|
||||
var o: any = { kind: getKindName(n.kind) };
|
||||
o.containsParseError = ts.containsParseError(n);
|
||||
if (ts.containsParseError(n)) {
|
||||
o.containsParseError = true;
|
||||
}
|
||||
|
||||
ts.forEach(Object.getOwnPropertyNames(n), propertyName => {
|
||||
switch (propertyName) {
|
||||
@@ -249,6 +255,10 @@ module Utils {
|
||||
// Blacklist of items we never put in the baseline file.
|
||||
break;
|
||||
|
||||
case "originalKeywordKind":
|
||||
o[propertyName] = getKindName((<any>n)[propertyName]);
|
||||
break;
|
||||
|
||||
case "flags":
|
||||
// Print out flags with their enum names.
|
||||
o[propertyName] = getNodeFlagName(n.flags);
|
||||
|
||||
Vendored
+5
-8
@@ -316,6 +316,11 @@ interface Array<T> {
|
||||
copyWithin(target: number, start: number, end?: number): T[];
|
||||
}
|
||||
|
||||
interface IArguments {
|
||||
/** Iterator */
|
||||
[Symbol.iterator](): IterableIterator<any>;
|
||||
}
|
||||
|
||||
interface ArrayConstructor {
|
||||
/**
|
||||
* Creates an array from an array-like object.
|
||||
@@ -500,14 +505,6 @@ interface GeneratorFunctionConstructor {
|
||||
}
|
||||
declare var GeneratorFunction: GeneratorFunctionConstructor;
|
||||
|
||||
interface Generator<T> extends IterableIterator<T> {
|
||||
next(value?: any): IteratorResult<T>;
|
||||
throw(exception: any): IteratorResult<T>;
|
||||
return(value: T): IteratorResult<T>;
|
||||
[Symbol.iterator](): Generator<T>;
|
||||
[Symbol.toStringTag]: string;
|
||||
}
|
||||
|
||||
interface Math {
|
||||
/**
|
||||
* Returns the number of leading zero bits in the 32-bit binary representation of a number.
|
||||
|
||||
@@ -193,12 +193,18 @@ module ts.formatting {
|
||||
// Insert space after function keyword for anonymous functions
|
||||
public SpaceAfterAnonymousFunctionKeyword: Rule;
|
||||
public NoSpaceAfterAnonymousFunctionKeyword: Rule;
|
||||
|
||||
|
||||
// Insert space after @ in decorator
|
||||
public SpaceBeforeAt: Rule;
|
||||
public NoSpaceAfterAt: Rule;
|
||||
public SpaceAfterDecorator: Rule;
|
||||
|
||||
// Generator: function*
|
||||
public NoSpaceBetweenFunctionKeywordAndStar: Rule;
|
||||
public SpaceAfterStarInGeneratorDeclaration: Rule;
|
||||
public NoSpaceBetweenYieldKeywordAndStar: Rule;
|
||||
public SpaceBetweenYieldOrYieldStarAndOperand: Rule;
|
||||
|
||||
constructor() {
|
||||
///
|
||||
/// Common Rules
|
||||
@@ -340,6 +346,11 @@ module ts.formatting {
|
||||
this.NoSpaceAfterAt = new Rule(RuleDescriptor.create3(SyntaxKind.AtToken, Shared.TokenRange.Any), RuleOperation.create2(new RuleOperationContext(Rules.IsSameLineTokenContext), RuleAction.Delete));
|
||||
this.SpaceAfterDecorator = new Rule(RuleDescriptor.create4(Shared.TokenRange.Any, Shared.TokenRange.FromTokens([SyntaxKind.Identifier, SyntaxKind.ExportKeyword, SyntaxKind.DefaultKeyword, SyntaxKind.ClassKeyword, SyntaxKind.StaticKeyword, SyntaxKind.PublicKeyword, SyntaxKind.PrivateKeyword, SyntaxKind.ProtectedKeyword, SyntaxKind.GetKeyword, SyntaxKind.SetKeyword, SyntaxKind.OpenBracketToken, SyntaxKind.AsteriskToken])), RuleOperation.create2(new RuleOperationContext(Rules.IsEndOfDecoratorContextOnSameLine), RuleAction.Space));
|
||||
|
||||
this.NoSpaceBetweenFunctionKeywordAndStar = new Rule(RuleDescriptor.create1(SyntaxKind.FunctionKeyword, SyntaxKind.AsteriskToken), RuleOperation.create2(new RuleOperationContext(Rules.IsFunctionDeclarationOrFunctionExpressionContext), RuleAction.Delete));
|
||||
this.SpaceAfterStarInGeneratorDeclaration = new Rule(RuleDescriptor.create3(SyntaxKind.AsteriskToken, Shared.TokenRange.FromTokens([SyntaxKind.Identifier, SyntaxKind.OpenParenToken])), RuleOperation.create2(new RuleOperationContext(Rules.IsFunctionDeclarationOrFunctionExpressionContext), RuleAction.Space));
|
||||
this.NoSpaceBetweenYieldKeywordAndStar = new Rule(RuleDescriptor.create1(SyntaxKind.YieldKeyword, SyntaxKind.AsteriskToken), RuleOperation.create2(new RuleOperationContext(Rules.IsSameLineTokenContext, Rules.IsYieldOrYieldStarWithOperand), RuleAction.Delete));
|
||||
this.SpaceBetweenYieldOrYieldStarAndOperand = new Rule(RuleDescriptor.create4(Shared.TokenRange.FromTokens([SyntaxKind.YieldKeyword, SyntaxKind.AsteriskToken]), Shared.TokenRange.Any), RuleOperation.create2(new RuleOperationContext(Rules.IsSameLineTokenContext, Rules.IsYieldOrYieldStarWithOperand), RuleAction.Space));
|
||||
|
||||
// These rules are higher in priority than user-configurable rules.
|
||||
this.HighPriorityCommonRules =
|
||||
[
|
||||
@@ -357,7 +368,9 @@ module ts.formatting {
|
||||
this.NoSpaceAfterCloseBrace,
|
||||
this.SpaceAfterOpenBrace, this.SpaceBeforeCloseBrace, this.NewLineBeforeCloseBraceInBlockContext,
|
||||
this.SpaceAfterCloseBrace, this.SpaceBetweenCloseBraceAndElse, this.SpaceBetweenCloseBraceAndWhile, this.NoSpaceBetweenEmptyBraceBrackets,
|
||||
this.NoSpaceBetweenFunctionKeywordAndStar, this.SpaceAfterStarInGeneratorDeclaration,
|
||||
this.SpaceAfterFunctionInFuncDecl, this.NewLineAfterOpenBraceInBlockContext, this.SpaceAfterGetSetInMember,
|
||||
this.NoSpaceBetweenYieldKeywordAndStar, this.SpaceBetweenYieldOrYieldStarAndOperand,
|
||||
this.NoSpaceBetweenReturnAndSemicolon,
|
||||
this.SpaceAfterCertainKeywords,
|
||||
this.SpaceAfterLetConstInVariableDeclaration,
|
||||
@@ -574,6 +587,10 @@ module ts.formatting {
|
||||
return false;
|
||||
}
|
||||
|
||||
static IsFunctionDeclarationOrFunctionExpressionContext(context: FormattingContext): boolean {
|
||||
return context.contextNode.kind === SyntaxKind.FunctionDeclaration || context.contextNode.kind === SyntaxKind.FunctionExpression;
|
||||
}
|
||||
|
||||
static IsTypeScriptDeclWithBlockContext(context: FormattingContext): boolean {
|
||||
return Rules.NodeIsTypeScriptDeclWithBlockContext(context.contextNode);
|
||||
}
|
||||
@@ -717,5 +734,9 @@ module ts.formatting {
|
||||
static IsVoidOpContext(context: FormattingContext): boolean {
|
||||
return context.currentTokenSpan.kind === SyntaxKind.VoidKeyword && context.currentTokenParent.kind === SyntaxKind.VoidExpression;
|
||||
}
|
||||
|
||||
static IsYieldOrYieldStarWithOperand(context: FormattingContext): boolean {
|
||||
return context.contextNode.kind === SyntaxKind.YieldExpression && (<YieldExpression>context.contextNode).expression !== undefined;
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -2698,7 +2698,7 @@ module ts {
|
||||
return true;
|
||||
}
|
||||
if (parameter.questionToken) {
|
||||
diagnostics.push(createDiagnosticForNode(parameter.questionToken, Diagnostics.can_only_be_used_in_a_ts_file));
|
||||
diagnostics.push(createDiagnosticForNode(parameter.questionToken, Diagnostics._0_can_only_be_used_in_a_ts_file, '?'));
|
||||
return true;
|
||||
}
|
||||
if (parameter.type) {
|
||||
|
||||
@@ -989,4 +989,4 @@ module TypeScript.Services {
|
||||
}
|
||||
|
||||
/* @internal */
|
||||
let toolsVersion = "1.4";
|
||||
let toolsVersion = "1.5";
|
||||
|
||||
@@ -652,8 +652,4 @@ module ts {
|
||||
typechecker.getSymbolDisplayBuilder().buildSignatureDisplay(signature, writer, enclosingDeclaration, flags);
|
||||
});
|
||||
}
|
||||
|
||||
export function isJavaScript(fileName: string) {
|
||||
return fileExtensionIs(fileName, ".js");
|
||||
}
|
||||
}
|
||||
@@ -1,8 +1,8 @@
|
||||
tests/cases/conformance/es6/functionDeclarations/FunctionDeclaration10_es6.ts(1,10): error TS9001: Generators are not currently supported.
|
||||
tests/cases/conformance/es6/functionDeclarations/FunctionDeclaration10_es6.ts(1,10): error TS1219: Generators are only available when targeting ECMAScript 6 or higher.
|
||||
|
||||
|
||||
==== tests/cases/conformance/es6/functionDeclarations/FunctionDeclaration10_es6.ts (1 errors) ====
|
||||
function * foo(a = yield => yield) {
|
||||
~
|
||||
!!! error TS9001: Generators are not currently supported.
|
||||
!!! error TS1219: Generators are only available when targeting ECMAScript 6 or higher.
|
||||
}
|
||||
@@ -1,8 +1,8 @@
|
||||
tests/cases/conformance/es6/functionDeclarations/FunctionDeclaration11_es6.ts(1,10): error TS9001: Generators are not currently supported.
|
||||
tests/cases/conformance/es6/functionDeclarations/FunctionDeclaration11_es6.ts(1,10): error TS1219: Generators are only available when targeting ECMAScript 6 or higher.
|
||||
|
||||
|
||||
==== tests/cases/conformance/es6/functionDeclarations/FunctionDeclaration11_es6.ts (1 errors) ====
|
||||
function * yield() {
|
||||
~
|
||||
!!! error TS9001: Generators are not currently supported.
|
||||
!!! error TS1219: Generators are only available when targeting ECMAScript 6 or higher.
|
||||
}
|
||||
@@ -1,11 +1,11 @@
|
||||
tests/cases/conformance/es6/functionDeclarations/FunctionDeclaration13_es6.ts(1,10): error TS9001: Generators are not currently supported.
|
||||
tests/cases/conformance/es6/functionDeclarations/FunctionDeclaration13_es6.ts(1,10): error TS1219: Generators are only available when targeting ECMAScript 6 or higher.
|
||||
tests/cases/conformance/es6/functionDeclarations/FunctionDeclaration13_es6.ts(3,11): error TS2304: Cannot find name 'yield'.
|
||||
|
||||
|
||||
==== tests/cases/conformance/es6/functionDeclarations/FunctionDeclaration13_es6.ts (2 errors) ====
|
||||
function * foo() {
|
||||
~
|
||||
!!! error TS9001: Generators are not currently supported.
|
||||
!!! error TS1219: Generators are only available when targeting ECMAScript 6 or higher.
|
||||
// Legal to use 'yield' in a type context.
|
||||
var v: yield;
|
||||
~~~~~
|
||||
|
||||
@@ -1,8 +1,8 @@
|
||||
tests/cases/conformance/es6/functionDeclarations/FunctionDeclaration1_es6.ts(1,10): error TS9001: Generators are not currently supported.
|
||||
tests/cases/conformance/es6/functionDeclarations/FunctionDeclaration1_es6.ts(1,10): error TS1219: Generators are only available when targeting ECMAScript 6 or higher.
|
||||
|
||||
|
||||
==== tests/cases/conformance/es6/functionDeclarations/FunctionDeclaration1_es6.ts (1 errors) ====
|
||||
function * foo() {
|
||||
~
|
||||
!!! error TS9001: Generators are not currently supported.
|
||||
!!! error TS1219: Generators are only available when targeting ECMAScript 6 or higher.
|
||||
}
|
||||
@@ -1,11 +1,11 @@
|
||||
tests/cases/conformance/es6/functionDeclarations/FunctionDeclaration6_es6.ts(1,9): error TS9001: Generators are not currently supported.
|
||||
tests/cases/conformance/es6/functionDeclarations/FunctionDeclaration6_es6.ts(1,9): error TS1219: Generators are only available when targeting ECMAScript 6 or higher.
|
||||
tests/cases/conformance/es6/functionDeclarations/FunctionDeclaration6_es6.ts(1,18): error TS2304: Cannot find name 'yield'.
|
||||
|
||||
|
||||
==== tests/cases/conformance/es6/functionDeclarations/FunctionDeclaration6_es6.ts (2 errors) ====
|
||||
function*foo(a = yield) {
|
||||
~
|
||||
!!! error TS9001: Generators are not currently supported.
|
||||
!!! error TS1219: Generators are only available when targeting ECMAScript 6 or higher.
|
||||
~~~~~
|
||||
!!! error TS2304: Cannot find name 'yield'.
|
||||
}
|
||||
@@ -1,16 +1,16 @@
|
||||
tests/cases/conformance/es6/functionDeclarations/FunctionDeclaration7_es6.ts(1,9): error TS9001: Generators are not currently supported.
|
||||
tests/cases/conformance/es6/functionDeclarations/FunctionDeclaration7_es6.ts(3,11): error TS9001: Generators are not currently supported.
|
||||
tests/cases/conformance/es6/functionDeclarations/FunctionDeclaration7_es6.ts(1,9): error TS1219: Generators are only available when targeting ECMAScript 6 or higher.
|
||||
tests/cases/conformance/es6/functionDeclarations/FunctionDeclaration7_es6.ts(3,11): error TS1219: Generators are only available when targeting ECMAScript 6 or higher.
|
||||
tests/cases/conformance/es6/functionDeclarations/FunctionDeclaration7_es6.ts(3,20): error TS2304: Cannot find name 'yield'.
|
||||
|
||||
|
||||
==== tests/cases/conformance/es6/functionDeclarations/FunctionDeclaration7_es6.ts (3 errors) ====
|
||||
function*bar() {
|
||||
~
|
||||
!!! error TS9001: Generators are not currently supported.
|
||||
!!! error TS1219: Generators are only available when targeting ECMAScript 6 or higher.
|
||||
// 'yield' here is an identifier, and not a yield expression.
|
||||
function*foo(a = yield) {
|
||||
~
|
||||
!!! error TS9001: Generators are not currently supported.
|
||||
!!! error TS1219: Generators are only available when targeting ECMAScript 6 or higher.
|
||||
~~~~~
|
||||
!!! error TS2304: Cannot find name 'yield'.
|
||||
}
|
||||
|
||||
@@ -1,12 +1,9 @@
|
||||
tests/cases/conformance/es6/functionDeclarations/FunctionDeclaration9_es6.ts(1,10): error TS9001: Generators are not currently supported.
|
||||
tests/cases/conformance/es6/functionDeclarations/FunctionDeclaration9_es6.ts(2,14): error TS9000: 'yield' expressions are not currently supported.
|
||||
tests/cases/conformance/es6/functionDeclarations/FunctionDeclaration9_es6.ts(1,10): error TS1219: Generators are only available when targeting ECMAScript 6 or higher.
|
||||
|
||||
|
||||
==== tests/cases/conformance/es6/functionDeclarations/FunctionDeclaration9_es6.ts (2 errors) ====
|
||||
==== tests/cases/conformance/es6/functionDeclarations/FunctionDeclaration9_es6.ts (1 errors) ====
|
||||
function * foo() {
|
||||
~
|
||||
!!! error TS9001: Generators are not currently supported.
|
||||
!!! error TS1219: Generators are only available when targeting ECMAScript 6 or higher.
|
||||
var v = { [yield]: foo }
|
||||
~~~~~
|
||||
!!! error TS9000: 'yield' expressions are not currently supported.
|
||||
}
|
||||
@@ -1,7 +1,7 @@
|
||||
tests/cases/conformance/es6/functionExpressions/FunctionExpression1_es6.ts(1,18): error TS9001: Generators are not currently supported.
|
||||
tests/cases/conformance/es6/functionExpressions/FunctionExpression1_es6.ts(1,18): error TS1219: Generators are only available when targeting ECMAScript 6 or higher.
|
||||
|
||||
|
||||
==== tests/cases/conformance/es6/functionExpressions/FunctionExpression1_es6.ts (1 errors) ====
|
||||
var v = function * () { }
|
||||
~
|
||||
!!! error TS9001: Generators are not currently supported.
|
||||
!!! error TS1219: Generators are only available when targeting ECMAScript 6 or higher.
|
||||
@@ -1,7 +1,7 @@
|
||||
tests/cases/conformance/es6/functionExpressions/FunctionExpression2_es6.ts(1,18): error TS9001: Generators are not currently supported.
|
||||
tests/cases/conformance/es6/functionExpressions/FunctionExpression2_es6.ts(1,18): error TS1219: Generators are only available when targeting ECMAScript 6 or higher.
|
||||
|
||||
|
||||
==== tests/cases/conformance/es6/functionExpressions/FunctionExpression2_es6.ts (1 errors) ====
|
||||
var v = function * foo() { }
|
||||
~
|
||||
!!! error TS9001: Generators are not currently supported.
|
||||
!!! error TS1219: Generators are only available when targeting ECMAScript 6 or higher.
|
||||
@@ -1,7 +1,7 @@
|
||||
tests/cases/conformance/es6/functionPropertyAssignments/FunctionPropertyAssignments1_es6.ts(1,11): error TS9001: Generators are not currently supported.
|
||||
tests/cases/conformance/es6/functionPropertyAssignments/FunctionPropertyAssignments1_es6.ts(1,11): error TS1219: Generators are only available when targeting ECMAScript 6 or higher.
|
||||
|
||||
|
||||
==== tests/cases/conformance/es6/functionPropertyAssignments/FunctionPropertyAssignments1_es6.ts (1 errors) ====
|
||||
var v = { *foo() { } }
|
||||
~
|
||||
!!! error TS9001: Generators are not currently supported.
|
||||
!!! error TS1219: Generators are only available when targeting ECMAScript 6 or higher.
|
||||
@@ -1,10 +1,10 @@
|
||||
tests/cases/conformance/es6/functionPropertyAssignments/FunctionPropertyAssignments5_es6.ts(1,11): error TS9001: Generators are not currently supported.
|
||||
tests/cases/conformance/es6/functionPropertyAssignments/FunctionPropertyAssignments5_es6.ts(1,11): error TS1219: Generators are only available when targeting ECMAScript 6 or higher.
|
||||
tests/cases/conformance/es6/functionPropertyAssignments/FunctionPropertyAssignments5_es6.ts(1,13): error TS2304: Cannot find name 'foo'.
|
||||
|
||||
|
||||
==== tests/cases/conformance/es6/functionPropertyAssignments/FunctionPropertyAssignments5_es6.ts (2 errors) ====
|
||||
var v = { *[foo()]() { } }
|
||||
~
|
||||
!!! error TS9001: Generators are not currently supported.
|
||||
!!! error TS1219: Generators are only available when targeting ECMAScript 6 or higher.
|
||||
~~~
|
||||
!!! error TS2304: Cannot find name 'foo'.
|
||||
@@ -1,9 +1,9 @@
|
||||
tests/cases/conformance/es6/memberFunctionDeclarations/MemberFunctionDeclaration1_es6.ts(2,4): error TS9001: Generators are not currently supported.
|
||||
tests/cases/conformance/es6/memberFunctionDeclarations/MemberFunctionDeclaration1_es6.ts(2,4): error TS1219: Generators are only available when targeting ECMAScript 6 or higher.
|
||||
|
||||
|
||||
==== tests/cases/conformance/es6/memberFunctionDeclarations/MemberFunctionDeclaration1_es6.ts (1 errors) ====
|
||||
class C {
|
||||
*foo() { }
|
||||
~
|
||||
!!! error TS9001: Generators are not currently supported.
|
||||
!!! error TS1219: Generators are only available when targeting ECMAScript 6 or higher.
|
||||
}
|
||||
@@ -1,9 +1,9 @@
|
||||
tests/cases/conformance/es6/memberFunctionDeclarations/MemberFunctionDeclaration2_es6.ts(2,11): error TS9001: Generators are not currently supported.
|
||||
tests/cases/conformance/es6/memberFunctionDeclarations/MemberFunctionDeclaration2_es6.ts(2,11): error TS1219: Generators are only available when targeting ECMAScript 6 or higher.
|
||||
|
||||
|
||||
==== tests/cases/conformance/es6/memberFunctionDeclarations/MemberFunctionDeclaration2_es6.ts (1 errors) ====
|
||||
class C {
|
||||
public * foo() { }
|
||||
~
|
||||
!!! error TS9001: Generators are not currently supported.
|
||||
!!! error TS1219: Generators are only available when targeting ECMAScript 6 or higher.
|
||||
}
|
||||
@@ -1,4 +1,4 @@
|
||||
tests/cases/conformance/es6/memberFunctionDeclarations/MemberFunctionDeclaration3_es6.ts(2,4): error TS9001: Generators are not currently supported.
|
||||
tests/cases/conformance/es6/memberFunctionDeclarations/MemberFunctionDeclaration3_es6.ts(2,4): error TS1219: Generators are only available when targeting ECMAScript 6 or higher.
|
||||
tests/cases/conformance/es6/memberFunctionDeclarations/MemberFunctionDeclaration3_es6.ts(2,6): error TS2304: Cannot find name 'foo'.
|
||||
|
||||
|
||||
@@ -6,7 +6,7 @@ tests/cases/conformance/es6/memberFunctionDeclarations/MemberFunctionDeclaration
|
||||
class C {
|
||||
*[foo]() { }
|
||||
~
|
||||
!!! error TS9001: Generators are not currently supported.
|
||||
!!! error TS1219: Generators are only available when targeting ECMAScript 6 or higher.
|
||||
~~~
|
||||
!!! error TS2304: Cannot find name 'foo'.
|
||||
}
|
||||
@@ -1,9 +1,9 @@
|
||||
tests/cases/conformance/es6/memberFunctionDeclarations/MemberFunctionDeclaration7_es6.ts(2,4): error TS9001: Generators are not currently supported.
|
||||
tests/cases/conformance/es6/memberFunctionDeclarations/MemberFunctionDeclaration7_es6.ts(2,4): error TS1219: Generators are only available when targeting ECMAScript 6 or higher.
|
||||
|
||||
|
||||
==== tests/cases/conformance/es6/memberFunctionDeclarations/MemberFunctionDeclaration7_es6.ts (1 errors) ====
|
||||
class C {
|
||||
*foo<T>() { }
|
||||
~
|
||||
!!! error TS9001: Generators are not currently supported.
|
||||
!!! error TS1219: Generators are only available when targeting ECMAScript 6 or higher.
|
||||
}
|
||||
@@ -1,14 +1,14 @@
|
||||
tests/cases/conformance/es6/yieldExpressions/YieldExpression10_es6.ts(1,11): error TS9001: Generators are not currently supported.
|
||||
tests/cases/conformance/es6/yieldExpressions/YieldExpression10_es6.ts(2,5): error TS9000: 'yield' expressions are not currently supported.
|
||||
tests/cases/conformance/es6/yieldExpressions/YieldExpression10_es6.ts(1,11): error TS1219: Generators are only available when targeting ECMAScript 6 or higher.
|
||||
tests/cases/conformance/es6/yieldExpressions/YieldExpression10_es6.ts(2,11): error TS2304: Cannot find name 'foo'.
|
||||
|
||||
|
||||
==== tests/cases/conformance/es6/yieldExpressions/YieldExpression10_es6.ts (2 errors) ====
|
||||
var v = { * foo() {
|
||||
~
|
||||
!!! error TS9001: Generators are not currently supported.
|
||||
!!! error TS1219: Generators are only available when targeting ECMAScript 6 or higher.
|
||||
yield(foo);
|
||||
~~~~~
|
||||
!!! error TS9000: 'yield' expressions are not currently supported.
|
||||
~~~
|
||||
!!! error TS2304: Cannot find name 'foo'.
|
||||
}
|
||||
}
|
||||
|
||||
@@ -1,14 +1,14 @@
|
||||
tests/cases/conformance/es6/yieldExpressions/YieldExpression11_es6.ts(2,3): error TS9001: Generators are not currently supported.
|
||||
tests/cases/conformance/es6/yieldExpressions/YieldExpression11_es6.ts(3,5): error TS9000: 'yield' expressions are not currently supported.
|
||||
tests/cases/conformance/es6/yieldExpressions/YieldExpression11_es6.ts(2,3): error TS1219: Generators are only available when targeting ECMAScript 6 or higher.
|
||||
tests/cases/conformance/es6/yieldExpressions/YieldExpression11_es6.ts(3,11): error TS2304: Cannot find name 'foo'.
|
||||
|
||||
|
||||
==== tests/cases/conformance/es6/yieldExpressions/YieldExpression11_es6.ts (2 errors) ====
|
||||
class C {
|
||||
*foo() {
|
||||
~
|
||||
!!! error TS9001: Generators are not currently supported.
|
||||
!!! error TS1219: Generators are only available when targeting ECMAScript 6 or higher.
|
||||
yield(foo);
|
||||
~~~~~
|
||||
!!! error TS9000: 'yield' expressions are not currently supported.
|
||||
~~~
|
||||
!!! error TS2304: Cannot find name 'foo'.
|
||||
}
|
||||
}
|
||||
@@ -1,4 +1,4 @@
|
||||
tests/cases/conformance/es6/yieldExpressions/YieldExpression12_es6.ts(3,6): error TS1163: 'yield' expression must be contained_within a generator declaration.
|
||||
tests/cases/conformance/es6/yieldExpressions/YieldExpression12_es6.ts(3,6): error TS1163: A 'yield' expression is only allowed in a generator body.
|
||||
|
||||
|
||||
==== tests/cases/conformance/es6/yieldExpressions/YieldExpression12_es6.ts (1 errors) ====
|
||||
@@ -6,6 +6,6 @@ tests/cases/conformance/es6/yieldExpressions/YieldExpression12_es6.ts(3,6): erro
|
||||
constructor() {
|
||||
yield foo
|
||||
~~~~~
|
||||
!!! error TS1163: 'yield' expression must be contained_within a generator declaration.
|
||||
!!! error TS1163: A 'yield' expression is only allowed in a generator body.
|
||||
}
|
||||
}
|
||||
@@ -1,10 +1,7 @@
|
||||
tests/cases/conformance/es6/yieldExpressions/YieldExpression13_es6.ts(1,9): error TS9001: Generators are not currently supported.
|
||||
tests/cases/conformance/es6/yieldExpressions/YieldExpression13_es6.ts(1,19): error TS9000: 'yield' expressions are not currently supported.
|
||||
tests/cases/conformance/es6/yieldExpressions/YieldExpression13_es6.ts(1,9): error TS1219: Generators are only available when targeting ECMAScript 6 or higher.
|
||||
|
||||
|
||||
==== tests/cases/conformance/es6/yieldExpressions/YieldExpression13_es6.ts (2 errors) ====
|
||||
==== tests/cases/conformance/es6/yieldExpressions/YieldExpression13_es6.ts (1 errors) ====
|
||||
function* foo() { yield }
|
||||
~
|
||||
!!! error TS9001: Generators are not currently supported.
|
||||
~~~~~
|
||||
!!! error TS9000: 'yield' expressions are not currently supported.
|
||||
!!! error TS1219: Generators are only available when targeting ECMAScript 6 or higher.
|
||||
@@ -1,4 +1,4 @@
|
||||
tests/cases/conformance/es6/yieldExpressions/YieldExpression14_es6.ts(3,6): error TS1163: 'yield' expression must be contained_within a generator declaration.
|
||||
tests/cases/conformance/es6/yieldExpressions/YieldExpression14_es6.ts(3,6): error TS1163: A 'yield' expression is only allowed in a generator body.
|
||||
|
||||
|
||||
==== tests/cases/conformance/es6/yieldExpressions/YieldExpression14_es6.ts (1 errors) ====
|
||||
@@ -6,6 +6,6 @@ tests/cases/conformance/es6/yieldExpressions/YieldExpression14_es6.ts(3,6): erro
|
||||
foo() {
|
||||
yield foo
|
||||
~~~~~
|
||||
!!! error TS1163: 'yield' expression must be contained_within a generator declaration.
|
||||
!!! error TS1163: A 'yield' expression is only allowed in a generator body.
|
||||
}
|
||||
}
|
||||
@@ -1,9 +1,9 @@
|
||||
tests/cases/conformance/es6/yieldExpressions/YieldExpression15_es6.ts(2,6): error TS1163: 'yield' expression must be contained_within a generator declaration.
|
||||
tests/cases/conformance/es6/yieldExpressions/YieldExpression15_es6.ts(2,6): error TS1163: A 'yield' expression is only allowed in a generator body.
|
||||
|
||||
|
||||
==== tests/cases/conformance/es6/yieldExpressions/YieldExpression15_es6.ts (1 errors) ====
|
||||
var v = () => {
|
||||
yield foo
|
||||
~~~~~
|
||||
!!! error TS1163: 'yield' expression must be contained_within a generator declaration.
|
||||
!!! error TS1163: A 'yield' expression is only allowed in a generator body.
|
||||
}
|
||||
@@ -1,14 +1,14 @@
|
||||
tests/cases/conformance/es6/yieldExpressions/YieldExpression16_es6.ts(1,9): error TS9001: Generators are not currently supported.
|
||||
tests/cases/conformance/es6/yieldExpressions/YieldExpression16_es6.ts(3,5): error TS1163: 'yield' expression must be contained_within a generator declaration.
|
||||
tests/cases/conformance/es6/yieldExpressions/YieldExpression16_es6.ts(1,9): error TS1219: Generators are only available when targeting ECMAScript 6 or higher.
|
||||
tests/cases/conformance/es6/yieldExpressions/YieldExpression16_es6.ts(3,5): error TS1163: A 'yield' expression is only allowed in a generator body.
|
||||
|
||||
|
||||
==== tests/cases/conformance/es6/yieldExpressions/YieldExpression16_es6.ts (2 errors) ====
|
||||
function* foo() {
|
||||
~
|
||||
!!! error TS9001: Generators are not currently supported.
|
||||
!!! error TS1219: Generators are only available when targeting ECMAScript 6 or higher.
|
||||
function bar() {
|
||||
yield foo;
|
||||
~~~~~
|
||||
!!! error TS1163: 'yield' expression must be contained_within a generator declaration.
|
||||
!!! error TS1163: A 'yield' expression is only allowed in a generator body.
|
||||
}
|
||||
}
|
||||
@@ -1,6 +1,6 @@
|
||||
tests/cases/conformance/es6/yieldExpressions/YieldExpression17_es6.ts(1,15): error TS1056: Accessors are only available when targeting ECMAScript 5 and higher.
|
||||
tests/cases/conformance/es6/yieldExpressions/YieldExpression17_es6.ts(1,15): error TS2378: A 'get' accessor must return a value or consist of a single 'throw' statement.
|
||||
tests/cases/conformance/es6/yieldExpressions/YieldExpression17_es6.ts(1,23): error TS1163: 'yield' expression must be contained_within a generator declaration.
|
||||
tests/cases/conformance/es6/yieldExpressions/YieldExpression17_es6.ts(1,23): error TS1163: A 'yield' expression is only allowed in a generator body.
|
||||
|
||||
|
||||
==== tests/cases/conformance/es6/yieldExpressions/YieldExpression17_es6.ts (3 errors) ====
|
||||
@@ -10,4 +10,4 @@ tests/cases/conformance/es6/yieldExpressions/YieldExpression17_es6.ts(1,23): err
|
||||
~~~
|
||||
!!! error TS2378: A 'get' accessor must return a value or consist of a single 'throw' statement.
|
||||
~~~~~
|
||||
!!! error TS1163: 'yield' expression must be contained_within a generator declaration.
|
||||
!!! error TS1163: A 'yield' expression is only allowed in a generator body.
|
||||
@@ -1,8 +1,8 @@
|
||||
tests/cases/conformance/es6/yieldExpressions/YieldExpression18_es6.ts(2,1): error TS1163: 'yield' expression must be contained_within a generator declaration.
|
||||
tests/cases/conformance/es6/yieldExpressions/YieldExpression18_es6.ts(2,1): error TS1163: A 'yield' expression is only allowed in a generator body.
|
||||
|
||||
|
||||
==== tests/cases/conformance/es6/yieldExpressions/YieldExpression18_es6.ts (1 errors) ====
|
||||
"use strict";
|
||||
yield(foo);
|
||||
~~~~~
|
||||
!!! error TS1163: 'yield' expression must be contained_within a generator declaration.
|
||||
!!! error TS1163: A 'yield' expression is only allowed in a generator body.
|
||||
@@ -1,19 +1,16 @@
|
||||
tests/cases/conformance/es6/yieldExpressions/YieldExpression19_es6.ts(1,9): error TS9001: Generators are not currently supported.
|
||||
tests/cases/conformance/es6/yieldExpressions/YieldExpression19_es6.ts(3,13): error TS9001: Generators are not currently supported.
|
||||
tests/cases/conformance/es6/yieldExpressions/YieldExpression19_es6.ts(4,7): error TS9000: 'yield' expressions are not currently supported.
|
||||
tests/cases/conformance/es6/yieldExpressions/YieldExpression19_es6.ts(1,9): error TS1219: Generators are only available when targeting ECMAScript 6 or higher.
|
||||
tests/cases/conformance/es6/yieldExpressions/YieldExpression19_es6.ts(3,13): error TS1219: Generators are only available when targeting ECMAScript 6 or higher.
|
||||
|
||||
|
||||
==== tests/cases/conformance/es6/yieldExpressions/YieldExpression19_es6.ts (3 errors) ====
|
||||
==== tests/cases/conformance/es6/yieldExpressions/YieldExpression19_es6.ts (2 errors) ====
|
||||
function*foo() {
|
||||
~
|
||||
!!! error TS9001: Generators are not currently supported.
|
||||
!!! error TS1219: Generators are only available when targeting ECMAScript 6 or higher.
|
||||
function bar() {
|
||||
function* quux() {
|
||||
~
|
||||
!!! error TS9001: Generators are not currently supported.
|
||||
!!! error TS1219: Generators are only available when targeting ECMAScript 6 or higher.
|
||||
yield(foo);
|
||||
~~~~~
|
||||
!!! error TS9000: 'yield' expressions are not currently supported.
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -1,7 +1,7 @@
|
||||
tests/cases/conformance/es6/yieldExpressions/YieldExpression2_es6.ts(1,1): error TS1163: 'yield' expression must be contained_within a generator declaration.
|
||||
tests/cases/conformance/es6/yieldExpressions/YieldExpression2_es6.ts(1,1): error TS1163: A 'yield' expression is only allowed in a generator body.
|
||||
|
||||
|
||||
==== tests/cases/conformance/es6/yieldExpressions/YieldExpression2_es6.ts (1 errors) ====
|
||||
yield foo;
|
||||
~~~~~
|
||||
!!! error TS1163: 'yield' expression must be contained_within a generator declaration.
|
||||
!!! error TS1163: A 'yield' expression is only allowed in a generator body.
|
||||
@@ -1,16 +1,10 @@
|
||||
tests/cases/conformance/es6/yieldExpressions/YieldExpression3_es6.ts(1,9): error TS9001: Generators are not currently supported.
|
||||
tests/cases/conformance/es6/yieldExpressions/YieldExpression3_es6.ts(2,3): error TS9000: 'yield' expressions are not currently supported.
|
||||
tests/cases/conformance/es6/yieldExpressions/YieldExpression3_es6.ts(3,3): error TS9000: 'yield' expressions are not currently supported.
|
||||
tests/cases/conformance/es6/yieldExpressions/YieldExpression3_es6.ts(1,9): error TS1219: Generators are only available when targeting ECMAScript 6 or higher.
|
||||
|
||||
|
||||
==== tests/cases/conformance/es6/yieldExpressions/YieldExpression3_es6.ts (3 errors) ====
|
||||
==== tests/cases/conformance/es6/yieldExpressions/YieldExpression3_es6.ts (1 errors) ====
|
||||
function* foo() {
|
||||
~
|
||||
!!! error TS9001: Generators are not currently supported.
|
||||
!!! error TS1219: Generators are only available when targeting ECMAScript 6 or higher.
|
||||
yield
|
||||
~~~~~
|
||||
!!! error TS9000: 'yield' expressions are not currently supported.
|
||||
yield
|
||||
~~~~~
|
||||
!!! error TS9000: 'yield' expressions are not currently supported.
|
||||
}
|
||||
@@ -1,16 +1,10 @@
|
||||
tests/cases/conformance/es6/yieldExpressions/YieldExpression4_es6.ts(1,9): error TS9001: Generators are not currently supported.
|
||||
tests/cases/conformance/es6/yieldExpressions/YieldExpression4_es6.ts(2,3): error TS9000: 'yield' expressions are not currently supported.
|
||||
tests/cases/conformance/es6/yieldExpressions/YieldExpression4_es6.ts(3,3): error TS9000: 'yield' expressions are not currently supported.
|
||||
tests/cases/conformance/es6/yieldExpressions/YieldExpression4_es6.ts(1,9): error TS1219: Generators are only available when targeting ECMAScript 6 or higher.
|
||||
|
||||
|
||||
==== tests/cases/conformance/es6/yieldExpressions/YieldExpression4_es6.ts (3 errors) ====
|
||||
==== tests/cases/conformance/es6/yieldExpressions/YieldExpression4_es6.ts (1 errors) ====
|
||||
function* foo() {
|
||||
~
|
||||
!!! error TS9001: Generators are not currently supported.
|
||||
!!! error TS1219: Generators are only available when targeting ECMAScript 6 or higher.
|
||||
yield;
|
||||
~~~~~
|
||||
!!! error TS9000: 'yield' expressions are not currently supported.
|
||||
yield;
|
||||
~~~~~
|
||||
!!! error TS9000: 'yield' expressions are not currently supported.
|
||||
}
|
||||
@@ -1,12 +1,12 @@
|
||||
tests/cases/conformance/es6/yieldExpressions/YieldExpression6_es6.ts(1,9): error TS9001: Generators are not currently supported.
|
||||
tests/cases/conformance/es6/yieldExpressions/YieldExpression6_es6.ts(2,3): error TS9000: 'yield' expressions are not currently supported.
|
||||
tests/cases/conformance/es6/yieldExpressions/YieldExpression6_es6.ts(1,9): error TS1219: Generators are only available when targeting ECMAScript 6 or higher.
|
||||
tests/cases/conformance/es6/yieldExpressions/YieldExpression6_es6.ts(2,9): error TS2488: Type must have a '[Symbol.iterator]()' method that returns an iterator.
|
||||
|
||||
|
||||
==== tests/cases/conformance/es6/yieldExpressions/YieldExpression6_es6.ts (2 errors) ====
|
||||
function* foo() {
|
||||
~
|
||||
!!! error TS9001: Generators are not currently supported.
|
||||
!!! error TS1219: Generators are only available when targeting ECMAScript 6 or higher.
|
||||
yield*foo
|
||||
~~~~~
|
||||
!!! error TS9000: 'yield' expressions are not currently supported.
|
||||
~~~
|
||||
!!! error TS2488: Type must have a '[Symbol.iterator]()' method that returns an iterator.
|
||||
}
|
||||
@@ -1,12 +1,9 @@
|
||||
tests/cases/conformance/es6/yieldExpressions/YieldExpression7_es6.ts(1,9): error TS9001: Generators are not currently supported.
|
||||
tests/cases/conformance/es6/yieldExpressions/YieldExpression7_es6.ts(2,3): error TS9000: 'yield' expressions are not currently supported.
|
||||
tests/cases/conformance/es6/yieldExpressions/YieldExpression7_es6.ts(1,9): error TS1219: Generators are only available when targeting ECMAScript 6 or higher.
|
||||
|
||||
|
||||
==== tests/cases/conformance/es6/yieldExpressions/YieldExpression7_es6.ts (2 errors) ====
|
||||
==== tests/cases/conformance/es6/yieldExpressions/YieldExpression7_es6.ts (1 errors) ====
|
||||
function* foo() {
|
||||
~
|
||||
!!! error TS9001: Generators are not currently supported.
|
||||
!!! error TS1219: Generators are only available when targeting ECMAScript 6 or higher.
|
||||
yield foo
|
||||
~~~~~
|
||||
!!! error TS9000: 'yield' expressions are not currently supported.
|
||||
}
|
||||
@@ -1,16 +1,13 @@
|
||||
tests/cases/conformance/es6/yieldExpressions/YieldExpression8_es6.ts(1,1): error TS2304: Cannot find name 'yield'.
|
||||
tests/cases/conformance/es6/yieldExpressions/YieldExpression8_es6.ts(2,9): error TS9001: Generators are not currently supported.
|
||||
tests/cases/conformance/es6/yieldExpressions/YieldExpression8_es6.ts(3,3): error TS9000: 'yield' expressions are not currently supported.
|
||||
tests/cases/conformance/es6/yieldExpressions/YieldExpression8_es6.ts(2,9): error TS1219: Generators are only available when targeting ECMAScript 6 or higher.
|
||||
|
||||
|
||||
==== tests/cases/conformance/es6/yieldExpressions/YieldExpression8_es6.ts (3 errors) ====
|
||||
==== tests/cases/conformance/es6/yieldExpressions/YieldExpression8_es6.ts (2 errors) ====
|
||||
yield(foo);
|
||||
~~~~~
|
||||
!!! error TS2304: Cannot find name 'yield'.
|
||||
function* foo() {
|
||||
~
|
||||
!!! error TS9001: Generators are not currently supported.
|
||||
!!! error TS1219: Generators are only available when targeting ECMAScript 6 or higher.
|
||||
yield(foo);
|
||||
~~~~~
|
||||
!!! error TS9000: 'yield' expressions are not currently supported.
|
||||
}
|
||||
@@ -1,12 +1,12 @@
|
||||
tests/cases/conformance/es6/yieldExpressions/YieldExpression9_es6.ts(1,17): error TS9001: Generators are not currently supported.
|
||||
tests/cases/conformance/es6/yieldExpressions/YieldExpression9_es6.ts(2,3): error TS9000: 'yield' expressions are not currently supported.
|
||||
tests/cases/conformance/es6/yieldExpressions/YieldExpression9_es6.ts(1,17): error TS1219: Generators are only available when targeting ECMAScript 6 or higher.
|
||||
tests/cases/conformance/es6/yieldExpressions/YieldExpression9_es6.ts(2,9): error TS2304: Cannot find name 'foo'.
|
||||
|
||||
|
||||
==== tests/cases/conformance/es6/yieldExpressions/YieldExpression9_es6.ts (2 errors) ====
|
||||
var v = function*() {
|
||||
~
|
||||
!!! error TS9001: Generators are not currently supported.
|
||||
!!! error TS1219: Generators are only available when targeting ECMAScript 6 or higher.
|
||||
yield(foo);
|
||||
~~~~~
|
||||
!!! error TS9000: 'yield' expressions are not currently supported.
|
||||
~~~
|
||||
!!! error TS2304: Cannot find name 'foo'.
|
||||
}
|
||||
@@ -0,0 +1,10 @@
|
||||
tests/cases/conformance/es6/yieldExpressions/YieldStarExpression1_es6.ts(1,1): error TS2304: Cannot find name 'yield'.
|
||||
tests/cases/conformance/es6/yieldExpressions/YieldStarExpression1_es6.ts(1,9): error TS2363: The right-hand side of an arithmetic operation must be of type 'any', 'number' or an enum type.
|
||||
|
||||
|
||||
==== tests/cases/conformance/es6/yieldExpressions/YieldStarExpression1_es6.ts (2 errors) ====
|
||||
yield * [];
|
||||
~~~~~
|
||||
!!! error TS2304: Cannot find name 'yield'.
|
||||
~~
|
||||
!!! error TS2363: The right-hand side of an arithmetic operation must be of type 'any', 'number' or an enum type.
|
||||
@@ -0,0 +1,5 @@
|
||||
//// [YieldStarExpression1_es6.ts]
|
||||
yield * [];
|
||||
|
||||
//// [YieldStarExpression1_es6.js]
|
||||
yield * [];
|
||||
@@ -0,0 +1,10 @@
|
||||
tests/cases/conformance/es6/yieldExpressions/YieldStarExpression2_es6.ts(1,1): error TS2304: Cannot find name 'yield'.
|
||||
tests/cases/conformance/es6/yieldExpressions/YieldStarExpression2_es6.ts(1,8): error TS1109: Expression expected.
|
||||
|
||||
|
||||
==== tests/cases/conformance/es6/yieldExpressions/YieldStarExpression2_es6.ts (2 errors) ====
|
||||
yield *;
|
||||
~~~~~
|
||||
!!! error TS2304: Cannot find name 'yield'.
|
||||
~
|
||||
!!! error TS1109: Expression expected.
|
||||
@@ -0,0 +1,5 @@
|
||||
//// [YieldStarExpression2_es6.ts]
|
||||
yield *;
|
||||
|
||||
//// [YieldStarExpression2_es6.js]
|
||||
yield * ;
|
||||
@@ -0,0 +1,9 @@
|
||||
tests/cases/conformance/es6/yieldExpressions/YieldStarExpression3_es6.ts(2,12): error TS1109: Expression expected.
|
||||
|
||||
|
||||
==== tests/cases/conformance/es6/yieldExpressions/YieldStarExpression3_es6.ts (1 errors) ====
|
||||
function *g() {
|
||||
yield *;
|
||||
~
|
||||
!!! error TS1109: Expression expected.
|
||||
}
|
||||
@@ -0,0 +1,9 @@
|
||||
//// [YieldStarExpression3_es6.ts]
|
||||
function *g() {
|
||||
yield *;
|
||||
}
|
||||
|
||||
//// [YieldStarExpression3_es6.js]
|
||||
function g() {
|
||||
yield* ;
|
||||
}
|
||||
@@ -0,0 +1,12 @@
|
||||
tests/cases/conformance/es6/yieldExpressions/YieldStarExpression4_es6.ts(1,10): error TS1219: Generators are only available when targeting ECMAScript 6 or higher.
|
||||
tests/cases/conformance/es6/yieldExpressions/YieldStarExpression4_es6.ts(2,13): error TS2488: Type must have a '[Symbol.iterator]()' method that returns an iterator.
|
||||
|
||||
|
||||
==== tests/cases/conformance/es6/yieldExpressions/YieldStarExpression4_es6.ts (2 errors) ====
|
||||
function *g() {
|
||||
~
|
||||
!!! error TS1219: Generators are only available when targeting ECMAScript 6 or higher.
|
||||
yield * [];
|
||||
~~
|
||||
!!! error TS2488: Type must have a '[Symbol.iterator]()' method that returns an iterator.
|
||||
}
|
||||
@@ -0,0 +1,9 @@
|
||||
//// [YieldStarExpression4_es6.ts]
|
||||
function *g() {
|
||||
yield * [];
|
||||
}
|
||||
|
||||
//// [YieldStarExpression4_es6.js]
|
||||
function g() {
|
||||
yield* [];
|
||||
}
|
||||
@@ -0,0 +1,14 @@
|
||||
tests/cases/compiler/argumentsObjectIterator01_ES5.ts(4,21): error TS2495: Type 'IArguments' is not an array type or a string type.
|
||||
|
||||
|
||||
==== tests/cases/compiler/argumentsObjectIterator01_ES5.ts (1 errors) ====
|
||||
|
||||
function doubleAndReturnAsArray(x: number, y: number, z: number): [number, number, number] {
|
||||
let result = [];
|
||||
for (let arg of arguments) {
|
||||
~~~~~~~~~
|
||||
!!! error TS2495: Type 'IArguments' is not an array type or a string type.
|
||||
result.push(arg + arg);
|
||||
}
|
||||
return <[any, any, any]>result;
|
||||
}
|
||||
@@ -0,0 +1,19 @@
|
||||
//// [argumentsObjectIterator01_ES5.ts]
|
||||
|
||||
function doubleAndReturnAsArray(x: number, y: number, z: number): [number, number, number] {
|
||||
let result = [];
|
||||
for (let arg of arguments) {
|
||||
result.push(arg + arg);
|
||||
}
|
||||
return <[any, any, any]>result;
|
||||
}
|
||||
|
||||
//// [argumentsObjectIterator01_ES5.js]
|
||||
function doubleAndReturnAsArray(x, y, z) {
|
||||
var result = [];
|
||||
for (var _i = 0; _i < arguments.length; _i++) {
|
||||
var arg = arguments[_i];
|
||||
result.push(arg + arg);
|
||||
}
|
||||
return result;
|
||||
}
|
||||
@@ -0,0 +1,18 @@
|
||||
//// [argumentsObjectIterator01_ES6.ts]
|
||||
|
||||
function doubleAndReturnAsArray(x: number, y: number, z: number): [number, number, number] {
|
||||
let result = [];
|
||||
for (let arg of arguments) {
|
||||
result.push(arg + arg);
|
||||
}
|
||||
return <[any, any, any]>result;
|
||||
}
|
||||
|
||||
//// [argumentsObjectIterator01_ES6.js]
|
||||
function doubleAndReturnAsArray(x, y, z) {
|
||||
let result = [];
|
||||
for (let arg of arguments) {
|
||||
result.push(arg + arg);
|
||||
}
|
||||
return result;
|
||||
}
|
||||
@@ -0,0 +1,25 @@
|
||||
=== tests/cases/compiler/argumentsObjectIterator01_ES6.ts ===
|
||||
|
||||
function doubleAndReturnAsArray(x: number, y: number, z: number): [number, number, number] {
|
||||
>doubleAndReturnAsArray : Symbol(doubleAndReturnAsArray, Decl(argumentsObjectIterator01_ES6.ts, 0, 0))
|
||||
>x : Symbol(x, Decl(argumentsObjectIterator01_ES6.ts, 1, 32))
|
||||
>y : Symbol(y, Decl(argumentsObjectIterator01_ES6.ts, 1, 42))
|
||||
>z : Symbol(z, Decl(argumentsObjectIterator01_ES6.ts, 1, 53))
|
||||
|
||||
let result = [];
|
||||
>result : Symbol(result, Decl(argumentsObjectIterator01_ES6.ts, 2, 7))
|
||||
|
||||
for (let arg of arguments) {
|
||||
>arg : Symbol(arg, Decl(argumentsObjectIterator01_ES6.ts, 3, 12))
|
||||
>arguments : Symbol(arguments)
|
||||
|
||||
result.push(arg + arg);
|
||||
>result.push : Symbol(Array.push, Decl(lib.d.ts, 1016, 29))
|
||||
>result : Symbol(result, Decl(argumentsObjectIterator01_ES6.ts, 2, 7))
|
||||
>push : Symbol(Array.push, Decl(lib.d.ts, 1016, 29))
|
||||
>arg : Symbol(arg, Decl(argumentsObjectIterator01_ES6.ts, 3, 12))
|
||||
>arg : Symbol(arg, Decl(argumentsObjectIterator01_ES6.ts, 3, 12))
|
||||
}
|
||||
return <[any, any, any]>result;
|
||||
>result : Symbol(result, Decl(argumentsObjectIterator01_ES6.ts, 2, 7))
|
||||
}
|
||||
@@ -0,0 +1,29 @@
|
||||
=== tests/cases/compiler/argumentsObjectIterator01_ES6.ts ===
|
||||
|
||||
function doubleAndReturnAsArray(x: number, y: number, z: number): [number, number, number] {
|
||||
>doubleAndReturnAsArray : (x: number, y: number, z: number) => [number, number, number]
|
||||
>x : number
|
||||
>y : number
|
||||
>z : number
|
||||
|
||||
let result = [];
|
||||
>result : any[]
|
||||
>[] : undefined[]
|
||||
|
||||
for (let arg of arguments) {
|
||||
>arg : any
|
||||
>arguments : IArguments
|
||||
|
||||
result.push(arg + arg);
|
||||
>result.push(arg + arg) : number
|
||||
>result.push : (...items: any[]) => number
|
||||
>result : any[]
|
||||
>push : (...items: any[]) => number
|
||||
>arg + arg : any
|
||||
>arg : any
|
||||
>arg : any
|
||||
}
|
||||
return <[any, any, any]>result;
|
||||
><[any, any, any]>result : [any, any, any]
|
||||
>result : any[]
|
||||
}
|
||||
@@ -0,0 +1,18 @@
|
||||
tests/cases/compiler/argumentsObjectIterator02_ES5.ts(3,26): error TS2304: Cannot find name 'Symbol'.
|
||||
|
||||
|
||||
==== tests/cases/compiler/argumentsObjectIterator02_ES5.ts (1 errors) ====
|
||||
|
||||
function doubleAndReturnAsArray(x: number, y: number, z: number): [number, number, number] {
|
||||
let blah = arguments[Symbol.iterator];
|
||||
~~~~~~
|
||||
!!! error TS2304: Cannot find name 'Symbol'.
|
||||
|
||||
let result = [];
|
||||
for (let arg of blah()) {
|
||||
result.push(arg + arg);
|
||||
}
|
||||
return <[any, any, any]>result;
|
||||
}
|
||||
|
||||
|
||||
@@ -0,0 +1,24 @@
|
||||
//// [argumentsObjectIterator02_ES5.ts]
|
||||
|
||||
function doubleAndReturnAsArray(x: number, y: number, z: number): [number, number, number] {
|
||||
let blah = arguments[Symbol.iterator];
|
||||
|
||||
let result = [];
|
||||
for (let arg of blah()) {
|
||||
result.push(arg + arg);
|
||||
}
|
||||
return <[any, any, any]>result;
|
||||
}
|
||||
|
||||
|
||||
|
||||
//// [argumentsObjectIterator02_ES5.js]
|
||||
function doubleAndReturnAsArray(x, y, z) {
|
||||
var blah = arguments[Symbol.iterator];
|
||||
var result = [];
|
||||
for (var _i = 0, _a = blah(); _i < _a.length; _i++) {
|
||||
var arg = _a[_i];
|
||||
result.push(arg + arg);
|
||||
}
|
||||
return result;
|
||||
}
|
||||
@@ -0,0 +1,23 @@
|
||||
//// [argumentsObjectIterator02_ES6.ts]
|
||||
|
||||
function doubleAndReturnAsArray(x: number, y: number, z: number): [number, number, number] {
|
||||
let blah = arguments[Symbol.iterator];
|
||||
|
||||
let result = [];
|
||||
for (let arg of blah()) {
|
||||
result.push(arg + arg);
|
||||
}
|
||||
return <[any, any, any]>result;
|
||||
}
|
||||
|
||||
|
||||
|
||||
//// [argumentsObjectIterator02_ES6.js]
|
||||
function doubleAndReturnAsArray(x, y, z) {
|
||||
let blah = arguments[Symbol.iterator];
|
||||
let result = [];
|
||||
for (let arg of blah()) {
|
||||
result.push(arg + arg);
|
||||
}
|
||||
return result;
|
||||
}
|
||||
@@ -0,0 +1,34 @@
|
||||
=== tests/cases/compiler/argumentsObjectIterator02_ES6.ts ===
|
||||
|
||||
function doubleAndReturnAsArray(x: number, y: number, z: number): [number, number, number] {
|
||||
>doubleAndReturnAsArray : Symbol(doubleAndReturnAsArray, Decl(argumentsObjectIterator02_ES6.ts, 0, 0))
|
||||
>x : Symbol(x, Decl(argumentsObjectIterator02_ES6.ts, 1, 32))
|
||||
>y : Symbol(y, Decl(argumentsObjectIterator02_ES6.ts, 1, 42))
|
||||
>z : Symbol(z, Decl(argumentsObjectIterator02_ES6.ts, 1, 53))
|
||||
|
||||
let blah = arguments[Symbol.iterator];
|
||||
>blah : Symbol(blah, Decl(argumentsObjectIterator02_ES6.ts, 2, 7))
|
||||
>arguments : Symbol(arguments)
|
||||
>Symbol.iterator : Symbol(SymbolConstructor.iterator, Decl(lib.d.ts, 1236, 31))
|
||||
>Symbol : Symbol(Symbol, Decl(lib.d.ts, 1186, 52), Decl(lib.d.ts, 1292, 11))
|
||||
>iterator : Symbol(SymbolConstructor.iterator, Decl(lib.d.ts, 1236, 31))
|
||||
|
||||
let result = [];
|
||||
>result : Symbol(result, Decl(argumentsObjectIterator02_ES6.ts, 4, 7))
|
||||
|
||||
for (let arg of blah()) {
|
||||
>arg : Symbol(arg, Decl(argumentsObjectIterator02_ES6.ts, 5, 12))
|
||||
>blah : Symbol(blah, Decl(argumentsObjectIterator02_ES6.ts, 2, 7))
|
||||
|
||||
result.push(arg + arg);
|
||||
>result.push : Symbol(Array.push, Decl(lib.d.ts, 1016, 29))
|
||||
>result : Symbol(result, Decl(argumentsObjectIterator02_ES6.ts, 4, 7))
|
||||
>push : Symbol(Array.push, Decl(lib.d.ts, 1016, 29))
|
||||
>arg : Symbol(arg, Decl(argumentsObjectIterator02_ES6.ts, 5, 12))
|
||||
>arg : Symbol(arg, Decl(argumentsObjectIterator02_ES6.ts, 5, 12))
|
||||
}
|
||||
return <[any, any, any]>result;
|
||||
>result : Symbol(result, Decl(argumentsObjectIterator02_ES6.ts, 4, 7))
|
||||
}
|
||||
|
||||
|
||||
@@ -0,0 +1,40 @@
|
||||
=== tests/cases/compiler/argumentsObjectIterator02_ES6.ts ===
|
||||
|
||||
function doubleAndReturnAsArray(x: number, y: number, z: number): [number, number, number] {
|
||||
>doubleAndReturnAsArray : (x: number, y: number, z: number) => [number, number, number]
|
||||
>x : number
|
||||
>y : number
|
||||
>z : number
|
||||
|
||||
let blah = arguments[Symbol.iterator];
|
||||
>blah : () => IterableIterator<any>
|
||||
>arguments[Symbol.iterator] : () => IterableIterator<any>
|
||||
>arguments : IArguments
|
||||
>Symbol.iterator : symbol
|
||||
>Symbol : SymbolConstructor
|
||||
>iterator : symbol
|
||||
|
||||
let result = [];
|
||||
>result : any[]
|
||||
>[] : undefined[]
|
||||
|
||||
for (let arg of blah()) {
|
||||
>arg : any
|
||||
>blah() : IterableIterator<any>
|
||||
>blah : () => IterableIterator<any>
|
||||
|
||||
result.push(arg + arg);
|
||||
>result.push(arg + arg) : number
|
||||
>result.push : (...items: any[]) => number
|
||||
>result : any[]
|
||||
>push : (...items: any[]) => number
|
||||
>arg + arg : any
|
||||
>arg : any
|
||||
>arg : any
|
||||
}
|
||||
return <[any, any, any]>result;
|
||||
><[any, any, any]>result : [any, any, any]
|
||||
>result : any[]
|
||||
}
|
||||
|
||||
|
||||
@@ -0,0 +1,14 @@
|
||||
tests/cases/compiler/argumentsObjectIterator03_ES5.ts(3,9): error TS2461: Type 'IArguments' is not an array type.
|
||||
|
||||
|
||||
==== tests/cases/compiler/argumentsObjectIterator03_ES5.ts (1 errors) ====
|
||||
|
||||
function asReversedTuple(a: number, b: string, c: boolean): [boolean, string, number] {
|
||||
let [x, y, z] = arguments;
|
||||
~~~~~~~~~
|
||||
!!! error TS2461: Type 'IArguments' is not an array type.
|
||||
|
||||
return [z, y, x];
|
||||
}
|
||||
|
||||
|
||||
@@ -0,0 +1,15 @@
|
||||
//// [argumentsObjectIterator03_ES5.ts]
|
||||
|
||||
function asReversedTuple(a: number, b: string, c: boolean): [boolean, string, number] {
|
||||
let [x, y, z] = arguments;
|
||||
|
||||
return [z, y, x];
|
||||
}
|
||||
|
||||
|
||||
|
||||
//// [argumentsObjectIterator03_ES5.js]
|
||||
function asReversedTuple(a, b, c) {
|
||||
var x = arguments[0], y = arguments[1], z = arguments[2];
|
||||
return [z, y, x];
|
||||
}
|
||||
@@ -0,0 +1,15 @@
|
||||
//// [argumentsObjectIterator03_ES6.ts]
|
||||
|
||||
function asReversedTuple(a: number, b: string, c: boolean): [boolean, string, number] {
|
||||
let [x, y, z] = arguments;
|
||||
|
||||
return [z, y, x];
|
||||
}
|
||||
|
||||
|
||||
|
||||
//// [argumentsObjectIterator03_ES6.js]
|
||||
function asReversedTuple(a, b, c) {
|
||||
let [x, y, z] = arguments;
|
||||
return [z, y, x];
|
||||
}
|
||||
@@ -0,0 +1,21 @@
|
||||
=== tests/cases/compiler/argumentsObjectIterator03_ES6.ts ===
|
||||
|
||||
function asReversedTuple(a: number, b: string, c: boolean): [boolean, string, number] {
|
||||
>asReversedTuple : Symbol(asReversedTuple, Decl(argumentsObjectIterator03_ES6.ts, 0, 0))
|
||||
>a : Symbol(a, Decl(argumentsObjectIterator03_ES6.ts, 1, 25))
|
||||
>b : Symbol(b, Decl(argumentsObjectIterator03_ES6.ts, 1, 35))
|
||||
>c : Symbol(c, Decl(argumentsObjectIterator03_ES6.ts, 1, 46))
|
||||
|
||||
let [x, y, z] = arguments;
|
||||
>x : Symbol(x, Decl(argumentsObjectIterator03_ES6.ts, 2, 9))
|
||||
>y : Symbol(y, Decl(argumentsObjectIterator03_ES6.ts, 2, 11))
|
||||
>z : Symbol(z, Decl(argumentsObjectIterator03_ES6.ts, 2, 14))
|
||||
>arguments : Symbol(arguments)
|
||||
|
||||
return [z, y, x];
|
||||
>z : Symbol(z, Decl(argumentsObjectIterator03_ES6.ts, 2, 14))
|
||||
>y : Symbol(y, Decl(argumentsObjectIterator03_ES6.ts, 2, 11))
|
||||
>x : Symbol(x, Decl(argumentsObjectIterator03_ES6.ts, 2, 9))
|
||||
}
|
||||
|
||||
|
||||
@@ -0,0 +1,22 @@
|
||||
=== tests/cases/compiler/argumentsObjectIterator03_ES6.ts ===
|
||||
|
||||
function asReversedTuple(a: number, b: string, c: boolean): [boolean, string, number] {
|
||||
>asReversedTuple : (a: number, b: string, c: boolean) => [boolean, string, number]
|
||||
>a : number
|
||||
>b : string
|
||||
>c : boolean
|
||||
|
||||
let [x, y, z] = arguments;
|
||||
>x : any
|
||||
>y : any
|
||||
>z : any
|
||||
>arguments : IArguments
|
||||
|
||||
return [z, y, x];
|
||||
>[z, y, x] : [any, any, any]
|
||||
>z : any
|
||||
>y : any
|
||||
>x : any
|
||||
}
|
||||
|
||||
|
||||
@@ -79,7 +79,7 @@ interface myArray2 extends Array<Number|String> { }
|
||||
>myArray2 : Symbol(myArray2, Decl(arrayLiterals2ES6.ts, 42, 43))
|
||||
>Array : Symbol(Array, Decl(lib.d.ts, 1000, 23), Decl(lib.d.ts, 1171, 11), Decl(lib.d.ts, 1439, 1))
|
||||
>Number : Symbol(Number, Decl(lib.d.ts, 456, 40), Decl(lib.d.ts, 518, 11))
|
||||
>String : Symbol(String, Decl(lib.d.ts, 275, 1), Decl(lib.d.ts, 443, 11), Decl(lib.d.ts, 1538, 1))
|
||||
>String : Symbol(String, Decl(lib.d.ts, 275, 1), Decl(lib.d.ts, 443, 11), Decl(lib.d.ts, 1543, 1))
|
||||
|
||||
var d0 = [1, true, ...temp, ]; // has type (string|number|boolean)[]
|
||||
>d0 : Symbol(d0, Decl(arrayLiterals2ES6.ts, 44, 3))
|
||||
|
||||
@@ -1,13 +0,0 @@
|
||||
tests/cases/compiler/classDeclarationBlockScoping1.ts(5,11): error TS9004: 'class' declarations are only supported directly inside a module or as a top level declaration.
|
||||
|
||||
|
||||
==== tests/cases/compiler/classDeclarationBlockScoping1.ts (1 errors) ====
|
||||
class C {
|
||||
}
|
||||
|
||||
{
|
||||
class C {
|
||||
~
|
||||
!!! error TS9004: 'class' declarations are only supported directly inside a module or as a top level declaration.
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,10 @@
|
||||
=== tests/cases/compiler/classDeclarationBlockScoping1.ts ===
|
||||
class C {
|
||||
>C : Symbol(C, Decl(classDeclarationBlockScoping1.ts, 0, 0))
|
||||
}
|
||||
|
||||
{
|
||||
class C {
|
||||
>C : Symbol(C, Decl(classDeclarationBlockScoping1.ts, 3, 1))
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,10 @@
|
||||
=== tests/cases/compiler/classDeclarationBlockScoping1.ts ===
|
||||
class C {
|
||||
>C : C
|
||||
}
|
||||
|
||||
{
|
||||
class C {
|
||||
>C : C
|
||||
}
|
||||
}
|
||||
@@ -1,18 +0,0 @@
|
||||
tests/cases/compiler/classDeclarationBlockScoping2.ts(2,11): error TS9004: 'class' declarations are only supported directly inside a module or as a top level declaration.
|
||||
tests/cases/compiler/classDeclarationBlockScoping2.ts(5,15): error TS9004: 'class' declarations are only supported directly inside a module or as a top level declaration.
|
||||
|
||||
|
||||
==== tests/cases/compiler/classDeclarationBlockScoping2.ts (2 errors) ====
|
||||
function f() {
|
||||
class C {}
|
||||
~
|
||||
!!! error TS9004: 'class' declarations are only supported directly inside a module or as a top level declaration.
|
||||
var c1 = C;
|
||||
{
|
||||
class C {}
|
||||
~
|
||||
!!! error TS9004: 'class' declarations are only supported directly inside a module or as a top level declaration.
|
||||
var c2 = C;
|
||||
}
|
||||
return C === c1;
|
||||
}
|
||||
@@ -0,0 +1,22 @@
|
||||
=== tests/cases/compiler/classDeclarationBlockScoping2.ts ===
|
||||
function f() {
|
||||
>f : Symbol(f, Decl(classDeclarationBlockScoping2.ts, 0, 0))
|
||||
|
||||
class C {}
|
||||
>C : Symbol(C, Decl(classDeclarationBlockScoping2.ts, 0, 14))
|
||||
|
||||
var c1 = C;
|
||||
>c1 : Symbol(c1, Decl(classDeclarationBlockScoping2.ts, 2, 7))
|
||||
>C : Symbol(C, Decl(classDeclarationBlockScoping2.ts, 0, 14))
|
||||
{
|
||||
class C {}
|
||||
>C : Symbol(C, Decl(classDeclarationBlockScoping2.ts, 3, 5))
|
||||
|
||||
var c2 = C;
|
||||
>c2 : Symbol(c2, Decl(classDeclarationBlockScoping2.ts, 5, 11))
|
||||
>C : Symbol(C, Decl(classDeclarationBlockScoping2.ts, 3, 5))
|
||||
}
|
||||
return C === c1;
|
||||
>C : Symbol(C, Decl(classDeclarationBlockScoping2.ts, 0, 14))
|
||||
>c1 : Symbol(c1, Decl(classDeclarationBlockScoping2.ts, 2, 7))
|
||||
}
|
||||
@@ -0,0 +1,23 @@
|
||||
=== tests/cases/compiler/classDeclarationBlockScoping2.ts ===
|
||||
function f() {
|
||||
>f : () => boolean
|
||||
|
||||
class C {}
|
||||
>C : C
|
||||
|
||||
var c1 = C;
|
||||
>c1 : typeof C
|
||||
>C : typeof C
|
||||
{
|
||||
class C {}
|
||||
>C : C
|
||||
|
||||
var c2 = C;
|
||||
>c2 : typeof C
|
||||
>C : typeof C
|
||||
}
|
||||
return C === c1;
|
||||
>C === c1 : boolean
|
||||
>C : typeof C
|
||||
>c1 : typeof C
|
||||
}
|
||||
@@ -1,18 +0,0 @@
|
||||
tests/cases/compiler/classExpressionTest1.ts(2,11): error TS9004: 'class' declarations are only supported directly inside a module or as a top level declaration.
|
||||
|
||||
|
||||
==== tests/cases/compiler/classExpressionTest1.ts (1 errors) ====
|
||||
function M() {
|
||||
class C<X> {
|
||||
~
|
||||
!!! error TS9004: 'class' declarations are only supported directly inside a module or as a top level declaration.
|
||||
f<T>() {
|
||||
var t: T;
|
||||
var x: X;
|
||||
return { t, x };
|
||||
}
|
||||
}
|
||||
|
||||
var v = new C<number>();
|
||||
return v.f<string>();
|
||||
}
|
||||
@@ -0,0 +1,35 @@
|
||||
=== tests/cases/compiler/classExpressionTest1.ts ===
|
||||
function M() {
|
||||
>M : Symbol(M, Decl(classExpressionTest1.ts, 0, 0))
|
||||
|
||||
class C<X> {
|
||||
>C : Symbol(C, Decl(classExpressionTest1.ts, 0, 14))
|
||||
>X : Symbol(X, Decl(classExpressionTest1.ts, 1, 12))
|
||||
|
||||
f<T>() {
|
||||
>f : Symbol(f, Decl(classExpressionTest1.ts, 1, 16))
|
||||
>T : Symbol(T, Decl(classExpressionTest1.ts, 2, 10))
|
||||
|
||||
var t: T;
|
||||
>t : Symbol(t, Decl(classExpressionTest1.ts, 3, 15))
|
||||
>T : Symbol(T, Decl(classExpressionTest1.ts, 2, 10))
|
||||
|
||||
var x: X;
|
||||
>x : Symbol(x, Decl(classExpressionTest1.ts, 4, 15))
|
||||
>X : Symbol(X, Decl(classExpressionTest1.ts, 1, 12))
|
||||
|
||||
return { t, x };
|
||||
>t : Symbol(t, Decl(classExpressionTest1.ts, 5, 20))
|
||||
>x : Symbol(x, Decl(classExpressionTest1.ts, 5, 23))
|
||||
}
|
||||
}
|
||||
|
||||
var v = new C<number>();
|
||||
>v : Symbol(v, Decl(classExpressionTest1.ts, 9, 7))
|
||||
>C : Symbol(C, Decl(classExpressionTest1.ts, 0, 14))
|
||||
|
||||
return v.f<string>();
|
||||
>v.f : Symbol(C.f, Decl(classExpressionTest1.ts, 1, 16))
|
||||
>v : Symbol(v, Decl(classExpressionTest1.ts, 9, 7))
|
||||
>f : Symbol(C.f, Decl(classExpressionTest1.ts, 1, 16))
|
||||
}
|
||||
@@ -0,0 +1,38 @@
|
||||
=== tests/cases/compiler/classExpressionTest1.ts ===
|
||||
function M() {
|
||||
>M : () => { t: string; x: number; }
|
||||
|
||||
class C<X> {
|
||||
>C : C<X>
|
||||
>X : X
|
||||
|
||||
f<T>() {
|
||||
>f : <T>() => { t: T; x: X; }
|
||||
>T : T
|
||||
|
||||
var t: T;
|
||||
>t : T
|
||||
>T : T
|
||||
|
||||
var x: X;
|
||||
>x : X
|
||||
>X : X
|
||||
|
||||
return { t, x };
|
||||
>{ t, x } : { t: T; x: X; }
|
||||
>t : T
|
||||
>x : X
|
||||
}
|
||||
}
|
||||
|
||||
var v = new C<number>();
|
||||
>v : C<number>
|
||||
>new C<number>() : C<number>
|
||||
>C : typeof C
|
||||
|
||||
return v.f<string>();
|
||||
>v.f<string>() : { t: string; x: number; }
|
||||
>v.f : <T>() => { t: T; x: number; }
|
||||
>v : C<number>
|
||||
>f : <T>() => { t: T; x: number; }
|
||||
}
|
||||
@@ -1,9 +0,0 @@
|
||||
tests/cases/conformance/classes/classDeclarations/classInsideBlock.ts(2,11): error TS9004: 'class' declarations are only supported directly inside a module or as a top level declaration.
|
||||
|
||||
|
||||
==== tests/cases/conformance/classes/classDeclarations/classInsideBlock.ts (1 errors) ====
|
||||
function foo() {
|
||||
class C { }
|
||||
~
|
||||
!!! error TS9004: 'class' declarations are only supported directly inside a module or as a top level declaration.
|
||||
}
|
||||
@@ -0,0 +1,7 @@
|
||||
=== tests/cases/conformance/classes/classDeclarations/classInsideBlock.ts ===
|
||||
function foo() {
|
||||
>foo : Symbol(foo, Decl(classInsideBlock.ts, 0, 0))
|
||||
|
||||
class C { }
|
||||
>C : Symbol(C, Decl(classInsideBlock.ts, 0, 16))
|
||||
}
|
||||
@@ -0,0 +1,7 @@
|
||||
=== tests/cases/conformance/classes/classDeclarations/classInsideBlock.ts ===
|
||||
function foo() {
|
||||
>foo : () => void
|
||||
|
||||
class C { }
|
||||
>C : C
|
||||
}
|
||||
@@ -9,17 +9,17 @@
|
||||
type arrayString = Array<String>
|
||||
>arrayString : Symbol(arrayString, Decl(destructuringParameterDeclaration3ES5.ts, 0, 0))
|
||||
>Array : Symbol(Array, Decl(lib.d.ts, 1000, 23), Decl(lib.d.ts, 1171, 11), Decl(lib.d.ts, 1439, 1))
|
||||
>String : Symbol(String, Decl(lib.d.ts, 275, 1), Decl(lib.d.ts, 443, 11), Decl(lib.d.ts, 1538, 1))
|
||||
>String : Symbol(String, Decl(lib.d.ts, 275, 1), Decl(lib.d.ts, 443, 11), Decl(lib.d.ts, 1543, 1))
|
||||
|
||||
type someArray = Array<String> | number[];
|
||||
>someArray : Symbol(someArray, Decl(destructuringParameterDeclaration3ES5.ts, 7, 32))
|
||||
>Array : Symbol(Array, Decl(lib.d.ts, 1000, 23), Decl(lib.d.ts, 1171, 11), Decl(lib.d.ts, 1439, 1))
|
||||
>String : Symbol(String, Decl(lib.d.ts, 275, 1), Decl(lib.d.ts, 443, 11), Decl(lib.d.ts, 1538, 1))
|
||||
>String : Symbol(String, Decl(lib.d.ts, 275, 1), Decl(lib.d.ts, 443, 11), Decl(lib.d.ts, 1543, 1))
|
||||
|
||||
type stringOrNumArray = Array<String|Number>;
|
||||
>stringOrNumArray : Symbol(stringOrNumArray, Decl(destructuringParameterDeclaration3ES5.ts, 8, 42))
|
||||
>Array : Symbol(Array, Decl(lib.d.ts, 1000, 23), Decl(lib.d.ts, 1171, 11), Decl(lib.d.ts, 1439, 1))
|
||||
>String : Symbol(String, Decl(lib.d.ts, 275, 1), Decl(lib.d.ts, 443, 11), Decl(lib.d.ts, 1538, 1))
|
||||
>String : Symbol(String, Decl(lib.d.ts, 275, 1), Decl(lib.d.ts, 443, 11), Decl(lib.d.ts, 1543, 1))
|
||||
>Number : Symbol(Number, Decl(lib.d.ts, 456, 40), Decl(lib.d.ts, 518, 11))
|
||||
|
||||
function a1(...x: (number|string)[]) { }
|
||||
@@ -34,7 +34,7 @@ function a3(...a: Array<String>) { }
|
||||
>a3 : Symbol(a3, Decl(destructuringParameterDeclaration3ES5.ts, 12, 21))
|
||||
>a : Symbol(a, Decl(destructuringParameterDeclaration3ES5.ts, 13, 12))
|
||||
>Array : Symbol(Array, Decl(lib.d.ts, 1000, 23), Decl(lib.d.ts, 1171, 11), Decl(lib.d.ts, 1439, 1))
|
||||
>String : Symbol(String, Decl(lib.d.ts, 275, 1), Decl(lib.d.ts, 443, 11), Decl(lib.d.ts, 1538, 1))
|
||||
>String : Symbol(String, Decl(lib.d.ts, 275, 1), Decl(lib.d.ts, 443, 11), Decl(lib.d.ts, 1543, 1))
|
||||
|
||||
function a4(...a: arrayString) { }
|
||||
>a4 : Symbol(a4, Decl(destructuringParameterDeclaration3ES5.ts, 13, 36))
|
||||
|
||||
@@ -9,17 +9,17 @@
|
||||
type arrayString = Array<String>
|
||||
>arrayString : Symbol(arrayString, Decl(destructuringParameterDeclaration3ES6.ts, 0, 0))
|
||||
>Array : Symbol(Array, Decl(lib.d.ts, 1000, 23), Decl(lib.d.ts, 1171, 11), Decl(lib.d.ts, 1439, 1))
|
||||
>String : Symbol(String, Decl(lib.d.ts, 275, 1), Decl(lib.d.ts, 443, 11), Decl(lib.d.ts, 1538, 1))
|
||||
>String : Symbol(String, Decl(lib.d.ts, 275, 1), Decl(lib.d.ts, 443, 11), Decl(lib.d.ts, 1543, 1))
|
||||
|
||||
type someArray = Array<String> | number[];
|
||||
>someArray : Symbol(someArray, Decl(destructuringParameterDeclaration3ES6.ts, 7, 32))
|
||||
>Array : Symbol(Array, Decl(lib.d.ts, 1000, 23), Decl(lib.d.ts, 1171, 11), Decl(lib.d.ts, 1439, 1))
|
||||
>String : Symbol(String, Decl(lib.d.ts, 275, 1), Decl(lib.d.ts, 443, 11), Decl(lib.d.ts, 1538, 1))
|
||||
>String : Symbol(String, Decl(lib.d.ts, 275, 1), Decl(lib.d.ts, 443, 11), Decl(lib.d.ts, 1543, 1))
|
||||
|
||||
type stringOrNumArray = Array<String|Number>;
|
||||
>stringOrNumArray : Symbol(stringOrNumArray, Decl(destructuringParameterDeclaration3ES6.ts, 8, 42))
|
||||
>Array : Symbol(Array, Decl(lib.d.ts, 1000, 23), Decl(lib.d.ts, 1171, 11), Decl(lib.d.ts, 1439, 1))
|
||||
>String : Symbol(String, Decl(lib.d.ts, 275, 1), Decl(lib.d.ts, 443, 11), Decl(lib.d.ts, 1538, 1))
|
||||
>String : Symbol(String, Decl(lib.d.ts, 275, 1), Decl(lib.d.ts, 443, 11), Decl(lib.d.ts, 1543, 1))
|
||||
>Number : Symbol(Number, Decl(lib.d.ts, 456, 40), Decl(lib.d.ts, 518, 11))
|
||||
|
||||
function a1(...x: (number|string)[]) { }
|
||||
@@ -34,7 +34,7 @@ function a3(...a: Array<String>) { }
|
||||
>a3 : Symbol(a3, Decl(destructuringParameterDeclaration3ES6.ts, 12, 21))
|
||||
>a : Symbol(a, Decl(destructuringParameterDeclaration3ES6.ts, 13, 12))
|
||||
>Array : Symbol(Array, Decl(lib.d.ts, 1000, 23), Decl(lib.d.ts, 1171, 11), Decl(lib.d.ts, 1439, 1))
|
||||
>String : Symbol(String, Decl(lib.d.ts, 275, 1), Decl(lib.d.ts, 443, 11), Decl(lib.d.ts, 1538, 1))
|
||||
>String : Symbol(String, Decl(lib.d.ts, 275, 1), Decl(lib.d.ts, 443, 11), Decl(lib.d.ts, 1543, 1))
|
||||
|
||||
function a4(...a: arrayString) { }
|
||||
>a4 : Symbol(a4, Decl(destructuringParameterDeclaration3ES6.ts, 13, 36))
|
||||
|
||||
@@ -5,7 +5,7 @@ function f() {
|
||||
|
||||
if (Math.random()) {
|
||||
>Math.random : Symbol(Math.random, Decl(lib.d.ts, 608, 38))
|
||||
>Math : Symbol(Math, Decl(lib.d.ts, 522, 1), Decl(lib.d.ts, 633, 11), Decl(lib.d.ts, 1694, 1))
|
||||
>Math : Symbol(Math, Decl(lib.d.ts, 522, 1), Decl(lib.d.ts, 633, 11), Decl(lib.d.ts, 1691, 60))
|
||||
>random : Symbol(Math.random, Decl(lib.d.ts, 608, 38))
|
||||
|
||||
let arguments = 100;
|
||||
|
||||
@@ -8,7 +8,7 @@ function f() {
|
||||
|
||||
if (Math.random()) {
|
||||
>Math.random : Symbol(Math.random, Decl(lib.d.ts, 608, 38))
|
||||
>Math : Symbol(Math, Decl(lib.d.ts, 522, 1), Decl(lib.d.ts, 633, 11), Decl(lib.d.ts, 1694, 1))
|
||||
>Math : Symbol(Math, Decl(lib.d.ts, 522, 1), Decl(lib.d.ts, 633, 11), Decl(lib.d.ts, 1691, 60))
|
||||
>random : Symbol(Math.random, Decl(lib.d.ts, 608, 38))
|
||||
|
||||
const arguments = 100;
|
||||
|
||||
@@ -8,7 +8,7 @@ function f() {
|
||||
|
||||
if (Math.random()) {
|
||||
>Math.random : Symbol(Math.random, Decl(lib.d.ts, 608, 38))
|
||||
>Math : Symbol(Math, Decl(lib.d.ts, 522, 1), Decl(lib.d.ts, 633, 11), Decl(lib.d.ts, 1694, 1))
|
||||
>Math : Symbol(Math, Decl(lib.d.ts, 522, 1), Decl(lib.d.ts, 633, 11), Decl(lib.d.ts, 1691, 60))
|
||||
>random : Symbol(Math.random, Decl(lib.d.ts, 608, 38))
|
||||
|
||||
return () => arguments[0];
|
||||
|
||||
@@ -9,7 +9,7 @@ function f() {
|
||||
|
||||
if (Math.random()) {
|
||||
>Math.random : Symbol(Math.random, Decl(lib.d.ts, 608, 38))
|
||||
>Math : Symbol(Math, Decl(lib.d.ts, 522, 1), Decl(lib.d.ts, 633, 11), Decl(lib.d.ts, 1694, 1))
|
||||
>Math : Symbol(Math, Decl(lib.d.ts, 522, 1), Decl(lib.d.ts, 633, 11), Decl(lib.d.ts, 1691, 60))
|
||||
>random : Symbol(Math.random, Decl(lib.d.ts, 608, 38))
|
||||
|
||||
return () => arguments[0];
|
||||
|
||||
@@ -9,7 +9,7 @@ function f() {
|
||||
|
||||
if (Math.random()) {
|
||||
>Math.random : Symbol(Math.random, Decl(lib.d.ts, 608, 38))
|
||||
>Math : Symbol(Math, Decl(lib.d.ts, 522, 1), Decl(lib.d.ts, 633, 11), Decl(lib.d.ts, 1694, 1))
|
||||
>Math : Symbol(Math, Decl(lib.d.ts, 522, 1), Decl(lib.d.ts, 633, 11), Decl(lib.d.ts, 1691, 60))
|
||||
>random : Symbol(Math.random, Decl(lib.d.ts, 608, 38))
|
||||
|
||||
return () => arguments;
|
||||
|
||||
@@ -1,7 +1,7 @@
|
||||
=== tests/cases/conformance/es6/for-ofStatements/for-of37.ts ===
|
||||
var map = new Map([["", true]]);
|
||||
>map : Symbol(map, Decl(for-of37.ts, 0, 3))
|
||||
>Map : Symbol(Map, Decl(lib.d.ts, 1867, 1), Decl(lib.d.ts, 1889, 11))
|
||||
>Map : Symbol(Map, Decl(lib.d.ts, 1864, 1), Decl(lib.d.ts, 1886, 11))
|
||||
|
||||
for (var v of map) {
|
||||
>v : Symbol(v, Decl(for-of37.ts, 1, 8))
|
||||
|
||||
@@ -1,7 +1,7 @@
|
||||
=== tests/cases/conformance/es6/for-ofStatements/for-of38.ts ===
|
||||
var map = new Map([["", true]]);
|
||||
>map : Symbol(map, Decl(for-of38.ts, 0, 3))
|
||||
>Map : Symbol(Map, Decl(lib.d.ts, 1867, 1), Decl(lib.d.ts, 1889, 11))
|
||||
>Map : Symbol(Map, Decl(lib.d.ts, 1864, 1), Decl(lib.d.ts, 1886, 11))
|
||||
|
||||
for (var [k, v] of map) {
|
||||
>k : Symbol(k, Decl(for-of38.ts, 1, 10))
|
||||
|
||||
@@ -1,7 +1,7 @@
|
||||
=== tests/cases/conformance/es6/for-ofStatements/for-of40.ts ===
|
||||
var map = new Map([["", true]]);
|
||||
>map : Symbol(map, Decl(for-of40.ts, 0, 3))
|
||||
>Map : Symbol(Map, Decl(lib.d.ts, 1867, 1), Decl(lib.d.ts, 1889, 11))
|
||||
>Map : Symbol(Map, Decl(lib.d.ts, 1864, 1), Decl(lib.d.ts, 1886, 11))
|
||||
|
||||
for (var [k = "", v = false] of map) {
|
||||
>k : Symbol(k, Decl(for-of40.ts, 1, 10))
|
||||
|
||||
@@ -5,7 +5,7 @@ var k: string, v: boolean;
|
||||
|
||||
var map = new Map([["", true]]);
|
||||
>map : Symbol(map, Decl(for-of45.ts, 1, 3))
|
||||
>Map : Symbol(Map, Decl(lib.d.ts, 1867, 1), Decl(lib.d.ts, 1889, 11))
|
||||
>Map : Symbol(Map, Decl(lib.d.ts, 1864, 1), Decl(lib.d.ts, 1886, 11))
|
||||
|
||||
for ([k = "", v = false] of map) {
|
||||
>k : Symbol(k, Decl(for-of45.ts, 0, 3))
|
||||
|
||||
@@ -1,7 +1,7 @@
|
||||
=== tests/cases/conformance/es6/for-ofStatements/for-of50.ts ===
|
||||
var map = new Map([["", true]]);
|
||||
>map : Symbol(map, Decl(for-of50.ts, 0, 3))
|
||||
>Map : Symbol(Map, Decl(lib.d.ts, 1867, 1), Decl(lib.d.ts, 1889, 11))
|
||||
>Map : Symbol(Map, Decl(lib.d.ts, 1864, 1), Decl(lib.d.ts, 1886, 11))
|
||||
|
||||
for (const [k, v] of map) {
|
||||
>k : Symbol(k, Decl(for-of50.ts, 1, 12))
|
||||
|
||||
@@ -1,7 +1,7 @@
|
||||
=== tests/cases/conformance/es6/for-ofStatements/for-of57.ts ===
|
||||
var iter: Iterable<number>;
|
||||
>iter : Symbol(iter, Decl(for-of57.ts, 0, 3))
|
||||
>Iterable : Symbol(Iterable, Decl(lib.d.ts, 1663, 1))
|
||||
>Iterable : Symbol(Iterable, Decl(lib.d.ts, 1668, 1))
|
||||
|
||||
for (let num of iter) { }
|
||||
>num : Symbol(num, Decl(for-of57.ts, 1, 8))
|
||||
|
||||
Some files were not shown because too many files have changed in this diff Show More
Reference in New Issue
Block a user